envbuilder icon indicating copy to clipboard operation
envbuilder copied to clipboard

Cloning from Private Repo (Microsoft Team Foundation Server - TFS)

Open lightfootc opened this issue 7 months ago • 1 comments

I am having an issue cloning a repo from TFS. When using the docker run command I'm faced with the following errors:

The base of my command:

docker run -it --rm \
    -v /tmp/envbuilder:/workspaces \
    -e ENVBUILDER_GIT_URL=https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code \
    -e ENVBUILDER_INIT_SCRIPT=bash \
    artifactory.example.com/docker-virtual/ghcr.io/coder/envbuilder

tls: failed to verify certificate: x509: certificate signed by unknown authority

envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 👤 Using no authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": Get "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/info/refs?service=git-upload-pack": tls: failed to verify certificate: x509: certificate signed by unknown authority
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": Get "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/info/refs?service=git-upload-pack": tls: failed to verify certificate: x509: certificate signed by unknown authority: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": Get "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/info/refs?service=git-upload-pack": tls: failed to verify certificate: x509: certificate signed by unknown authority: no fallback image has been specified

The next step I tried was adding the extra environment variable ENVBUILDER_SSL_CERT_BASE64=ACTUAL_BASE64_CERT

authentication required

envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 👤 Using no authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified

The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=$PAT_TOKEN

unexpected client error: unexpected requesting

envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 🔒 Using HTTP basic authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": unexpected client error: unexpected requesting "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/git-upload-pack" status code: 400
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": unexpected client error: unexpected requesting "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/git-upload-pack" status code: 400: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": unexpected client error: unexpected requesting "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code/git-upload-pack" status code: 400: no fallback image has been specified

The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=$BASE64_PAT_TOKEN

authentication required again

envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 🔒 Using HTTP basic authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified

The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=my_tfs_username and ENVBUILDER_GIT_PASSWORD=my_tfs_password

authentication required again

envbuilder v1.1.0+a3a6a83 - Build development environments from repositories in a container
#1: 📦 Cloning https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to /workspaces/example-helloworld-app-code...
#1: 🔒 Using HTTP basic authentication!
#1: Parsed Git URL as "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code"
Failed to clone repository: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required
Falling back to the default image...
No Dockerfile specified, looking for a devcontainer.json...
Failed to locate devcontainer.json: open /workspaces/example-helloworld-app-code/.devcontainer: no such file or directory
Falling back to the default image...
error: no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified
error: running command "envbuilder": no Dockerfile or devcontainer.json found: clone "https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code": authentication required: no fallback image has been specified

The next step I tried was adding the extra environment variable ENVBUILDER_GIT_USERNAME=oauth and ENVBUILDER_GIT_PASSWORD=$BASE64_PAT_TOKEN

This produced the authentication required error again

lightfootc avatar Jun 12 '25 19:06 lightfootc

This sounds similar the issue I was having in #457 . I also implemented the fix in #458 and have been using a build of it to pull features from an internal google artifact registry for a few months now. I have not received any responses on either my pr or the initial issue I opened about it.

derektamsen avatar Sep 16 '25 06:09 derektamsen