#[Solved] panic when executable not found in $PATH

1 messages · Page 1 of 1 (latest)

obsidian cypress
pallid mural
obsidian cypress
#

Could it come from a dagger module?

pallid mural
#

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

obsidian cypress
#

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.

pallid mural
obsidian cypress
#

I'll re-run and increase the verbosity.

obsidian cypress
# pallid mural that's strange... you don't have any more info?

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.

pallid mural
#

@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

obsidian cypress
pallid mural
#

@obsidian cypress any way we can repro that somehow?

obsidian cypress
#

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
pallid mural
pallid mural
#

@obsidian cypress seems like the node dependency is the one that's causing issues

#

and how you came to use the one you're using

obsidian cypress
#

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.

obsidian cypress
#

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!||

pallid mural
obsidian cypress
#
@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
    }
}
pallid mural
#

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? 🙏

obsidian cypress
obsidian cypress
#

Or is this something simple slightly straightforward which can be solved by me?

pallid mural
#

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

obsidian cypress
#

I have mentioned two bugs in the same post, hence things are a little confused.

  1. dagger would panic with executable not found in $PATH. (Was looking for update on this)
  2. not creating a proper cache volume was related go 400 GraphQL error (this was resovled by creating the proper volume)
pallid mural
#

he's super busy so he probably didn't have time to look into that

obsidian cypress
#

Sure, let me know if this is something I can fix

pallid mural
#

@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?

split dirge
obsidian cypress
#

[Solved] panic when executable not found in $PATH

pallid mural
#

@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

obsidian cypress
#

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.

pallid mural
#

that's why I'm confused