Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Group avatar - file format not supported issue#2751

Discussion options

Description of the problem, including code/CLI snippet

I'm trying to add avatar to group using following command:

gitlab -v group create --name "Test 1" --path "test1" --parent-id 21 --avatar "/tmp/logo_lab.png"

where:

  1. Group creation without--avatar option works correctly.
  2. Path to .png is absulute path to file with correct read permissions.
  3. The same file added using web-gui dispalys correctly.

Expected Behavior

Avatar added to group.

Actual Behavior

Message returned:
Impossible to create object (400: Failed to save group {: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"]})

Specifications

  • python-gitlab version: 4.2.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): v16.6.2-ee
You must be logged in to vote

I have created an issue#2752 to track it. I don't have an ETA on when someone will volunteer to work on it.

Replies: 2 comments 3 replies

Comment options

I think you will need to do something like:https://python-gitlab.readthedocs.io/en/main/cli-usage.html#reading-values-from-files

gitlab -v group create --name "Test 1" --path "test1" --parent-id 21 --avatar "@/tmp/logo_lab.png"

You must be logged in to vote
0 replies
Comment options

Already tested with following results:
'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte
which seems to be answer from python.

You must be logged in to vote
3 replies
@JohnVillalovos
Comment options

Ah. The code for the@ prefix assumes it is a text file :(

So at the moment I don't think it can be done via the CLI. With the API it can be done.

@trafford-tbe
Comment options

Yes. I made it with cURL, but tried to use one module for Ansible:
https://docs.ansible.com/ansible/latest/collections/community/general/gitlab_group_module.html
Nevertheless, thank you for confirmation, but does this mean we have an issue now?

@JohnVillalovos
Comment options

I have created an issue#2752 to track it. I don't have an ETA on when someone will volunteer to work on it.

Answer selected bytrafford-tbe
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@trafford-tbe@JohnVillalovos
Converted from issue

This discussion was converted from issue #2750 on December 27, 2023 19:37.


[8]ページ先頭

©2009-2025 Movatter.jp