Cannot upload project avatar via API on a specific instance of GitLab

I am having trouble uploading a project avatar via API on a specific instance of GitLab (the Salsa Debian’s server), even though it works for me in other instances. I reported already this issue.

Whenever I try to run this:

curl --request PUT --header "PRIVATE-TOKEN: XXXXXX" --form "avatar=@file.png" "https://salsa.debian.org/api/v4/projects/63559"

I get this:

{"error":"avatar is invalid"}

Since it works for me on another instance of GitLab, the issue is certainly related to a problem specific to the salsa.debian.org server. Could any person familiar with the GitLab code indicate to me where that error message "avatar is invalid" is generated, so that I can start to track the problem down?

Thanks in advance for any help!

Maybe the picture exceeds the file size limit, or dimensions that are allowed for uploading.

Suggest continuing in Cannot upload avatar file via the GitLab API (#335) · Issues · Salsa / support · GitLab and compare the GitLab versions from all involved instances you have tested on. You can access them when logged in, at /help.

First of all, I apologize for continuing here.

Both instances are running GitLab version 15.8.3. At the Salsa instance, I can upload a project avatar using the web interface, so I guess it is not a problem with file size limit or image format.

By the way, when I use the API to upload a project avatar with a wrong file format to on the instance that works, I get this:

{"message":{"avatar":["file format is not supported. Please try one of the following supported formats: image/png, image/jpeg, image/gif, image/bmp, image/tiff, image/vnd.microsoft.icon"]}}

On Salsa, I receive this:

{"error":"avatar is invalid"}

salsa.debian.org is operated by the Debian infrastructure team. They might not necessarily read this forum thread, and can help better with investigating the error message on the client side, and correlate that with server logs for example.

AFAIK the GitLab instance on salsa.debian.org is compiled from GitLab sources into a custom Debian package which is installed, and not using the gitlab-ce package. gitlab - Debian Wiki

This custom package can have patches applied, or otherwise the instance has disabled integrations - i.e. for avatars that might explain the error. Looking into the debian/ directory in the package build repository unveils some patches. Folder: debian | Debian Sources I did not dig deeper though.

Searching for the error message string in the gitlab-org/gitlab project source code leads to these results: "file format is not supported" · Search · GitLab

The same result should come up looking in the deb-src package at gitlab - Debian Package Tracker

My suggestion is still to continue in Cannot upload avatar file via the GitLab API (#335) · Issues · Salsa / support · GitLab where the Debian infrastructure team can help investigate better.

1 Like

Thank you very much for the detailed report. I will forward it into the Debian support Salsa support and continue the discussion there.

1 Like