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

Error fatal exit status 1 while following quickstart for Go in WSL 2 #2793

Open
mattwelke opened this issue Jan 20, 2024 · 1 comment
Open
Labels
devspace kind/bug Something isn't working

Comments

@mattwelke
Copy link
Contributor

mattwelke commented Jan 20, 2024

What happened?

I followed the quickstart tutorial, beginning at https://www.devspace.sh/docs/getting-started/introduction.

I was able to complete Download DevSpace, Initialize Project (I chose the "Golang" tab), and some of Development. I chose all of the default, suggested options.

During the Development step, when I got down to the part of the tutorial where you run devspace dev, I ran this command but then I got an error. The complete terminal output looks like this:

info Using namespace 'my-namespace'
info Using kube context 'kind-kind'
deploy:app Skipping deployment app
dev:app Waiting for pod to become ready...
dev:app Selected pod app-devspace-77d5787fd7-qmn6x
dev:app open  Opening 'http://localhost:8080' as soon as application will be started
dev:app ports Port forwarding started on: 2345 -> 2345, 8080 -> 8080
dev:app sync  Sync started on: ./ <-> ./
dev:app sync  Waiting for initial sync to complete
dev:app sync  Initial sync completed
start_dev: initial sync: Sync - connection lost to pod my-namespace/app-devspace-77d5787fd7-qmn6x:  Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "73f6f2b1a1ee625eb5aab114398a48df173c6849091a0d0c0ccec3064b5b73d9": OCI runtime exec failed: exec failed: unable to start container process: error adding pid 2215 to cgroups: failed to write 2215: openat2 /sys/fs/cgroup/unified/kubelet.slice/kubelet-kubepods.slice/kubelet-kubepods-besteffort.slice/kubelet-kubepods-besteffort-pode3996f97_63f0_40a0_b9c6_86de954b019c.slice/cri-containerd-2646276dddc66c0bc8f14ccc3ca9ee8484f9da56c005c952ce9ea357d6dd6c66.scope/cgroup.procs: no such file or directory: unknown
fatal exit status 1

At this point in time, there is a container that exists and is in a Running state

> k get po
NAME                            READY   STATUS    RESTARTS   AGE
app-devspace-77d5787fd7-qmn6x   1/1     Running   0          17m

But I'm not sure what to do at this point because my terminal has had control returned to it and based on language used in the quickstart, I don't think this is what's supposed to happen:

Once the terminal to your dev container opens

What did you expect to happen instead?

I expected to be able to complete the quickstart tutorial.

I also expected, based on my experience using DevSpace on my work machine, where it was already set up for me by a colleague, that at some point, I would have a terminal into a dev container open, but this didn't happen.

How can we reproduce the bug? (as minimally and precisely as possible)

Follow the steps I described above to attempt to complete the quickstart tutorial, choosing Go as your programming language. Observe the output from devspace dev.

My devspace.yaml:

version: v2beta1
name: devspace-quickstart-golang

# This is a list of `pipelines` that DevSpace can execute (you can define your own)
pipelines:
  # This is the pipeline for the main command: `devspace dev` (or `devspace run-pipeline dev`)
  dev:
    run: |-
      run_dependencies --all       # 1. Deploy any projects this project needs (see "dependencies")
      ensure_pull_secrets --all    # 2. Ensure pull secrets
      create_deployments --all     # 3. Deploy Helm charts and manifests specfied as "deployments"
      start_dev app                # 4. Start dev mode "app" (see "dev" section)
  # You can run this pipeline via `devspace deploy` (or `devspace run-pipeline deploy`)
  deploy:
    run: |-
      run_dependencies --all                            # 1. Deploy any projects this project needs (see "dependencies")
      ensure_pull_secrets --all                         # 2. Ensure pull secrets
      build_images --all -t $(git describe --always)    # 3. Build, tag (git commit hash) and push all images (see "images")
      create_deployments --all                          # 4. Deploy Helm charts and manifests specfied as "deployments"

# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
images:
  app:
    image: my-image-registry.tld/username/app
    dockerfile: ./Dockerfile

# This is a list of `deployments` that DevSpace can create for this project
deployments:
  app:
    # This deployment uses `helm` but you can also define `kubectl` deployments or kustomizations
    helm:
      # We are deploying this project with the Helm chart you provided
      chart:
        name: component-chart
        repo: https://charts.devspace.sh
      # Under `values` we can define the values for this Helm chart used during `helm install/upgrade`
      # You may also use `valuesFiles` to load values from files, e.g. valuesFiles: ["values.yaml"]
      values:
        containers:
          - image: my-image-registry.tld/username/app
        service:
          ports:
            - port: 8080

# This is a list of `dev` containers that are based on the containers created by your deployments
dev:
  app:
    # Search for the container that runs this image
    imageSelector: my-image-registry.tld/username/app
    # Replace the container image with this dev-optimized image (allows to skip image building during development)
    devImage: ghcr.io/loft-sh/devspace-containers/go:1.18-alpine
    # Sync files between the local filesystem and the development container
    sync:
      - path: ./
        uploadExcludeFile: .dockerignore
    # Open a terminal and use the following command to start it
    terminal:
      command: ./devspace_start.sh
    # Inject a lightweight SSH server into the container (so your IDE can connect to the remote dev env)
    ssh:
      enabled: true
    # Make the following commands from my local machine available inside the dev container
    proxyCommands:
      - command: devspace
      - command: kubectl
      - command: helm
      - gitCredentials: true
    # Forward the following ports to be able access your application via localhost
    ports:
      - port: "2345"
      - port: "8080"
    # Open the following URLs once they return an HTTP status code other than 502 or 503
    open:
      - url: http://localhost:8080

# Use the `commands` section to define repeatable dev workflows for this project
commands:
  migrate-db:
    command: |-
      echo 'This is a cross-platform, shared command that can be used to codify any kind of dev task.'
      echo 'Anyone using this project can invoke it via "devspace run migrate-db"'

# Define dependencies to other projects with a devspace.yaml
# dependencies:
#   api:
#     git: https://...  # Git-based dependencies
#     tag: v1.0.0
#   ui:
#     path: ./ui        # Path-based dependencies (for monorepos)

Local Environment:

  • DevSpace Version: 6.3.9
  • Operating System: Ubuntu 22.04.3 via WSL 2
  • ARCH of the OS: AMD64

Kubernetes Cluster:

  • Cloud Provider: other (kind with node image version 1.28)
  • Kubernetes Version:
    Client Version: v1.29.0
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Server Version: v1.28.0
    

Anything else we need to know?

I suspect that the fact I'm running this with WSL 2 is related to this issue. But I have not yet tested this in a different OS so I have not yet confirmed that WSL 2 is the only way of using Linux that causes this problem.

@mattwelke mattwelke added the kind/bug Something isn't working label Jan 20, 2024
@mattwelke mattwelke changed the title Error fatal exit status 1 while following quickstart for Go Error fatal exit status 1 while following quickstart for Go in WSL 2 Jan 20, 2024
@mattwelke
Copy link
Contributor Author

Tested with Ubuntu by itself (no WSL) and found that the issue did not occur then. I was able to launch the pod, get a terminal into the container, and test it out where I made a change to the code, re-ran go run main.go, refresh my browser, and see my changes reflected.

Local Environment:

  • DevSpace Version: 6.3.9
  • Operating System: Ubuntu 22.04.3
  • ARCH of the OS: AMD64

Kubernetes Cluster:

  • Cloud Provider: other (kind with node image version 1.28)
  • Kubernetes Version:
    > kubectl version
    WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
    Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-08T19:58:30Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/amd64"}
    Kustomize Version: v4.5.7
    Server Version: version.Info{Major:"1", Minor:"28", GitVersion:"v1.28.0", GitCommit:"855e7c48de7388eb330da0f8d9d2394ee818fb8d", GitTreeState:"clean", BuildDate:"2023-08-15T21:24:51Z", GoVersion:"go1.20.7", Compiler:"gc", Platform:"linux/amd64"}
    WARNING: version difference between client (1.26) and server (1.28) exceeds the supported minor version skew of +/-1
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devspace kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants