loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.43k stars 307 forks source link

Devpod won't start sshtunnel error: #1004

Closed MileaRobertStefan closed 2 months ago

MileaRobertStefan commented 2 months ago

What happened?
devpod up . --debug refuzes to start.

13:40:11 debug Connection to SSH Server closed
13:40:11 debug Done creating devcontainer
13:40:12 fatal Process exited with status 1
run agent command
github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
        D:/a/devpod/devpod/pkg/devcontainer/sshtunnel/sshtunnel.go:125
runtime.goexit
        C:/hostedtoolcache/windows/go/1.21.8/x64/src/runtime/asm_amd64.s:1650

What did you expect to happen instead?
v 0.5.5, first time using dev pods

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

Base docker image: alpine:3.19.1

// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.5/containers/elixir-phoenix-pgitostgres
{
  "name": "Tags Elixir",

  "service": "tags",

  // "build": {
  //   "dockerfile": "../Dockerfile",
  //   "context": ".."
  // },

  "dockerComposeFile": "../docker-compose.yml",
  "shutdownAction": "stopCompose",

  // "workspaceFolder": "./workspace",

  "features": {
    // "ghcr.io/devcontainers/features/docker-in-docker:2": [],
    // "ghcr.io/devcontainers/features/go:1": [],
    "ghcr.io/devcontainers-contrib/features/elixir-asdf:2": {},
    "ghcr.io/devcontainers/features/github-cli:1": {},
    "ghcr.io/hspaans/devcontainer-features/sshpass:1": {},
    "ghcr.io/schlich/devcontainer-features/helix:1": {},
    "ghcr.io/stuartleeks/dev-container-features/dev-tunnels:0": {},
    "ghcr.io/devcontainers-contrib/features/vscode-server:1": {},
    "ghcr.io/devcontainers-contrib/features/vscode-cli:1": {},
  },

  "customizations": {
    "vscode": {
      "settings": {
        "terminal.integrated.defaultProfile.linux": "bash"
      },
      "extensions": [
        "streetsidesoftware.code-spell-checker",
        "GitHub.copilot",
        "GitHub.copilot-chat",
        "github.vscode-pull-request-github",
        "jakebecker.elixir-ls",
        "phoenixframework.phoenix",
        "redhat.vscode-yaml"
      ]
    }
  },

  // "postCreateCommand": "",

  // Use 'forwardPorts' to make a list of ports inside the container available locally.
  // This can be used to network with other containers or with the host.
  "forwardPorts": [4000, 8080, 80],

  // Use 'postCreateCommand' to run commands after the container is created.
  // "postCreateCommand": "mix deps.get",

  "remoteUser": "vscode"
}

Local Environment:

DevPod Provider:

Anything else we need to know?

MileaRobertStefan commented 2 months ago

Is there an image I could use as an Elixir base?

pascalbreuninger commented 2 months ago

Hey @MileaRobertStefan, thanks for reporting this issue. Can you update the description with a minimum repro please? Right now the configuration links to files outside of the .devcontainer.json file that we can't see

MileaRobertStefan commented 2 months ago

Is a dockerfile from

FROM alpine:3.19.1
ARG STARTUP_APPS=
ENV STARTUP_APPS=${STARTUP_APPS}

ENV PORT 80

EXPOSE ${PORT}

docker-compose.yaml

version: '3'

services:
  tags:
    build:
      context: .
      args:
        MIX_ENV: dev
    expose:
      - 4000
    ports:
      - 4000:4000
    environment:
      MONGODB_HOSTS: mongodb:27017
      - mongodb

  mongodb:
    container_name: mongodb
    image: bitnami/mongodb:5.0.24-debian-11-r20
    ports:
      - 27017:27017

I'm not sure what to do to make this image to work.

pascalbreuninger commented 2 months ago

I've tried to trim it down to the essence of the problem and it looks like the feature "ghcr.io/devcontainers-contrib/features/elixir-asdf:2": {}, is broken, you'd have to let the maintainer of it know over here. I'll go ahead and lose it here in DevPod if you don't mind

MileaRobertStefan commented 2 months ago

Sad to hear, one last question. Are there any plans to add support for elixir?

pascalbreuninger commented 2 months ago

Not in DevPod directly, that's something you can setup manually using a custom Dockerfile or ping the maintainers of the devcontainer feature to fix it