#[Solved] panic when executable not found in $PATH
1 messages · Page 1 of 1 (latest)
Cmd: dagger call build-type-script --source . --build-dir apps/api --output apits
Repo: https://github.com/jammutkarsh/unkey-dagger
Branch: dagger-ci
cc @split dirge I'd assume this panics are so we can track when something fails internally. Not sure if we should os.Exit(2) and log the panic trace somewhere else?
coming from here @obsidian cypress https://github.com/dagger/dagger/blob/2ae8cc9b15badc50ba3b223e39605e6646bc956c/cmd/init/main.go?plain=1#L126
Could it come from a dagger module?
no, that's part of the init process of the container
the binary doesn't effectively exist in that container
in your case pushd is a shell builtin, that's why it throws that error. Since it's not a binary
There is another error.
With almos the same code(node.ts:27 this.ctr =this.ctr.withDirectory(this.projectDir, this.source)), I am getting 400 error in GQL API.
✘ .buildTypeScript(
│ │ buildDir: "apps/api"
│ │ output: "apits"
│ │ source: Host.directory(path: "/Users/utc/code/oss/unkey-dagger"): Directory!
│ ): Directory! 5.0s
┃ Error: GraphQL Error (Code: 400): {"response":{"status":400,"headers":{}},"request":{"query":"\n { id }\n "}}
┃ Error: API Error
! process "tsx --no-deprecation --tsconfig /src/dagger/.dagger/tsconfig.json /src/dagger/.dagger/src/__dagger.entrypoint.ts" did not complete successfully: exit
! code: 1
Error logs:
✘ .buildTypeScript(
│ │ buildDir: "apps/api"
│ │ output: "apits"
│ │ source: Host.directory(path: "/Users/utc/code/oss/unkey-dagger"): Directory!
│ ): Directory! 5.0s
Error: GraphQL Error (Code: 400): {"response":{"status":400,"headers":{}},"request":{"query":"\n { id }\n "}}
Error: API Error
! process "tsx --no-deprecation --tsconfig /src/dagger/.dagger/tsconfig.json /src/dagger/.dagger/src/__dagger.entrypoint.ts" did not complete successfully: exit
! code: 1
Same command.
that's strange... you don't have any more info?
I'll re-run and increase the verbosity.
No, I increased the verbosity and used --debug. THe error part is same.
I have a similar code for go service as well, there I updated this.ctr =this.ctr.withDirectory() and it worked there.
I'll be pushing all the code to branch in sometime, so you can checkout there as well.
@obsidian cypress any chance you can connect to Dagger Cloud and send me a trace URL?
that's generally the best way to help users 🙏
you can create a single user account for free
https://dagger.cloud/jammutkarsh/traces/aa087b3e7721a41141e49d876e0ae8ae
Are you able to access it? If not, how do I make it public?
yes, we can see it
ok.. that's a new one to me. Maybe @left dove has any ideas?
@obsidian cypress any way we can repro that somehow?
Yep:
git clone https://github.com/jammutkarsh/unkey-dagger
cd unkey-dagger
git checkout dagger-ci
dagger call build-type-script --source . --build-dir apps/api --output apits
wow.. that took a bit of time to clone 😬
@obsidian cypress seems like the node dependency is the one that's causing issues
just wondering if you saw the featured node dependency in the daggerverse here: https://daggerverse.dev/mod/github.com/Dudesons/daggerverse/node@506142af431e8acef646176d58cda16968e463c3
and how you came to use the one you're using
I did see it.
My setup requires pnpm and and the module you mentioned doesn't have it, so ....
I'll try manually installing pnpm with this module.
Hey just to let you know, the GQL error is resolved. I made a stupid mistake of mounting a cache volume which wasn't initialised. But I feel the error message can be improved here. If its important, you/I can create an issue for this, I would love to solve this || in the upcoming week!||
@obsidian cypress ! What do you mean by mounting a cache volume that wasn't initialized? Mind sharing a snippet which triggers the error?
@object()
export class TSProject implements Project {
source: Directory
ctr: Container
packageCache: CacheVolume;
buildCache: CacheVolume;
readonly projectDir = "/app/";
constructor(
@argument()
source: Directory
) {
this.source = source;
this.ctr = dag.node().withPnpm().container()
this.buildCache = new(CacheVolume) // avoid nil pointer error
this.packageCache = dag.cacheVolume("npm-pkg-cache")
}
@func()
setup(): TSProject {
this.ctr = this.ctr.withWorkdir(this.projectDir)
.withMountedCache("/root/.cache/pnpm", this.buildCache) // had to use packageCache
return this
}
}
oh, you're passing a new cache instance without initializing it. Yes seems something that we could/should fix. Have the time to open an issue? 🙏
Is there any update on this and how can I avoid/solve this?
Or is this something simple slightly straightforward which can be solved by me?
@obsidian cypress is there any reasony why you're not creating a proper cache volume?
i.e: instead of new(CacheVolume) just call dag.CacheVolume("name") so you specify a concrete cache volume volume
sorry if I haven't replied earlier, I thought you already know about it
I have mentioned two bugs in the same post, hence things are a little confused.
- dagger would panic with executable not found in $PATH. (Was looking for update on this)
- not creating a proper cache volume was related go 400 GraphQL error (this was resovled by creating the proper volume)
oh. for 1 I'm poking @split dirge #1360301005077741772 message
he's super busy so he probably didn't have time to look into that
Sure, let me know if this is something I can fix
@obsidian cypress in any case why is the panic an issue to you?
what would you expect to happen if a command in the container doesn't exist?
Oh the panic was addressed here: https://github.com/dagger/dagger/pull/10166
It's a plain error now
Cool thanks!
[Solved] panic when executable not found in $PATH
@obsidian cypress this doesn't change they underlying behavior. The WithExec will still fail
the main difference is that the panic won't show in the logs now and the error will be returned to the user
If a command/binary doesn't exist it should exit with a non zero exit code. and Dagger should report it as an error like it does if any other step fails.
@obsidian cypress dagger currently exits with a non-zero code if that happens?
that's why I'm confused