cirruslabs / gitlab-tart-executor

GitLab Runner executor to run jobs in Tart VMs
MIT License
60 stars 5 forks source link

tart pull causes a 403 AuthFailed error #28

Closed JulianH closed 1 year ago

JulianH commented 1 year ago

Hello,

i get an unexpected error when try to run a Gitlab job using a tart image:

Running with gitlab-runner 15.10.1 (dcfb4b66)
  on tart-on-wrkmac03.local 8v2GZgty
  feature flags: FF_RESOLVE_FULL_TLS_CHAIN:false
Preparing the "custom" executor
Using Custom executor...
 Pulling the latest version of ghcr.io/cirruslabs/macos-ventura-xcode:14.3.1...
 tart command returned non-zero exit code: "Error: AuthFailed(why: \"received unexpected HTTP status code 403 while retrieving an authentication token\", details: \"{\\\"errors\\\":[{\\\"code\\\":\\\"DENIED\\\",\\\"message\\\":\\\"denied\\\"}]}\\n\")"
WARNING: Cleanup script failed: exit status 1
ERROR: Job failed: exit status 1

If try to do manually a tart pull ..., everything is working fine.

edigaryev commented 1 year ago

Hello Julian!

How your .gitlab-ci.yml is configured?

JulianH commented 1 year ago

Hi @edigaryev, thanks for the quick reply!

This is my .gitlab-ci.yml:

flutter_build_ios:
  image: ghcr.io/cirruslabs/macos-ventura-xcode:14.3.1
  stage: build
  tags:
    - tart
  before_script:
    - export PATH="$PATH:$HOME/.pub-cache/bin"
    - flutter pub get
  script:
    - flutter doctor
fkorotkov commented 1 year ago

Have you tart login before? Maybe credentials have expired. Could you please try to go to Keychain and look for "Tart Credentials" and delete them.

JulianH commented 1 year ago

Have you tart login before? Maybe credentials have expired. Could you please try to go to Keychain and look for "Tart Credentials" and delete them.

Hi @fkorotkov, no i didn't used that command before. Also i cannot find any entry in the Keychain related to tart.

edigaryev commented 1 year ago

Please check out the new version of GitLab Tart Executor that includes support for TART_REGISTRY_HOSTNAME.

This will also require a Tart 1.8.3 to be installed on your GitLab Runner/host machine to work properly.

With this change, Tart won't try to use GitLab CI Registry's provided credentials for ghcr.io and other registries, which in turn should solve your issue.

JulianH commented 1 year ago

Perfect! I can confirm it is now working. Thank you!