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

docker git clone fatal: unable to update url base from redirection #3485

Open
alex-dna-tech opened this issue Mar 23, 2024 · 2 comments
Open

Comments

@alex-dna-tech
Copy link

alex-dna-tech commented Mar 23, 2024

Steps to introduce

Follow Docs - Quick Start tutorial.

  • Install Gitness
docker run -d -p 8333:3000 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/gitness:/data --name gitness --restart always harness/gitness
  • Create a project
  • Create a repository
  • Create a pipeline with a default template
  • Save and run pipeline

Result

clone

Cloning with 0 retries
Initialized empty Git repository in /gitness/.git/
+ git fetch origin +refs/heads/main:
fatal: unable to update url base from redirection:
asked for: http://host.docker.internal:3000/git/home/test.git/info/refs?service=git-upload-pack
redirect: http://pipeline:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTE0NzQ1OTYsImlhdCI6MTcxMTIxNTM5NiwiaXNzIjoiR2l0bmVzcyIsInBpZCI6MiwibXMiOnsicm9sZSI6ImNvbnRyaWJ1dG9yIiwic2lkIjoxfX0.some_JWT_Token@host.docker.internal:3000/login

@alex-dna-tech
Copy link
Author

alex-dna-tech commented Mar 24, 2024

Related to #3462 , #3428

As default port 3000. It is required to define an external port for the environment explicitly if you need to change it. The Docker port map does not work.

docker run -d -p 8333:8333 -e GITNESS_HTTP_PORT=8333 -v /var/run/docker.sock:/var/run/docker.sock -v /tmp/gitness:/data --name gitness --restart always harness/gitness:latest

http://host.docker.internal:3000/login redirection doesn't work for the git clone of the pipeline

@alex-dna-tech alex-dna-tech changed the title arm64 docker git clone fatal: unable to update url base from redirection docker git clone fatal: unable to update url base from redirection Mar 24, 2024
@alex-dna-tech
Copy link
Author

Some versions of docker require the definition of host.docker.internal with the parameter --add-host=host.docker.internal:host-gateway. It add host.docker.internal name to /etc/hosts file with internal docker gateway IP.

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

No branches or pull requests

1 participant