Skip to content

[Bug]: Custom GitLab avatars do not load in merge requests #39957

Closed

Description

@Ernest0-Production

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Sign in to a self-hosted GitLab (or a private gitlab.com project) with glab.
  2. Open a merge request whose author or reviewers have a custom GitLab avatar (not the default Gravatar/identicon).
  3. Look at the MR list, detail header, and activity avatars in T3 Code.

Expected behavior

Custom GitLab avatars load, using the same GitLab login T3 already uses for the merge request.

Actual behavior

Custom avatars fail. Users who never set an avatar still show, because GitLab gives a public Gravatar/identicon URL.

T3 copies avatar_url from the GitLab API onto a raw <img> / Image (PullRequestActorAvatar in apps/web/src/components/pullRequest/pullRequestPresentation.tsx, mobile apps/mobile/src/features/pull-requests/PullRequestPresentation.tsx). There is no Authorization / PRIVATE-TOKEN on that request.

A custom avatar is typically https://<gitlab-host>/uploads/-/system/user/avatar/<id>/<file>. An anonymous GET is 302 /users/sign_in or 403 (WAF). A default avatar is a Gravatar CDN URL and loads without a login.

GitHub avatars are on avatars.githubusercontent.com and do not need a token. GHES failures only fall back to initials (#11727). GitLab's adapter has no mediaUrl / fetchMedia on main, so host-served images are never fetched with glab.

Related, not this bug:

Impact

Minor bug or occasional failure

Version or commit

main @ f2ec853

Environment

Web and desktop PR panel; also mobile actor avatars. Self-hosted GitLab (and private gitlab.com).

Logs or stack traces

Anonymous GET /uploads/-/system/user/avatar/<id>/<file> → 302 /users/sign_in or 403
Gravatar / identicon URL → 200

Workaround

None for custom avatars. Initials appear after onError on web.

Activity

  1. Ernest0-Production commented on Nov 20, 2026

    @Ernest0-Production
    ContributorAuthor

    Correction after hitting a live self-managed GitLab 19.4.5-ee: this is not a missing-token problem on that instance.

    The image itself is public. An anonymous GET of https://<host>/uploads/-/system/user/avatar/<id>/avatar.png?v=… returns 200 image/png. The same URL with PRIVATE-TOKEN or Bearer is also 200. Gravatar URLs are 200 as well.

    The list payload is the bug. On GitLab 17.9+ the merge request list uses GraphQL. user.avatarUrl for an uploaded avatar is a bare path (/uploads/-/system/user/avatar/…). REST avatar_url is the same image as a full https://<host>/uploads/… URL. T3 passed the GraphQL path through as avatarUrl, so the client loaded it from the T3 origin. Gravatar values are already absolute in GraphQL, which is why default avatars kept working.

    MR detail, issues, and reviewers already read REST and get full URLs. Fix is in #39973: resolve a relative GraphQL avatarUrl against the merge request webUrl. Absolute URLs are left alone.

    Related, still not this bug: #11412 / #23501 (project description/comment uploads under /uploads/<secret>/, which do need a credential).

    A separate case remains unhandled: an instance that requires sign-in for /uploads/-/system/user/avatar/… would still fail after this URL fix, because the client <img> has no GitLab token. That was not the failure we reproduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions