Skip to content

project-export download fails in cli.py #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jgeorgeson opened this issue Jul 20, 2018 · 3 comments
Closed

project-export download fails in cli.py #559

jgeorgeson opened this issue Jul 20, 2018 · 3 comments

Comments

@jgeorgeson
Copy link

Description of the problem, including code/CLI snippet

> python --version
Python 3.6.5
7/20/2018 4:50:32 PM HBL4218 ~
> gitlab -g rd project-export download --project-id 3

Same behavior in Python 3.4.8 on CentOS, also with v1.5.1.

Expected Behavior

Project export archive is downloaded

Actual Behavior

Traceback (most recent call last):
  File "C:\Python36\Scripts\gitlab-script.py", line 11, in <module>
    load_entry_point('python-gitlab==1.5.1', 'console_scripts', 'gitlab')()
  File "c:\python36\lib\site-packages\gitlab\cli.py", line 179, in main
    cli_module.run(gl, what, action, args, verbose, output, fields)
  File "c:\python36\lib\site-packages\gitlab\v4\cli.py", line 357, in run
    data = g_cli()
  File "c:\python36\lib\site-packages\gitlab\v4\cli.py", line 61, in __call__
    return self.do_custom()
  File "c:\python36\lib\site-packages\gitlab\v4\cli.py", line 73, in do_custom
    data[self.cls._id_attr] = self.args.pop(self.cls._id_attr)
KeyError: None

Specifications

  • python-gitlab version: 1.5.1
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 10.7.5 EE
@ghost
Copy link

ghost commented Aug 3, 2018

I found a similar error where in python, the project object has no export attribute, see here

Traceback (most recent call last):
File "/home/user/Programming/Gitlab Backups/backup_gitlab_data.py", line 197, in
gitlab_backups.backup_project('https://gitlab.com/Gitlab-Backups/Gitlab-Backups-Script')
File "/home/user/Programming/Gitlab Backups/backup_gitlab_data.py", line 59, in backup_project
export = project.exports.create({})
File "/home/user.local/lib/python3.6/site-packages/gitlab/base.py", line 607, in getattr
raise AttributeError(name)
AttributeError: exports

And if i do a pprint of all project attributes:

['class',
'delattr',
'dict',
'dir',
'doc',
'eq',
'format',
'ge',
'getattr',
'getattribute',
'getstate',
'gt',
'hash',
'init',
'init_subclass',
'le',
'lt',
'module',
'ne',
'new',
'reduce',
'reduce_ex',
'repr',
'setattr',
'setstate',
'sizeof',
'str',
'subclasshook',
'weakref',
'_attrs',
'_create_managers',
'_get_updated_data',
'_id_attr',
'_managers',
'_module',
'_parent_attrs',
'_short_print_attr',
'_update_attrs',
'_updated_attrs',
'accessrequests',
'archive',
'attributes',
'boards',
'branches',
'commits',
'create_fork_relation',
'customattributes',
'delete',
'delete_fork_relation',
'deployments',
'environments',
'events',
'files',
'forks',
'get_id',
'hooks',
'housekeeping',
'issues',
'jobs',
'keys',
'labels',
'manager',
'members',
'mergerequests',
'milestones',
'notes',
'notificationsettings',
'pagesdomains',
'pipelines',
'pipelineschedules',
'protectedbranches',
'repository_archive',
'repository_blob',
'repository_compare',
'repository_contributors',
'repository_raw_blob',
'repository_tree',
'runners',
'save',
'services',
'share',
'snippets',
'star',
'tags',
'trigger_pipeline',
'triggers',
'unarchive',
'unshare',
'unstar',
'upload',
'users',
'variables',
'wikis']

Specs:
python-gitlab-1.5.1
Api v4
Gitlab: Gitlab.com (GitLab Enterprise Edition 11.2.0-rc1-ee 53c4827)

@gpocentek
Copy link
Contributor

@ManchurianSector this looks like a different issue, and from the backtrace you provided I don't think that you are not using version 1.5.1 of python-gitlab.

@gpocentek
Copy link
Contributor

@jgeorgeson thanks for the bug report, the fix will be in the next release (coming soon).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants