Skip to content

Change a devcontainer's image to an invalid image, causes a failed pod and the UI to loop endlessly #20

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

Closed
Tracked by #132
sharkymark opened this issue Jul 2, 2023 · 6 comments
Assignees

Comments

@sharkymark
Copy link

evnbuilder should detect the image is incorrect, and fall back to the FALLBACK_IMAGE.

kubectl reveals the CrashLoopBackOff and the UI just stays in an endless loop.

You resolve it, in my example template, by choosing another Parameter devcontainer

image
image

@sharkymark sharkymark added the bug label Jul 2, 2023
@bpmct bpmct added this to the envbuilder v1.0 milestone Apr 10, 2024
@bpmct bpmct mentioned this issue Apr 18, 2024
36 tasks
@dannykopping
Copy link
Contributor

Issue appears to be referencing the devcontainer-kubernetes/main.tf example template.

@dannykopping
Copy link
Contributor

Passing the image name invalid-image to envbuilder results in the fallback image being used.

image

Build logs:

envbuilder - Build development environments from repositories in a container
#1: 📦 Cloning invalid-url to /workspaces/invalid-url...
Failed to clone repository: clone "invalid-url": exec: "git": executable file not found in $PATH
Falling back to the default image...
#2: Deleting filesystem...
#2: 🏗️ Building image...
#2: Retrieving image manifest codercom/enterprise-base:ubuntu
...
$ coder ssh bob
coder@coder-danny-bob-69b8f664ff-fk6c4:/workspaces$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

This satisfied the first clause of the feature:

https://pkg.go.dev/github.com/coder/envbuilder#section-readme

FallbackImage specifies an alternative image to use when neither an image is declared in the devcontainer.json file nor a Dockerfile is present.

I'm now going to test out how it behaves when an invalid devcontainer/Dockerfile works.

@dannykopping
Copy link
Contributor

dannykopping commented Apr 23, 2024

An invalid devcontainer also falls back just fine:

I used this devcontainer: (note the invalid JSON).

#1: 📦 Cloned repository! [1.178864329s]
Failed to parse devcontainer.json: standardize json: hujson: line 5, column 5: invalid character ']' after object value (expecting ',' or '}')
Falling back to the default image...
#2: Deleting filesystem...
#2: 🏗️ Building image...
#2: Retrieving image manifest codercom/enterprise-base:ubuntu
...
$ coder ssh bob
coder@coder-danny-bob-84998f4f99-5z9cb:/workspaces$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

@dannykopping
Copy link
Contributor

An invalid Dockerfile also falls back just fine:

I used this devcontainer: (note the invalid Dockerfile)

#1: 📦 Cloned repository! [851.098596ms]
#2: Deleting filesystem...
#2: 🏗️ Building image...
Failed to build: parsing dockerfile: dockerfile parse error on line 1: unknown instruction: INVALID
Falling back to the default image...
#2: Deleting filesystem...
#3: 🏗️ Building image...
#2: Retrieving image manifest codercom/enterprise-base:ubuntu
...
$ coder ssh bob
coder@coder-danny-bob-84998f4f99-5z9cb:/workspaces$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

@dannykopping
Copy link
Contributor

Closing, this bug no longer exists.

@dannykopping
Copy link
Contributor

This was fixed by #30

@matifali matifali removed the bug label Oct 15, 2024
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

4 participants