I got an error: Failed to load and execute Flow's environment: GitlabGetError('404 Project Not Found') - how to fix it?

My flow run ends with a message: {"message":"404 Project Not Found"}

How to fix this?

This issue is related to the Personal Access Token. In order to fix this, you need to set the following scopes on your access token:

  • api
  • read_api
  • read_repository
  • read_registry

As a role, you can assign Maintainer - it may look as follows:

You may also need to ensure that your repository is assigned to the group ID of the organization under which this token is created.

Once the token is created, you can test whether it works by running a curl command:

curl -H "PRIVATE-TOKEN: your_token_here" https://gitlab.com/api/v4/projects/YOUR_PROJECT_ID_HERE/repository/tags

If this is working, you can create the GITLAB_ACCESS_TOKEN secret in the Cloud UI and reference it under the variable access_token_secret:

flow.storage = GitLab(repo="project_name/repo_name", path="/flows/flow.py", ref="main", access_token_secret="GITLAB_ACCESS_TOKEN")