Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Panic when building function with --storage-directory flag #44

Closed
clarkmcc opened this issue Sep 26, 2023 · 4 comments
Closed

Bug: Panic when building function with --storage-directory flag #44

clarkmcc opened this issue Sep 26, 2023 · 4 comments

Comments

@clarkmcc
Copy link

Getting the following output only when running with the --storage-directory flag. Running without the flag builds correctly.

$ scale function build --storage-directory
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x1037d3084]

goroutine 1 [running]:
github.com/loopholelabs/scale-cli/cmd/function.BuildCmd.func1.1(0x14005feb200, {0x140062320a0?, 0x4?, 0x1037ebf15?})
        /home/runner/work/scale-cli/scale-cli/cmd/function/build.go:124 +0x484
github.com/spf13/cobra.(*Command).execute(0x14005feb200, {0x140001b2030, 0x2, 0x2})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:940 +0x658
github.com/spf13/cobra.(*Command).ExecuteC(0x14005fb4000)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x320
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:992
github.com/spf13/cobra.(*Command).ExecuteContext(0x14005fb4000?, {0x103c2faa8?, 0x14005f75e80?})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0x48
github.com/loopholelabs/cmdutils/pkg/command.(*Command[...]).runCmd(0x103c38460, {0x103c2faa8, 0x14005f75e80}, 0x1, 0x14005f824d8?)
        /home/runner/go/pkg/mod/github.com/loopholelabs/[email protected]/pkg/command/command.go:168 +0x7a4
github.com/loopholelabs/cmdutils/pkg/command.(*Command[...]).Execute(0x103c38460, {0x103c2faa8, 0x14005f75e80})
        /home/runner/go/pkg/mod/github.com/loopholelabs/[email protected]/pkg/command/command.go:86 +0x188
main.realMain()
        /home/runner/work/scale-cli/scale-cli/cmd/main.go:33 +0xa8
main.main()
        /home/runner/work/scale-cli/scale-cli/cmd/main.go:26 +0x1c

Here's my CLI version

scale version v0.1.7-dev7 (build date: Wed Sep 20 22:46:11 UTC 2023 git commit: ce9bb5e730c0e355bcc7a25c6ce17a553eb03135 go version: go1.21.1 build platform: linux/amd64)
@clarkmcc
Copy link
Author

clarkmcc commented Sep 27, 2023

FYI, I'm getting this same error when calling scale function build without the --storage-directory flag when doing the build in a Docker container.

Here's the culprit line:

signatureSchema = sig.Schema

If I re-generate the signature artifacts in the container, then it seems to work.

@ShivanshVij
Copy link
Member

Checking this out now, it looks like the signature defined in your scalefile might not exist. Can you give me the output of scale signature list as well as the actual scalefile?

@clarkmcc
Copy link
Author

Yeah, I'm guessing there are artifacts that are stored outside of the working directory which is a little bit inconvenient when building in a container, because I have to regenerate the signature, rather then checking in the signature in my source. But that's more of a personal preference thing then anything. My workaround for Docker is just to re-generate the signature in the Dockerfile.

@ShivanshVij
Copy link
Member

Fixed in #45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants