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
9.59k stars 349 forks source link

Can't install workspace in SSH from Mac to Ubuntu #1434

Closed ReneDyhr closed 2 days ago

ReneDyhr commented 3 days ago

What happened?
I've installed DevPod on my M1 Macbook and added a provider for a Ubuntu 24.04. Whenever I add my workspace folder it just keeps saying this:

08:47:31 info Waiting for devpod agent to come up... 08:47:31 debug Inject Error: EOF 08:47:34 debug execute inject script 08:47:34 debug download agent from https://github.com/loft-sh/devpod/releases/download/v0.6.2 08:47:34 debug Run command provider command: ${SSH_PROVIDER} command 08:48:05 debug done exec 08:48:05 debug done inject 08:48:05 debug done injecting 08:48:05 debug Done InjectAgentAndExecute 08:48:05 debug Done executing ssh server helper command 08:48:05 debug Done creating devcontainer 08:48:05 fatal executing agent command: timeout waiting for instance connection: EOF

What did you expect to happen instead?
When I tested this on a Ubuntu 24 to the Ubuntu 24 it worked flawless, haven't got this to work a at all.

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

My devcontainer.json:

{
        "name": "test",
        "dockerComposeFile": [
                "../docker-compose.yml"
        ],
        "service": "test",
        "workspaceFolder": "/var/www/html",
        "mounts": [
                "source=${localEnv:HOME}/.gitconfig,target=/home/programmer/.gitconfig,type=bind,consistency=cached",
                "source=${localEnv:HOME}/.ssh,target=/home/programmer/.ssh,type=bind,consistency=cached"
        ],
        "customizations": {
                "vscode": {
                        "extensions": [
                                "DEVSENSE.phptools-vscode",
                                "eamodio.gitlens",
                                "dbaeumer.vscode-eslint",
                                "stylelint.vscode-stylelint"
                        ],
                        "settings": {}
                }
        },
        "remoteUser": "programmer",
        "postCreateCommand": "chown -R $WWWUSER:$WWWGROUP /var/www/html"
        // "runServices": [],
        // "shutdownAction": "none",
}

Local Environment:

DevPod Provider:

pascalbreuninger commented 3 days ago

Hey @ReneDyhr, thanks for opening this issue. Can you share your current configuration for the SSH provider?

When I tested this on a Ubuntu 24 to the Ubuntu 24 it worked flawless, haven't got this to work a at all. Could you check if the devpod binary is installed on the target ubuntu 24 machine?

ReneDyhr commented 3 days ago

Hey @ReneDyhr, thanks for opening this issue. Can you share your current configuration for the SSH provider?

When I tested this on a Ubuntu 24 to the Ubuntu 24 it worked flawless, haven't got this to work a at all. Could you check if the devpod binary is installed on the target ubuntu 24 machine?

Of course! This is the provider.json

{
  "name": "ssh-y5q3yh7z",
  "version": "v0.0.15",
  "icon": "https://devpod.sh/assets/ssh.svg",
  "iconDark": "https://devpod.sh/assets/ssh_dark.svg",
  "source": {
    "github": "loft-sh/devpod-provider-ssh",
    "raw": "ssh"
  },
  "description": "DevPod on SSH",
  "optionGroups": [
    {
      "name": "SSH options",
      "options": [
        "PORT",
        "EXTRA_FLAGS",
        "USE_BUILTIN_SSH"
      ]
    },
    {
      "name": "Agent options",
      "options": [
        "DOCKER_PATH",
        "AGENT_PATH",
        "INACTIVITY_TIMEOUT",
        "INJECT_DOCKER_CREDENTIALS",
        "INJECT_GIT_CREDENTIALS"
      ]
    }
  ],
  "options": {
    "AGENT_PATH": {
      "description": "The path where to inject the DevPod agent to.",
      "command": "printf \"%s\" \"/tmp/${USER}/devpod/agent\""
    },
    "DOCKER_PATH": {
      "description": "The path where to find the docker binary.",
      "default": "docker"
    },
    "EXTRA_FLAGS": {
      "description": "Extra flags to pass to the SSH command."
    },
    "HOST": {
      "description": "The SSH Host to connect to. Example: my-user@my-domain.com",
      "required": true
    },
    "INACTIVITY_TIMEOUT": {
      "description": "If defined, will automatically stop the container after the inactivity period. Example: 10m"
    },
    "INJECT_DOCKER_CREDENTIALS": {
      "description": "If DevPod should inject docker credentials into the remote host.",
      "default": "true"
    },
    "INJECT_GIT_CREDENTIALS": {
      "description": "If DevPod should inject git credentials into the remote host.",
      "default": "true"
    },
    "PORT": {
      "description": "The SSH Port to use. Defaults to 22",
      "default": "22"
    },
    "USE_BUILTIN_SSH": {
      "description": "Use the builtin SSH package.",
      "type": "boolean",
      "default": "false"
    }
  },
  "agent": {
    "path": "${AGENT_PATH}",
    "inactivityTimeout": "${INACTIVITY_TIMEOUT}",
    "injectGitCredentials": "${INJECT_GIT_CREDENTIALS}",
    "injectDockerCredentials": "${INJECT_DOCKER_CREDENTIALS}",
    "exec": {},
    "dockerless": {},
    "docker": {
      "path": "${DOCKER_PATH}",
      "install": "false"
    },
    "custom": {}
  },
  "exec": {
    "init": [
      "${SSH_PROVIDER} init"
    ],
    "command": [
      "${SSH_PROVIDER} command"
    ]
  },
  "binaries": {
    "SSH_PROVIDER": [
      {
        "os": "linux",
        "arch": "amd64",
        "checksum": "30922c0c45b65c799405e7733913c507d73e20badff2b5fb67f8388c5bb8b69d",
        "path": "https://github.com/loft-sh/devpod-provider-ssh/releases/download/v0.0.15/devpod-provider-ssh-linux-amd64"
      },
      {
        "os": "linux",
        "arch": "arm64",
        "checksum": "7332beb14d8c29a4c6934d2eaf9a37b4813c8f7222615a8bba0a8c36bf9c3fa2",
        "path": "https://github.com/loft-sh/devpod-provider-ssh/releases/download/v0.0.15/devpod-provider-ssh-linux-arm64"
      },
      {
        "os": "darwin",
        "arch": "amd64",
        "checksum": "09c0bed799904cddc58fcb3e822fb36b4bdf971fa0438153bf89d89add7ae08d",
        "path": "https://github.com/loft-sh/devpod-provider-ssh/releases/download/v0.0.15/devpod-provider-ssh-darwin-amd64"
      },
      {
        "os": "darwin",
        "arch": "arm64",
        "checksum": "a6bedc6e0b96254857e4f6974eaeec07f4e221a753c162be3198778445687e66",
        "path": "https://github.com/loft-sh/devpod-provider-ssh/releases/download/v0.0.15/devpod-provider-ssh-darwin-arm64"
      },
      {
        "os": "windows",
        "arch": "amd64",
        "checksum": "dcfabd63215df9ef477b41f690e8ca559b541d49a0e189b0254b5da9d4d47467",
        "path": "https://github.com/loft-sh/devpod-provider-ssh/releases/download/v0.0.15/devpod-provider-ssh-windows-amd64.exe"
      }
    ]
  }
}
ReneDyhr commented 2 days ago

It seems I solved the issue! It had nothing to do with DevPod specific. From my testing on the Ubuntu machine to my Mac, the server got reset and re-configured as well. This means that in the new config I didn't setup IPv4, since I didn't think I would need it. Seems like GitHub isn't fully IPv6 supported, so that's why it didn't download anything correctly from GitHub.