Skip to content

Failing to add packages due to Go unmarshalling error #1767

@emanguy

Description

@emanguy

What happened?

After running devbox init, I attempt to add any package to it via devbox add but it fails with an unmarshalling error. Presumably it's trying to deserialize some JSON but Nix updated the format or something? I had Nix installed on my machine already, so maybe it's an incompatible version or something.

Steps to reproduce

  1. Install Nix on MacOS using their official installer: https://nixos.org/download#nix-install-macos
  2. Install devbox via the official script: https://www.jetpack.io/devbox/docs/quickstart/
  3. Run devbox init to start a devbox.json
  4. Run devbox add go to add the go package to devbox.json

Command

add

devbox.json

{
  "packages": [],
  "shell": {
    "init_hook": [
      "echo 'Welcome to devbox!' > /dev/null"
    ],
    "scripts": {
      "test": [
        "echo \"Error: no test specified\" && exit 1"
      ]
    }
  }
}

Devbox version

0.8.7

Nix version

2.20.1

What system does this bug occur on?

macOS (Intel)

Debug logs

I've edited the output to mask some file names, but semantically it's the same.

2024/01/31 15:59:37 findProjectDir: path is
2024/01/31 15:59:37 finding devbox config in dir: /Users/erittenhouse/Desktop/PROJECT/FOLDER/GIT_REPO
2024/01/31 15:59:37 findProjectDir: path is
2024/01/31 15:59:37 finding devbox config in dir: /Users/erittenhouse/Desktop/PROJECT/FOLDER/GIT_REPO
2024/01/31 15:59:38 findProjectDir: path is
2024/01/31 15:59:38 finding devbox config in dir: /Users/erittenhouse/Desktop/PROJECT/FOLDER/GIT_REPO
Info: Adding package "go@latest" to devbox.json

Error: There was an error installing nix packages
source: json: cannot unmarshal object into Go struct field ProfileListOutput.elements of type []nixprofile.ProfileListElement

2024/01/31 15:59:38
ExecutionID:1e390847f87b4708b43062a4736f5eed

2024/01/31 15:59:38 findProjectDir: path is
2024/01/31 15:59:38 finding devbox config in dir: /Users/erittenhouse/Desktop/PROJECT/FOLDER/GIT_REPO

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