Skip to content

Conan package registry does not support v2.0

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Gitlab's conan package registry is not compatible with the forthcoming conan 2.0 release. Authentication fails with a 404 error, and no remote operations are possible without first authenticating.

Steps to reproduce

  1. Install a pre-release build of conan, e.g. pip install --pre conan or pipx install conan --pip-args='--pre'. At time of testing, this is conan@2.0.0b8.
  2. Add the conan remote for a Gitlab project: conan remote add gitlab https://gitlab.com/api/v4/projects/42871993/packages/conan
  3. Attempt to login. Enter a password/token when prompted:
    conan remote login gitlab <user>
    Please enter a password for "<user>" account:
    ERROR: b'{"error":"404 Not Found"}'
    
    Invalid server response, check remote URL and try again. [Remote: gitlab]

Example Project

A new, empty project is sufficient to replicate the behavior.

What is the current bug behavior?

Conan fails to authenticate.

What is the expected correct behavior?

Successful authentication.

Relevant logs and/or screenshots

It appears the problem is with the endpoint https://gitlab.com/api/v4/projects/42871993/packages/conan/v2/users/authenticate. Running with -vvv verbosity results in this additional output:

=> _action: CONAN_API, name: remotes.user_info, parameters: {}
=> _action: CONAN_API, name: remotes.login, parameters: {}
=> _action: REST_API_CALL, method: GET, url: https://gitlab.com/api/v4/projects/42871993/packages/conan/v1/ping, duration: 1.4356601238250732, headers: {'X-Client-Anonymous-Id': '**********', 'X-Client-Id': '', 'User-Agent': 'Conan/2.0.0-beta8 (Darwin 22.3.0; Python 3.10.9; arm64)'}
=> _action: REST_API_CALL, method: GET, url: https://gitlab.com/api/v4/projects/42871993/packages/conan/v2/users/authenticate, duration: 1.1586668491363525, headers: {'X-Client-Anonymous-Id': '**********', 'X-Client-Id': '', 'User-Agent': 'Conan/2.0.0-beta8 (Darwin 22.3.0; Python 3.10.9; arm64)'}

Hitting the last URL results in the same 404 JSON response.

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by 🤖 GitLab Bot 🤖