Skip to content

sudo not woks with latest gitlab #193

Closed

Description

@delagen

Traceback (most recent call last):
File "./tagger", line 25, in
project.tags.create({"tag_name":args.tag,"ref":args.ref,"message":args.message}, sudo=args.user)
File "/usr/lib/python2.7/site-packages/gitlab/objects.py", line 142, in create
return self.obj_cls.create(self.gitlab, data, **args)
File "/usr/lib/python2.7/site-packages/gitlab/objects.py", line 353, in create
obj.save()
File "/usr/lib/python2.7/site-packages/gitlab/objects.py", line 323, in save
self._create(**kwargs)
File "/usr/lib/python2.7/site-packages/gitlab/objects.py", line 308, in _create
json = self.gitlab.create(self, **kwargs)
File "/usr/lib/python2.7/site-packages/gitlab/init.py", line 511, in create
raise_error_from_response(r, GitlabCreateError, 201)
File "/usr/lib/python2.7/site-packages/gitlab/exceptions.py", line 180, in raise_error_from_response
response_body=response.content)
gitlab.exceptions.GitlabCreateError: 403: 403 Forbidden - Private token must be specified in order to use sudo

Activity

  1. delagen commented on Dec 23, 2016

    @delagen
    Author

    Thound PAT disabled only main access token used
    No user id or username error for supplied id

  2. gpocentek commented on Dec 24, 2016

    @gpocentek
    Contributor

    It seems that the error comes from the server, not python-gitlab. Have you disabled token authentication on your server?

    Sudo works fine for me with token authentication.

  3. delagen commented on Dec 25, 2016

    @delagen
    Author

    @gpocentek Yes.

    1. From version 8.14 Personal Access Tokens was disabled to use sudo. ONLY PRIVATE.
    2. When using sudo argument as user id provided as int data type error about User not found occured, when supply as string all OK.
  4. gpocentek commented on Dec 25, 2016

    @gpocentek
    Contributor

    It seems that gitlab now expects a string for the sudo value, even if it's the ID you're using. Could you test this to make sure I'm not wrong?

    Thank you.

  5. locked as resolved and limited conversation to collaborators on Nov 22, 2021
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