update command with resource with outputs generates corrupt lock file
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- docker, go
- 领域
- build-system, cli
调研方向
Follow the reproduction steps: initialize a project, add prometheus with outputs cli and out, generate the Dockerfile, run devbox update, then build the Docker image. Compare the generated devbox.lock before and after the update, focusing on the outputs entries. Done means the updated lock file preserves the requested outputs and the Docker build succeeds.
由索引模型根据 Issue 内容生成。
描述
What happened?
When using devbox in a docker container it fails if using a package with outputs specified. This only happens when using the generated devbox dockerfile and it only happens after you have used devbox update.
Here is a snippet of the generated devbox.lock that is causing the corruption issue.
Good file
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/959wvhvp9yd1xcaqmmbabk4rhs7x8yyv-prometheus-3.1.0",
"default": true
},
{
"name": "cli",
"path": "/nix/store/bd5qxk8agqvfn5sdjc4whj23sgycmmzz-prometheus-3.1.0-cli"
},
{
"name": "doc",
"path": "/nix/store/jabhy8j1wgaib51c6q0sr6bpp01hy2nq-prometheus-3.1.0-doc"
}
],
"store_path": "/nix/store/959wvhvp9yd1xcaqmmbabk4rhs7x8yyv-prometheus-3.1.0"
}
Bad file after devbox update
"x86_64-linux": {
"outputs": [
{
"name": "cli",
"path": "/nix/store/bd5qxk8agqvfn5sdjc4whj23sgycmmzz-prometheus-3.1.0-cli",
"default": true
},
{
"path": "/nix/store/959wvhvp9yd1xcaqmmbabk4rhs7x8yyv-prometheus-3.1.0",
"default": true
},
{
"name": "cli",
"path": "/nix/store/bd5qxk8agqvfn5sdjc4whj23sgycmmzz-prometheus-3.1.0-cli",
"default": true
},
{
"path": "/nix/store/959wvhvp9yd1xcaqmmbabk4rhs7x8yyv-prometheus-3.1.0",
"default": true
}
],
"store_path": "/nix/store/959wvhvp9yd1xcaqmmbabk4rhs7x8yyv-prometheus-3.1.0"
}
}
}
}
}
0.465 Info: Ensuring packages are installed.
0.552 Error: error running script "echo" in Devbox: Output out not found
0.552
------
Dockerfile:13
--------------------
11 |
12 |
13 | >>> RUN devbox run -- echo "Installed Packages."
14 |
15 | CMD ["devbox", "shell"]
--------------------
ERROR: failed to solve: process "/bin/sh -c devbox run -- echo \"Installed Packages.\"" did not complete successfully: exit code: 1
Steps to reproduce
- devbox init
- devbox add prometheus@latest -o cli,out
- devbox generate dockerfile
- devbox update
- docker build .
See error
Command
update
devbox.json
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.0/.schema/devbox.schema.json",
"packages": {
"prometheus": {
"version": "latest",
"outputs": ["cli", "out"]
}
},
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"test": [
"echo \"Error: no test specified\" && exit 1"
]
}
}
}
Devbox version
0.14.0
Nix version
nix (Nix) 2.28.1
What system does this bug occur on?
Linux (x86-64)
Debug logs
[7/7] RUN devbox run -- echo "Installed Packages.":
0.523 Info: Ensuring packages are installed.
0.576 Error: error running script "echo" in Devbox: Output out not found
0.576
Dockerfile:14
12 |
13 | RUN nix --version
14 | >>> RUN devbox run -- echo "Installed Packages."
15 |
16 | CMD ["devbox", "shell"]
ERROR: failed to solve: process "/bin/sh -c devbox run -- echo "Installed Packages."" did not complete successfully: exit code: 1
- 主要语言
- Go
- 星标
- 12.4k
- 派生
- 358
- 平均合并
- 17 小时 12 分钟
- 30 天内合并 PR
- 31
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jetify-com/devbox 的其他 Issue
-
feature triage
难度 2/5 1-3 小时 新手友好度 62/100
jetify-com/devbox#3038 ·
维护者通常 1 天内回复
-
bug p4 package processed triage unrelated
难度 2/5 1-3 小时 新手友好度 66/100
jetify-com/devbox#2898 · 2 条评论 ·
维护者通常 1 天内回复
-
p4 processed unrelated
难度 2/5 1-3 小时 新手友好度 65/100
jetify-com/devbox#2750 · 1 条评论 ·
维护者通常 1 天内回复
-
Storyden未关闭p4 package processed triage unrelated
难度 2/5 1-3 小时 新手友好度 62/100
jetify-com/devbox#2685 · 1 条评论 ·
维护者通常 1 天内回复
-
looks easy p4 package processed triage
难度 2/5 1-3 小时 新手友好度 60/100
jetify-com/devbox#2656 · 1 条评论 ·
维护者通常 1 天内回复
查看 jetify-com/devbox 的全部 Issue
相似的 Issue
-
mqtt_paho: transformer.DeleteExtension and DeleteAttribute make WritePubMessage fail可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
cloudevents/sdk-go#1349 ·
-
getChaosHub always returns totalFaults "0"可能已有人在做 @Aryanbhargava18 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
litmuschaos/litmus#5710 ·
维护者通常 3 天内回复
-
vtselect: data race in Tempo search tags APIs for invalid TraceQL queries可能已有人在做 @Shubham19032004 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
VictoriaMetrics/VictoriaTraces#304 ·
维护者通常 1 天内回复
-
kn secret create --tls-cert creates the certificate under the wrong key可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 91/100
维护者通常 1 天内回复
-
Routing rule or circuit breaker trip expression with an unknown CEL function hangs daprd可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复