Skip to content

projects.get() raises error when project is specified as "userspace/name" rather than ID #913

Description

@terminalmage

Description of the problem, including code/CLI snippet

Attempt to make a query using the project's path, per the example in the documentation.

gl.projects.get('mygroup/myname')

Expected Behavior

python-gitlab resolves the group and project name, returning a Project object for that project.

Actual Behavior

Exception is raised with the following error:

Error encountered triggering pipeline: 404: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/v4/projects/mygroup/myname was not found on this server.</p>
</body></html>

From the URL in the error, it appears that the project is not being resolved at all and that python-gitlab is assuming the value passed in was the project ID.

Specifications

  • python-gitlab version: 1.12.1
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 11.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions