Skip to content

gitlab-artifact-cleanup script unable to delete some artifacts #217

Closed

Description

@aacoloma

The script worked fine on most projects but not this last one.
Here is the error we get.
powerserver7 / Worklist
Traceback (most recent call last):
File "/opt/gitlab-artifact-cleanup/gitlab-artifact-cleanup", line 181, in
main()
------ more logs-----
------ more logs-----
File "/usr/local/lib/python2.7/dist-packages/python_gitlab-0.15.1-py2.7.egg/gitlab/init.py", line 392, in _raw_list
results.extend(self.list(cls, **args))
File "/usr/local/lib/python2.7/dist-packages/python_gitlab-0.15.1-py2.7.egg/gitlab/init.py", line 468, in list
return self._raw_list(url, obj_class, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/python_gitlab-0.15.1-py2.7.egg/gitlab/init.py", line 392, in _raw_list
results.extend(self.list(cls, **args))
File "/usr/local/lib/python2.7/dist-packages/python_gitlab-0.15.1-py2.7.egg/gitlab/init.py", line 468, in list
return self._raw_list(url, obj_class, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/python_gitlab-0.15.1-py2.7.egg/gitlab/init.py", line 374, in _raw_list
r = self.raw_get(path, **params)
File "/usr/local/lib/python2.7/dist-packages/python_gitlab-0.15.1-py2.7.egg/gitlab/init.py", line 360, in _raw_get
"Can't connect to GitLab server (%s)" % e)
gitlab.exceptions.GitlabConnectionError: Can't connect to GitLab server (maximum recursion depth exceeded)

And this is our system info.
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:1.13.6
Rake Version: 10.5.0
Sidekiq Version:4.2.1

GitLab information
Version: 8.14.4
Revision: 3ea6c8d
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL:
HTTP Clone URL:
SSH Clone URL:
Using LDAP: yes
Using Omniauth: no

GitLab Shell
Version: 4.0.3
Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories
    Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
    Git: /opt/gitlab/embedded/bin/git

Please help

Activity

  1. gpocentek commented on Feb 8, 2017

    @gpocentek
    Contributor

    Could you check with the gitlab-artifact-cleanup project what could happen? https://github.com/JonathonReinhart/gitlab-artifact-cleanup

    I can't be sure that your problem is related to python-gitlab. Thanks.

  2. johanbrandhorst commented on Mar 15, 2017

    @johanbrandhorst

    This is because gitlab-artifact-cleanup uses project.builds.list(all=True) which recursively populates a list of builds, eventually hitting the recursion limit on a large project.

  3. johanbrandhorst commented on Mar 15, 2017

    @johanbrandhorst

    I've submitted a PR that fixes it.

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