Skip to content

Handling Panic runtime error:Index outof range[1] with length 1

sirin k requested to merge handling_panic_tuntime_error_index_outof_range into develop

Handling Panic runtime error:Index outof range[1] with length 1 in getWwwAuthenticateInfo() function

Issue Solved for the below error logs:

pvr  post -m "new pantavisor with minimal ext handler code"  https://pvr.pantahub.com/asacasa/rpi4_logical_sheepdog
** ACCESS DENIED: user cannot access repository. **
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
gitlab.com/pantacor/pvr/libpvr.getWwwAuthenticateInfo(0x0, 0x0, 0x0, 0xc0005f4b00, 0xc0005f4bc0)
	/home/asac/panta/ph/gomod/pvr/libpvr/repolib.go:734 +0x2b4
gitlab.com/pantacor/pvr/libpvr.(*PvrAuthConfig).getNewAccessToken(0xc00018e5d0, 0x0, 0x0, 0x0, 0x1, 0x34, 0x0, 0x0)
	/home/asac/panta/ph/gomod/pvr/libpvr/authlib.go:245 +0x50
gitlab.com/pantacor/pvr/libpvr.(*Session).DoAuthCall(0xc00018e6c0, 0xc0005f50b0, 0x4a, 0xd54ed5, 0x1)
	/home/asac/panta/ph/gomod/pvr/libpvr/session.go:136 +0x3ee
gitlab.com/pantacor/pvr/libpvr.(*Pvr).postObjects(0xc000196820, 0xc00034c260, 0xe, 0xc0002e8000, 0x48, 0xc00034c258, 0x5, 0xc0002e8050, 0x4a, 0xc0001e68c0, ...)
	/home/asac/panta/ph/gomod/pvr/libpvr/repolib.go:945 +0x422
gitlab.com/pantacor/pvr/libpvr.(*Pvr).Post(0xc000196820, 0x7fffcf6771a8, 0x36, 0x0, 0x0, 0x7fffcf67717b, 0x2c, 0xffffffffffffffff, 0x414200, 0xd582f4, ...)
	/home/asac/panta/ph/gomod/pvr/libpvr/repolib.go:1193 +0x143
main.CommandPost.func2(0xc0003b6420, 0x0, 0xc0003b6420)
	/home/asac/panta/ph/gomod/pvr/cmdpost.go:90 +0x47a
github.com/urfave/cli.HandleAction(0xc405a0, 0xd99f18, 0xc0003b6420, 0xc000394900, 0x0)
	/home/asac/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:490 +0xc8
github.com/urfave/cli.Command.Run(0xd56648, 0x4, 0x0, 0x0, 0xc0001aa460, 0x1, 0x1, 0xd712a0, 0x25, 0x0, ...)
	/home/asac/go/pkg/mod/github.com/urfave/cli@v1.20.0/command.go:210 +0x991
github.com/urfave/cli.(*App).Run(0xc0000c6000, 0xc0000c4000, 0x5, 0x5, 0x0, 0x0)
	/home/asac/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:255 +0x6ab
main.main()
	/home/asac/panta/ph/gomod/pvr/main.go:135 +0x121f
asac@alap19:~/panta/pv/repo1/out/rpi4/trail/final/trails/0$ ls
Edited by Alexander (asac) Sack

Merge request reports