[go: up one dir, main page]

Skip to content

Gitlab API returns 404 Avatar Not Found when download an in-git avatar

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Hello, I'm reporting a bug with the download avatar API endpoint when the avatar is hosted inside Git repository (as logo.png file).

Summary

Gitlab API return 404 Avatar Not Found when using the download avatar API endpoint if the avatar is deployed using a logo file inside Git repository. As describe in documentation: add-a-logo-to-your-repository. But if the logo is uploaded using the project settings, the API works as expected: upload-an-avatar-in-project-settings

It should be a bug because according to the documentation page of projects (https://docs.gitlab.com/ee/api/projects.html#download-a-project-avatar), /projects/:id/avatar can be used without authentification for public repository: Download a project avatar. You can access this endpoint without authentication if the project is publicly accessible..

Depending on the type of URL in avatar_url, the download API endpoint will not always work:

Project 26454230:

Project 64911039:

Steps to reproduce

  1. Open an incognito browser
  2. Go to "https://gitlab.com/api/v4/projects/64911039/avatar"
  3. Page return an error: {"message":"404 Avatar Not Found"}

The error is not normal because the avatar does exist! Now, we use the real avatar_url from projects API:

  1. Open an incognito browser
  2. Go to "https://gitlab.com/api/v4/projects/64911039"
  3. Copy the avatar_url value and go to the url
  4. Avatar download in progress...

What is the current bug behavior?

Download Avatar API endpoint on Gitlab project with in-git logo return a 404 Avatar Not Found.

What is the expected correct behavior?

The project is public, so we should be able to download the avatar without error. Like downloading the logo using the public avatar_url.

Output of checks

This bug happens on GitLab.com

Edited by 🤖 GitLab Bot 🤖