Envbuilder Fails to Clone Repo from (Microsoft Team Foundation Server) TFS

I am having an issue cloning a repo from TFS into my workspace. Because I can't clone the repo, envbuilder won't find my .devcontainer/ directory and the DockerFile and json config in there to build out the environment for the workspace. When using the docker run command, to test locally, 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
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
13 Replies
Codercord
Codercord•4mo ago
Codercord
Codercord•4mo ago
<#1384912823712485488>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
yuji.fushiguro
yuji.fushiguroOP•4mo ago
When I run the above command I'm given this error
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
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
I tried was adding the extra environment variable ENVBUILDER_SSL_CERT_BASE64=ACTUAL_BASE64_CERT
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
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
Finally I've ran a combination of adding environment variables for - ENVBUILDER_GIT_USERNAME=$PAT_TOKEN - ENVBUILDER_GIT_USERNAME=$BASE64_PAT_TOKEN - ENVBUILDER_GIT_USERNAME=my_tfs_username and ENVBUILDER_GIT_PASSWORD=my_tfs_password - ENVBUILDER_GIT_USERNAME=oauth and ENVBUILDER_GIT_PASSWORD=$PAT_TOKEN - ENVBUILDER_GIT_USERNAME=oauth and ENVBUILDER_GIT_PASSWORD=$BASE64_PAT_TOKEN - etc They kept resulting in authentication required
Phorcys
Phorcys•4mo ago
@yuji.fushiguro i am unsure, though a quick question, do you usually use git clone or git tfs clone? also, you should try authenticating through git clone first and see what that works, then input the same values in ENVBUILDER_GIT_USERNAME and ENVBUILDER_GIT_PASSWORD
yuji.fushiguro
yuji.fushiguroOP•4mo ago
Yes, locally I would run git clone https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code to clone a repo from TFS. Sometimes in VSCode it prompts me to enter my username and password. I know we have tried using basic auth before to access TFS from our cloud environment with the following command git -c http.extraheader="AUTHORIZATION: Basic ${BASE64_PAT_TOKEN}" clone https://tfs.example.com/tfs/EXAMPLE_Git_Collection/CloudEngineering/_git/example-helloworld-app-code Are there any alternative methods other than using envbuilder?
Phorcys
Phorcys•4mo ago
hey, sorry for the delay, have you been able to figure this out?
Phorcys
Phorcys•4mo ago
Are there any alternative methods other than using envbuilder?
we're starting to roll out our new Dev Containers integration: https://coder.com/docs/@v2.23.1/user-guides/devcontainers it's currently in Early Access, so I would advise against it but the new integration uses the official devcontainers CLI instead of envbuilder, and also allows to show different dev containers in the web UI
Coder
Dev Containers Integration | Coder Docs
Run containerized development environments in your Coder workspace using the dev containers specification.
yuji.fushiguro
yuji.fushiguroOP•3mo ago
Hey sorry for the late response but no I still haven't figured this out. I switched gears to building an image that's able to pull from our private registry and also run vscode as well. I do have a question about the JetBrains IDE? Are those web-based like VSCode or do they use remote access like the desktop version?
Phorcys
Phorcys•3mo ago
hey, JetBrains IDEs are desktop only now sadly in the past JetBrains had a project called projector that allowed you to use their IDEs on the web, but they stopped maintaining it due to unreliability
yuji.fushiguro
yuji.fushiguroOP•3mo ago
Okay, that's what I was reading, but I was seeing one of the videos on YouTube. So I thought it was still possible: https://www.youtube.com/watch?v=-uboyR5Cylk&t=20s Can't find any real documentation of a working implementation. Every iteration I have tried has failed and I'm getting error about options I'm trying to use in the projector command when the documentation states I should use them.
yuji.fushiguro
yuji.fushiguroOP•3mo ago
We can call this close
Phorcys
Phorcys•3mo ago
maybe we should add it to the docs to explain that it's discontinued
Codercord
Codercord•3mo ago
@Phorcys closed the thread.

Did you find this page helpful?