Skip to content

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

Open
@lightfootc

Description

@lightfootc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions