Skip to content

GITLAB 404 project not found #2282

@yvann-ponce

Description

@yvann-ponce

Git provider

Gitlab

System Info

Hello, I face the following issue

 File "/app/pr_agent/git_providers/gitlab_provider.py", line 877, in _get_merge_request
    mr = self.gl.projects.get(self.id_project).mergerequests.get(self.id_mr)
         │    │  │        │   │    │                             │    └ 1
         │    │  │        │   │    │                             └ <pr_agent.git_providers.gitlab_provider.GitLabProvider object at 0x7fd73629a870>
         │    │  │        │   │    └ 'xxxxx/xxxxx'
         │    │  │        │   └ <pr_agent.git_providers.gitlab_provider.GitLabProvider object at 0x7fd73629a870>
         │    │  │        └ <function ProjectManager.get at 0x7fd737b1b380>
         │    │  └ <gitlab.v4.objects.projects.ProjectManager object at 0x7fd7378839b0>
         │    └ <gitlab.client.Gitlab object at 0x7fd73565e3c0>
         └ <pr_agent.git_providers.gitlab_provider.GitLabProvider object at 0x7fd73629a870>
  File "/usr/local/lib/python3.12/site-packages/gitlab/v4/objects/projects.py", line 860, in get
    return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
           │    │                       │        │       └ {}
           │    │                       │        └ False
           │    │                       └ 'xxxxx/xxxxxx'
           │    └ <class 'gitlab.v4.objects.projects.Project'>
           └ <function cast at 0x7fd73e746d40>
  File "/usr/local/lib/python3.12/site-packages/gitlab/exceptions.py", line 338, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e
          └ <class 'gitlab.exceptions.GitlabGetError'>
gitlab.exceptions.GitlabGetError: 404: 404 Project Not Found

The gitlab ci code

pr_agent:
  stage: review
  image:
    name: codiumai/pr-agent:latest
    entrypoint: [""]
  variables:
    OPENAI__KEY: $OPENAI_API_KEY
    openai__api_base: $OPENAI_BASE_URL
    config__model: $OPENAI_MODEL
    GITLAB_API_TOKEN: $QODO_GITLAB_API_TOKEN
    GITLAB__URL: $CI_SERVER_PROTOCOL://$CI_SERVER_FQDN
    MR_URL: $CI_MERGE_REQUEST_PROJECT_URL/merge_requests/$CI_MERGE_REQUEST_IID
    GITLAB__PERSONAL_ACCESS_TOKEN: $QODO_GITLAB_API_TOKEN
    CONFIG__GIT_PROVIDER: gitlab
  script:
    - cd /app
    - echo "Running PR Agent action step"
    - python -m pr_agent.cli --pr_url="$MR_URL" describe
    - python -m pr_agent.cli --pr_url="$MR_URL" review
    - python -m pr_agent.cli --pr_url="$MR_URL" improve
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"

I even tested with admin rights token, it is not working.
My token is not in protected mde neither.

Do you have any hints on that ?

Bug details

gitlab.exceptions.GitlabGetError: 404: 404 Project Not Found
Failed to get git provider for xxxxxxxxxxxxx

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