*runtime.TypeAssertionError: interface conversion: interface {} is string, not upload.CachedAvatar #2300

Closed
opened 2026-03-22 14:01:59 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @sentry[bot] on GitHub (Sep 2, 2025).

Originally assigned to: @Copilot on GitHub.

Sentry Issue: API-OSS-26

*runtime.TypeAssertionError: interface conversion: interface {} is string, not upload.CachedAvatar
  File "/go/src/code.vikunja.io/api/pkg/modules/avatar/upload/upload.go", line 95, in (*Provider).GetAvatar
  File "/go/src/code.vikunja.io/api/pkg/routes/api/v1/avatar.go", line 107, in GetAvatar
  File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 248, in registerAPIRoutes.func1.1
  File "/go/src/code.vikunja.io/api/pkg/routes/static.go", line 144, in setupStaticFrontendFilesHandler.static.func2.1
  File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 95, in NewEcho.slogHTTPMiddleware.func1.1
...
(8 additional frame(s) were not displayed)

Resolve:

  1. add logging around when the type is not correct, with the stored value
  2. make sure it does not crash when the type cast fails
Originally created by @sentry[bot] on GitHub (Sep 2, 2025). Originally assigned to: @Copilot on GitHub. Sentry Issue: [API-OSS-26](https://vikunja.sentry.io/issues/6851761200/?referrer=github_integration) ``` *runtime.TypeAssertionError: interface conversion: interface {} is string, not upload.CachedAvatar File "/go/src/code.vikunja.io/api/pkg/modules/avatar/upload/upload.go", line 95, in (*Provider).GetAvatar File "/go/src/code.vikunja.io/api/pkg/routes/api/v1/avatar.go", line 107, in GetAvatar File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 248, in registerAPIRoutes.func1.1 File "/go/src/code.vikunja.io/api/pkg/routes/static.go", line 144, in setupStaticFrontendFilesHandler.static.func2.1 File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 95, in NewEcho.slogHTTPMiddleware.func1.1 ... (8 additional frame(s) were not displayed) ``` Resolve: 1. add logging around when the type is not correct, with the stored value 2. make sure it does not crash when the type cast fails
Author
Owner

@kolaente commented on GitHub (Sep 2, 2025):

These issues seem related:

Sentry Issue: API-OSS-25

*runtime.TypeAssertionError: interface conversion: interface {} is string, not initials.CachedAvatar
  File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 200, in (*Provider).GetAvatar
  File "/go/src/code.vikunja.io/api/pkg/routes/api/v1/avatar.go", line 107, in GetAvatar
  File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 248, in registerAPIRoutes.func1.1
  File "/go/src/code.vikunja.io/api/pkg/routes/static.go", line 144, in setupStaticFrontendFilesHandler.static.func2.1
  File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 95, in NewEcho.slogHTTPMiddleware.func1.1
...
(8 additional frame(s) were not displayed)

Sentry Issue: API-OSS-27

*runtime.TypeAssertionError: interface conversion: interface {} is string, not image.RGBA64
  File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 158, in getAvatarForUser
  File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 175, in (*Provider).GetAvatar.func1
  File "/go/src/code.vikunja.io/api/pkg/modules/keyvalue/keyvalue.go", line 102, in Remember
  File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 173, in (*Provider).GetAvatar
  File "/go/src/code.vikunja.io/api/pkg/routes/api/v1/avatar.go", line 107, in GetAvatar
...
(11 additional frame(s) were not displayed)
@kolaente commented on GitHub (Sep 2, 2025): These issues seem related: Sentry Issue: [API-OSS-25](https://vikunja.sentry.io/issues/6851761196/?referrer=github_integration) ``` *runtime.TypeAssertionError: interface conversion: interface {} is string, not initials.CachedAvatar File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 200, in (*Provider).GetAvatar File "/go/src/code.vikunja.io/api/pkg/routes/api/v1/avatar.go", line 107, in GetAvatar File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 248, in registerAPIRoutes.func1.1 File "/go/src/code.vikunja.io/api/pkg/routes/static.go", line 144, in setupStaticFrontendFilesHandler.static.func2.1 File "/go/src/code.vikunja.io/api/pkg/routes/routes.go", line 95, in NewEcho.slogHTTPMiddleware.func1.1 ... (8 additional frame(s) were not displayed) ``` Sentry Issue: [API-OSS-27](https://vikunja.sentry.io/issues/6851765067/?referrer=github_integration) ``` *runtime.TypeAssertionError: interface conversion: interface {} is string, not image.RGBA64 File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 158, in getAvatarForUser File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 175, in (*Provider).GetAvatar.func1 File "/go/src/code.vikunja.io/api/pkg/modules/keyvalue/keyvalue.go", line 102, in Remember File "/go/src/code.vikunja.io/api/pkg/modules/avatar/initials/initials.go", line 173, in (*Provider).GetAvatar File "/go/src/code.vikunja.io/api/pkg/routes/api/v1/avatar.go", line 107, in GetAvatar ... (11 additional frame(s) were not displayed) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#2300