Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tart Push to GitLab Registry Failing #914

Open
yangyi625 opened this issue Oct 1, 2024 · 7 comments
Open

Tart Push to GitLab Registry Failing #914

yangyi625 opened this issue Oct 1, 2024 · 7 comments
Labels
question Further information is requested

Comments

@yangyi625
Copy link

yangyi625 commented Oct 1, 2024

  • System Information

    • Tart version: 2.18.4
    • Tart version that works: 2.14.0
    • Operating System: macOS 14.5
    • Hardware: Apple M1
    • GitLab version: v16.11.10
  • Problem Description

    • I'm encountering an issue when attempting to push a Tart VM image to my GitLab registry. The push operation consistently fails with Tart version 2.18.4, whereas it works fine with the older version 2.14.0.

image

@yangyi625 yangyi625 changed the title Tart Push to GitLab Registry Failing - Possibly Related to Chunk Order in Concurrent Pushes Tart Push to GitLab Registry Failing Oct 1, 2024
@fkorotkov
Copy link
Contributor

How do you authenticate with the registry?

@fkorotkov fkorotkov added the question Further information is requested label Oct 1, 2024
@yangyi625
Copy link
Author

I authenticate with the registry using GitLab CI's token. The specific login command I use is:

echo "$CI_JOB_TOKEN" | tart login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin

I discovered that commenting out the following line in the tart project's source allowed me to successfully push to the gitlab registry:

if try await !registry.blobExists(compressedDataDigest) {

This workaround resolved the issue I was experiencing. However, I haven't yet identified the specific cause of this issue.

@edigaryev
Copy link
Collaborator

I've managed to successfully push a cloned ghcr.io/cirruslabs/ubuntu@sha256:7809213cbd1847a066e7f2589862f417bec2bb277438154e78e65f3a8e6394ea VM image to GitLab Enterprise Edition 17.5.0-pre (the one that's currently runs on gitlab.com).

Could you please try pushing the same image to your GitLab server using your own credentials (and not a temporary CI ones)?

@tvtamas
Copy link

tvtamas commented Oct 7, 2024

Hi,

I'm getting the same error as @yangyi625:

pushing config...
pushing disk... this will take a while...
21%
Error: cancelled
Attempting to re-try...
Error: cancelled
Attempting to re-try...
Error: cancelled
Attempting to re-try...
Error: AuthFailed(why: "received unexpected HTTP status code 400 while retrieving an authentication token", details: "Bad Request")

Using Tart 2.18.5, self-hosted GitLab v17.4.1 and GitLab's fork of the registry version: v4.9.0-gitlab.

The push is done by using a Personal Access Token still valid for a couple of months.

After retrying the command several tries the upload percentage does increase.

@tvtamas
Copy link

tvtamas commented Oct 8, 2024

Downgrading to Tart version 2.16.0 fixes the push issue with GitLab.

To downgrade:

curl -O https://raw.githubusercontent.com/cirruslabs/homebrew-cli/b516c00303c4ad55f636ac3fdd689dd04ff5e46e/tart.rb
brew install --build-from-source tart.rb

@yangyi625
Copy link
Author

Hi @edigaryev ,

Using a personal token works fine, but I still prefer to use a CI token.

I tried using Mitmproxy to see which part was causing the error. The results are as follows:

all request

It looks more like it's getting a 401 error during upload. The response is as follows:

upload request

I can't quite understand why I'm encountering an authentication issue here

@hblockx
Copy link

hblockx commented Oct 10, 2024

try to use --concurrent 1. For us the same issue appeared and got fixed by the concurrent 1. Also I tried adding a "retry" for the blobtransmission and it also helped with pulling and pushing images. Maybe I should contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants