Skip to content

devbox fails to start if there is whitespace in the path #2290

@scottTomaszewski

Description

@scottTomaszewski

What happened?

Initialized devbox in a directory with a space character and it crashed:

scott@scott-XPS-15-9570:~$ mkdir foo\ bar
scott@scott-XPS-15-9570:~$ cd foo\ bar/
scott@scott-XPS-15-9570:~/foo bar$ devbox init
scott@scott-XPS-15-9570:~/foo bar$ devbox shell
Info: Ensuring packages are installed.
✓ Computed the Devbox environment.
Error: nix: command error: nix --extra-experimental-features ca-derivations --option experimental-features 'nix-command flakes fetch-closure' print-dev-env --json 'path:/home/scott/foo bar/.devbox/gen/flake': 'path:/home/scott/foo bar/.devbox/gen/flake' is not a valid URL: exit code 1

Error: There was an internal error. Run with DEVBOX_DEBUG=1 for a detailed error message, and consider reporting it at https://github.com/jetify-com/devbox/issues

I changed the name of the directory and it was fine:

scott@scott-XPS-15-9570:~/foo bar$ cd ..
scott@scott-XPS-15-9570:~$ mv foo\ bar/ foobar
scott@scott-XPS-15-9570:~$ cd foobar/
scott@scott-XPS-15-9570:~/foobar$ devbox shell
Info: Ensuring packages are installed.
✓ Computed the Devbox environment.
Starting a devbox shell...
(devbox) scott@scott-XPS-15-9570:~/foobar$ 

Steps to reproduce

See Above

Command

No response

devbox.json

{
    "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.0/.schema/devbox.schema.json",
    "packages": [],
    "shell": {
      "init_hook": [
        "echo 'Welcome to devbox!' > /dev/null"
      ],
      "scripts": {
        "test": [
          "echo \"Error: no test specified\" && exit 1"
        ]
      }
    }
  }


### Devbox version

0.13.0

### Nix version

nix (Nix) 2.18.1

### What system does this bug occur on?

Linux (x86-64)

### Debug logs

_No response_

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions