marge-bot: TypeError: 'NoneType' object is not subscriptable

We’re trying to get marge-bot up and running on our own gitlab instance, and might have found a bug?

> marge/project.py
>> return AccessLevel(self.info['permissions']['project_access']['access_level'])
>> TypeError: 'NoneType' object is not subscriptable

After looking into this a bit, it looks like gitlabs api will return permissions only on the /projects/:id request, but not for /projects.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (14 by maintainers)

Commits related to this issue

Most upvoted comments

I think we can close this now, as the fix has made it into master.

Believe it or not but some projects the user has access to come back with an empty permissions array:

    'permissions': {
      'project_access': None,
      'group_access': None
    }

Even though the user is a master on the group. We tracked this down to a gitlab bug that we have not reported(or found the issue tracking) where subgroups getting moved do not cascade proper permissions down.

So we removed our user from these groups and manually re-added. Now we still have group level access

    'permissions': {
      'project_access': None,
      'group_access': {
        'access_level': 40,
        'notification_level': 3
      }
    }

I see two things needing to happen here:

  1. Fallback to group access if project is not present
  2. Have some better handling if neither are present