nanovms / ops

ops - build and run nanos unikernels
https://ops.city
MIT License
1.3k stars 132 forks source link

panic error when running getting started commands #1300

Closed chitreshd closed 2 years ago

chitreshd commented 2 years ago

Hi All

I was curious to try out Nanos and started here https://nanos.org/getting_started While ops downloaded fine, when running the ops pkg load command i am running into following issue:

~/code/nanos % ops pkg load node_v14.2.0 -p 8083 -n -a hi.js
panic: runtime error: index out of range [-1]

goroutine 1 [running]:
github.com/nanovms/ops/lepton.ParseIdentifier({0x7ffeefbffb2d, 0xc0006ec0b8})
    /Users/eyberg/go/src/github.com/nanovms/ops/lepton/package.go:76 +0x152
github.com/nanovms/ops/lepton.(*PackageList).FindPackage(0xc00007c000, {0x7ffeefbffb2d, 0x1d1c96735489d})
    /Users/eyberg/go/src/github.com/nanovms/ops/lepton/package.go:59 +0x45
github.com/nanovms/ops/lepton.DownloadPackage({0x7ffeefbffb2d, 0xc}, 0xc000581b00)
    /Users/eyberg/go/src/github.com/nanovms/ops/lepton/package.go:97 +0x7e
github.com/nanovms/ops/cmd.downloadAndExtractPackage({0xc00021df20, 0x1d}, {0x7ffeefbffb2d, 0xc}, 0xc0003051a0)
    /Users/eyberg/go/src/github.com/nanovms/ops/cmd/download_package.go:158 +0xfb
github.com/nanovms/ops/cmd.downloadPackage({0x7ffeefbffb2d, 0xc}, 0x33845c0)
    /Users/eyberg/go/src/github.com/nanovms/ops/cmd/download_package.go:29 +0x3c
github.com/nanovms/ops/cmd.(*PkgCommandFlags).MergeToConfig(0xc0008f25a0, 0xc000581b00)
    /Users/eyberg/go/src/github.com/nanovms/ops/cmd/flags_pkg.go:46 +0xaa
github.com/nanovms/ops/cmd.(*MergeConfigContainer).Merge(0x7ffeefbffb2d, 0x10d9679)
    /Users/eyberg/go/src/github.com/nanovms/ops/cmd/flags.go:27 +0x6f
github.com/nanovms/ops/cmd.loadCommandHandler(0xc000832840, {0xc0002080c0, 0x1, 0x6})
    /Users/eyberg/go/src/github.com/nanovms/ops/cmd/cmd_pkg.go:431 +0x2d9
github.com/spf13/cobra.(*Command).execute(0xc000832840, {0xc000208060, 0x6, 0x6})
    /Users/eyberg/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0xc000362dc0)
    /Users/eyberg/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
    /Users/eyberg/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
    /Users/eyberg/go/src/github.com/nanovms/ops/ops.go:8 +0x1e

Hardware:

~/code/nanos % sysctl -a | grep machdep.cpu.brand
machdep.cpu.brand: 0
machdep.cpu.brand_string: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
~/code/nanos % uname -a
Darwin chitreshs-mbp-2.lan 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64
~/code/nanos %
eyberg commented 2 years ago

@chitreshd those instructions need to be updated as we recently namespaced packages under usernames - the correct syntax would now be:

 ops pkg load eyberg/node:v14.2.0 -p 8083 -a hi.js
russdam commented 2 years ago

Had the same issue, just a fyi that it is still "ops pkg load node_v11.5.0 -p 8083 -f -n -a hi.js" on the readme.

eyberg commented 2 years ago

@karoofish thanks for the heads up, https://github.com/nanovms/ops/pull/1325