daytonaio / daytona

The Open Source Dev Environment Manager.
https://daytona.io
Apache License 2.0
12.42k stars 866 forks source link

daytona create raised "failed to create workspace: invalid reference format" under Windows 11 #1363

Open s-celles opened 1 week ago

s-celles commented 1 week ago

Describe the bug

daytona create

raises

 WORKSPACE     | ✓ Request submitted
time="2024-11-24T15:03:33+01:00" level=fatal msg="failed to create workspace: invalid reference format"

To Reproduce Steps to reproduce the behavior:

  1. Install Docker / Docker Desktop under Windows 11

  2. Install Daytona using PowerShell commands https://www.daytona.io/docs/installation/installation/#tab-panel-2 (ending with daytona serve;

  3. in a another console (while daytona serve is running)

    > daytona create https://github.com/daytonaio/sample-python
    WORKSPACE     | ✓ Request submitted
    time="2024-11-24T15:14:05+01:00" level=fatal msg="failed to create workspace: invalid reference format"
  4. > daytona ls
    
    Workspace                              Repository                                         Target                         Status
    ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    sample-python                          daytonaio/sample-python.git                        local                          STOPPED
    
    Active profile: default

Expected behavior "failed to create workspace: invalid reference format" shouldn't be raised

Desktop (please complete the following information):

Additional context

> daytona version
Daytona version v0.45.0
> daytona start sample-python
time="2024-11-24T15:16:36+01:00" level=fatal msg="failed to start workspace sample-python: Error response from daemon: No such container: cf9c5708fe5e-sample-python"
> daytona info sample-python -f json
{
  "id": "cf9c5708fe5e",
  "info": {
    "name": "sample-python",
    "projects": [
      {
        "created": "",
        "isRunning": false,
        "name": "sample-python",
        "providerMetadata": "{\"state\": \"container not found\"}",
        "workspaceId": ""
      }
    ],
    "providerMetadata": "{\"networkId\": \"cf9c5708fe5e\"}"
  },
  "name": "sample-python",
  "projects": [
    {
      "buildConfig": {},
      "envVars": null,
      "gitProviderConfigId": "",
      "image": "daytonaio/workspace-project:latest",
      "name": "sample-python",
      "repository": {
        "branch": "main",
        "cloneTarget": "branch",
        "id": "sample-python",
        "name": "sample-python",
        "owner": "daytonaio",
        "sha": "2f6434a63337c1dc87d7c30ce7a5033d1bcfe5e2",
        "source": "github.com",
        "url": "https://github.com/daytonaio/sample-python.git"
      },
      "target": "local",
      "user": "daytona",
      "workspaceId": "cf9c5708fe5e"
    }
  ],
  "target": "local"
}

PS : I'm new to Daytona.io... so I may have done something wrong

s-celles commented 1 week ago

I'm now getting

> daytona start sample-python
time="2024-11-24T17:47:11+01:00" level=fatal msg="failed to start workspace sample-python: container exited with status 1"

with

> daytona logs sample-python
 WORKSPACE     | ✓ Creating workspace sample-python (2fb2188835f5)
 WORKSPACE     | ✓ Starting workspace
 WORKSPACE     | ✓ Starting workspace
 sample-python | Creating project sample-python
 sample-python | Pulling image...
 sample-python | Pulling from daytonaio/workspace-project
 sample-python | Digest: sha256:2bbb1ea57364e2bba5d15c02a7d8b0cafd633fd1881ab6ab60ef2ed95aec6edc
 sample-python | Status: Image is up to date for daytonaio/workspace-project:latest
 sample-python | Image pulled successfully
 sample-python | Cloning into '/workdir/2fb2188835f5-sample-python'...
 sample-python | Reading devcontainer configuration...
 sample-python | Starting project sample-python
 sample-python | Reading devcontainer configuration...
 sample-python | Running devcontainer user commands...
 sample-python | [1 ms] @devcontainers/cli 0.72.0. Node.js v20.17.0. linux 5.15.153.1-microsoft-standard-WSL2 x64.
 sample-python | Error: Dev container config (/project/2fb2188835f5-sample-python/.devcontainer/devcontainer.json) not found.
 sample-python |     at GrA (/usr/local/share/nvm/versions/node/v20.17.0/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:666:2076)
 sample-python |     at async LrA (/usr/local/share/nvm/versions/node/v20.17.0/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:665:8554)
 sample-python |     at async /usr/local/share/nvm/versions/node/v20.17.0/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:482:1190
 sample-python | {"outcome":"error","message":"Dev container config (/project/2fb2188835f5-sample-python/.devcontainer/devcontainer.json) not found.","description":"Dev container config (/project/2fb2188835f5-sample-python/.devcontainer/devcontainer.json) not found."}
 sample-python | Error running devcontainer user commands: container exited with status 1
 sample-python | Starting project sample-python
 sample-python | Error running devcontainer user commands: Error response from daemon: removal of container 3af5a56aba750d311a01009ee21221869aa7ece9f19c040460771bb996e96f0f is already in progress
 sample-python | Pulling image...
 sample-python | Pulling from daytonaio/workspace-project
 sample-python | Digest: sha256:2bbb1ea57364e2bba5d15c02a7d8b0cafd633fd1881ab6ab60ef2ed95aec6edc
 sample-python | Status: Image is up to date for daytonaio/workspace-project:latest
 sample-python | Image pulled successfully
 sample-python | Reading devcontainer configuration...
 sample-python | Starting project sample-python
 sample-python | Running devcontainer user commands...
 sample-python | Reading devcontainer configuration...
 sample-python | [1 ms] @devcontainers/cli 0.72.0. Node.js v20.17.0. linux 5.15.153.1-microsoft-standard-WSL2 x64.
 sample-python | Error: Dev container config (/project/2fb2188835f5-sample-python/.devcontainer/devcontainer.json) not found.
 sample-python |     at GrA (/usr/local/share/nvm/versions/node/v20.17.0/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:666:2076)
 sample-python |     at async LrA (/usr/local/share/nvm/versions/node/v20.17.0/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:665:8554)
 sample-python |     at async /usr/local/share/nvm/versions/node/v20.17.0/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:482:1190
 sample-python | {"outcome":"error","message":"Dev container config (/project/2fb2188835f5-sample-python/.devcontainer/devcontainer.json) not found.","description":"Dev container config (/project/2fb2188835f5-sample-python/.devcontainer/devcontainer.json) not found."}
 sample-python | Error running devcontainer user commands: container exited with status 1
Tpuljak commented 1 week ago

Hi @s-celles,

Thanks for raising the issue. Looking into this and I'll get back to you ASAP.

s-celles commented 1 week ago

Doc and GH are not in sync https://github.com/daytonaio/daytona/releases states a 0.46 release but https://www.daytona.io/docs/installation/installation/#tab-panel-2 uses 0.45 (I mean PowerShell install for Windows) I use now 0.46 version but I'm still facing this issue

Tpuljak commented 1 week ago

@s-celles can you please run the following:

  1. docker rm -f daytona-sock-forward
  2. daytona provider update => and update the Docker provider
  3. Try again

We pushed an update to the Docker provider that should resolve this issue.

s-celles commented 1 week ago

I can't say it that's related but I'm now getting

> daytona serve;
INFO[0000] Starting api server on port 3986
INFO[0000] Starting local container registry...
INFO[0000] Starting headscale server...
INFO[0000] Image already pulled
FATA[0010] login to the server failed: dial tcp 35.198.165.62:7000: i/o timeout. With loginFailExit enabled, no additional retries will be attempted
Tpuljak commented 1 week ago

@s-celles are you connected to a different network than before?

This might be an indication of a firewall problem. https://www.daytona.io/docs/misc/troubleshooting/#connectivity-issues

s-celles commented 1 week ago

Yes. This is not the same network than yesterday.

PS : edit : serve is working now

s-celles commented 1 week ago

This one is a bit different...

PS C:\Users\me> daytona code
time="2024-11-25T13:44:35+01:00" level=fatal msg="failed to start project sample-python: bash: line 1: daytona: command not found\n"
Tpuljak commented 1 week ago

@s-celles was this a workspace you created before or just now?

It might be best to do daytona rm --all to delete all of them and start fresh from daytona create.

s-celles commented 1 week ago

That was a new workspace. I tried it again after daytona rm --all

> daytona rm --all

 - Workspace 'sample-python' successfully deleted

PS C:\Users\scelles> daytona
 WORKSPACE     | ✓ Request submitted
 WORKSPACE     | ✓ Creating workspace sample-python (74d3492939d9)
 sample-python | Creating project sample-python
 sample-python | Pulling image...
 sample-python | Pulling from daytonaio/workspace-project
 sample-python | Digest: sha256:2bbb1ea57364e2bba5d15c02a7d8b0cafd633fd1881ab6ab60ef2ed95aec6edc
 sample-python | Status: Image is up to date for daytonaio/workspace-project:latest
 sample-python | Image pulled successfully
 sample-python | Cloning into '/workdir/74d3492939d9-sample-python'...
 sample-python | Reading devcontainer configuration...
 sample-python | [6 ms] @devcontainers/cli 0.72.0. Node.js v20.17.0. linux 5.15.133.1-microsoft-standard-WSL2 x64.
 sample-python | [+] Building 0.5s (6/6) FINISHED                                 docker:default
 sample-python |  => [internal] load build definition from updateUID.Dockerfile-0.72.0      0.1s
 sample-python |  => => transferring dockerfile: 1.52kB                                     0.0s
 sample-python |  => WARN: InvalidDefaultArgInFrom: Default value for ARG $BASE_IMAGE resu  0.1s
 sample-python |  => [internal] load metadata for mcr.microsoft.com/devcontainers/python:3  0.2s
 sample-python |  => [internal] load .dockerignore                                          0.0s
 sample-python |  => => transferring context: 2B                                            0.0s
 sample-python |  => [1/2] FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm@sha25  0.0s
 sample-python |  => CACHED [2/2] RUN eval $(sed -n "s/vscode:[^:]*:\([^:]*\):\([^:]*\):[^  0.0s
 sample-python |  => exporting to image                                                     0.0s
 sample-python |  => => exporting layers                                                    0.0s
 sample-python |  => => writing image sha256:698b616445773f4c4716b154f9e2518ee40b62d7c2767  0.0s
 sample-python |  => => naming to docker.io/library/vsc-74d3492939d9-sample-python-d81bf55  0.0s
 sample-python |
 sample-python |  1 warning found (use docker --debug to expand):
 sample-python |  - InvalidDefaultArgInFrom: Default value for ARG $BASE_IMAGE results in empty or invalid base image name (line 4)
 sample-python | [2852 ms] Start: Run: docker run --sig-proxy=false -a STDOUT -a STDERR --mount source=C:\Users\scelles\AppData\Roaming\daytona\providers\docker-provider\74d3492939d9\74d3492939d9-sample-python,target=/workspaces/sample-python,type=bind -l daytona.workspace.id=74d3492939d9 -l daytona.project.name=sample-python -e DAYTONA_AGENT_LOG_FILE_PATH=(HOME)/.daytona-agent.log -e DAYTONA_CLIENT_ID=5023bd08-9458-47f9-a992-d5a1d4625def -e DAYTONA_PROJECT_DIR=/workspaces/sample-python -e DAYTONA_SERVER_API_KEY=ZDcxYjJiODItNDg2MS00MDhlLTg0MzEtZWQ4MWFkYzFhZmQw -e DAYTONA_SERVER_API_URL=https://api-f4aad640-37cf-47c4-a09a-181cf4789c13.try-eu.daytona.app -e DAYTONA_SERVER_URL=https://f4aad640-37cf-47c4-a09a-181cf4789c13.try-eu.daytona.app -e DAYTONA_SERVER_VERSION=v0.46.0 -e DAYTONA_TELEMETRY_ENABLED=true -e DAYTONA_WS_ID=74d3492939d9 -e DAYTONA_WS_PROJECT_NAME=sample-python -e DAYTONA_WS_PROJECT_REPOSITORY_URL=https://github.com/daytonaio/sample-python.git --entrypoint /bin/sh -l devcontainer.metadata=[{"id":"ghcr.io/devcontainers/features/common-utils:2"},{"id":"ghcr.io/devcontainers/features/git:1"},{"id":"ghcr.io/devcontainers/features/node:1","customizations":{"vscode":{"extensions":["dbaeumer.vscode-eslint"]}}},{"id":"ghcr.io/devcontainers/features/python:1","customizations":{"vscode":{"extensions":["ms-python.python","ms-python.vscode-pylance","ms-python.autopep8"],"settings":{"python.defaultInterpreterPath":"/usr/local/python/current/bin/python","[python]":{"editor.defaultFormatter":"ms-python.autopep8"}}}}},{"customizations":{"vscode":{"settings":{"python.defaultInterpreterPath":"/usr/local/bin/python"}}},"remoteUser":"vscode"},{"postCreateCommand":"pip3 install -r requirements.txt","postAttachCommand":"python app.py -p 5000","customizations":{"vscode":{"extensions":["streetsidesoftware.code-spell-checker","ms-python.python","ms-python.vscode-pylance"],"settings":{"python.defaultInterpreterPath":"/usr/local/bin/python","python.formatting.autopep8Path":"/usr/local/py-utils/bin/autopep8","python.formatting.blackPath":"/usr/local/py-utils/bin/black","python.formatting.yapfPath":"/usr/local/py-utils/bin/yapf","python.linting.banditPath":"/usr/local/py-utils/bin/bandit","python.linting.enabled":true,"python.linting.flake8Path":"/usr/local/py-utils/bin/flake8","python.linting.mypyPath":"/usr/local/py-utils/bin/mypy","python.linting.pycodestylePath":"/usr/local/py-utils/bin/pycodestyle","python.linting.pydocstylePath":"/usr/local/py-utils/bin/pydocstyle","python.linting.pylintEnabled":true,"python.linting.pylintPath":"/usr/local/py-utils/bin/pylint"}}},"containerEnv":{"DAYTONA_AGENT_LOG_FILE_PATH":"(HOME)/.daytona-agent.log","DAYTONA_CLIENT_ID":"5023bd08-9458-47f9-a992-d5a1d4625def","DAYTONA_PROJECT_DIR":"/workspaces/sample-python","DAYTONA_SERVER_API_KEY":"ZDcxYjJiODItNDg2MS00MDhlLTg0MzEtZWQ4MWFkYzFhZmQw","DAYTONA_SERVER_API_URL":"https://api-f4aad640-37cf-47c4-a09a-181cf4789c13.try-eu.daytona.app","DAYTONA_SERVER_URL":"https://f4aad640-37cf-47c4-a09a-181cf4789c13.try-eu.daytona.app","DAYTONA_SERVER_VERSION":"v0.46.0","DAYTONA_TELEMETRY_ENABLED":"true","DAYTONA_WS_ID":"74d3492939d9","DAYTONA_WS_PROJECT_NAME":"sample-python","DAYTONA_WS_PROJECT_REPOSITORY_URL":"https://github.com/daytonaio/sample-python.git"},"portsAttributes":{"5000":{"label":"Hello Remote World","onAutoForward":"openPreview"}}}] vsc-74d3492939d9-sample-python-d81bf558c13424e27d4e61ab1219b1b31e07999ac174a18b3277ea091e115d62-uid -c echo Container started
 sample-python | Container started
 sample-python | {"outcome":"success","containerId":"1e4931a2b96a8be0bd2d1539c5f23d0971dec2d4dcae660bb1aca2745bb8fb18","remoteUser":"vscode","remoteWorkspaceFolder":"/workspaces/sample-python"}
 sample-python | Project sample-python created
 WORKSPACE     | ✓ Workspace creation complete. Pending start...
 WORKSPACE     | ✓ Starting workspace
 sample-python | Starting project sample-python
 sample-python | Running devcontainer user commands...
 sample-python | Reading devcontainer configuration...
 sample-python | [3 ms] @devcontainers/cli 0.72.0. Node.js v20.17.0. linux 5.15.133.1-microsoft-standard-WSL2 x64.
 sample-python | Running the postCreateCommand from devcontainer.json...
 sample-python |
 sample-python | Defaulting to user installation because normal site-packages is not writeable
 sample-python | Collecting flask (from -r requirements.txt (line 1))
 sample-python |   Downloading flask-3.1.0-py3-none-any.whl.metadata (2.7 kB)
 sample-python | Collecting Werkzeug>=3.1 (from flask->-r requirements.txt (line 1))
 sample-python |   Downloading werkzeug-3.1.3-py3-none-any.whl.metadata (3.7 kB)
 sample-python | Collecting Jinja2>=3.1.2 (from flask->-r requirements.txt (line 1))
 sample-python |   Downloading jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
 sample-python | Collecting itsdangerous>=2.2 (from flask->-r requirements.txt (line 1))
 sample-python |   Downloading itsdangerous-2.2.0-py3-none-any.whl.metadata (1.9 kB)
 sample-python | Collecting click>=8.1.3 (from flask->-r requirements.txt (line 1))
 sample-python |   Downloading click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
 sample-python | Collecting blinker>=1.9 (from flask->-r requirements.txt (line 1))
 sample-python |   Downloading blinker-1.9.0-py3-none-any.whl.metadata (1.6 kB)
 sample-python | Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->flask->-r requirements.txt (line 1))
 sample-python |   Downloading MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.0 kB)
 sample-python | Downloading flask-3.1.0-py3-none-any.whl (102 kB)
 sample-python | Downloading blinker-1.9.0-py3-none-any.whl (8.5 kB)
 sample-python | Downloading click-8.1.7-py3-none-any.whl (97 kB)
 sample-python | Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
 sample-python | [6 ms] @devcontainers/cli 0.72.0. Node.js v20.17.0. linux 5.15.133.1-microsoft-standard-WSL2 x64.
 sample-python | Downloading jinja2-3.1.4-py3-none-any.whl (133 kB)
 sample-python | Downloading werkzeug-3.1.3-py3-none-any.whl (224 kB)
 sample-python | Downloading MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23 kB)
 sample-python | Installing collected packages: MarkupSafe, itsdangerous, click, blinker, Werkzeug, Jinja2, flask
 sample-python | Successfully installed Jinja2-3.1.4 MarkupSafe-3.0.2 Werkzeug-3.1.3 blinker-1.9.0 click-8.1.7 flask-3.1.0 itsdangerous-2.2.0
 sample-python | {"outcome":"success","containerId":"1e4931a2b96a8be0bd2d1539c5f23d0971dec2d4dcae660bb1aca2745bb8fb18","remoteUser":"vscode","remoteWorkspaceFolder":"/workspaces/sample-python"}
 sample-python |
 sample-python | [notice] A new release of pip is available: 24.2 -> 24.3.1
 sample-python | [notice] To update, run: pip install --upgrade pip
 sample-python | bash: line 1: daytona: command not found
time="2024-11-25T14:01:41+01:00" level=fatal msg="failed to create workspace: bash: line 1: daytona: command not found\n"

Comment : when using daytona text user interface (TUI) it could help debug to display what has been done by TUI.

idagelic commented 1 week ago

@s-celles

Docker Desktop -> Settings (top right corner) -> General -> Add the *.docker.internal names to the host's etc/hosts file (Requires password)

Please check if this option is enabled. If it isn't, enable it and run Apply & Restart - this might be the reason the binary download call fails.

image