Panic when starting the backend

When I start the backend, it immediately panics like this:

panic: readlink /proc/self/exe: no such file or directory

goroutine 1 [running]:
code.vikunja.io/api/pkg/config.InitDefaultConfig()
	/go/src/code.vikunja.io/api/pkg/config/config.go:243 +0xde9
code.vikunja.io/api/pkg/config.InitConfig()
	/go/src/code.vikunja.io/api/pkg/config/config.go:344 +0x2b
code.vikunja.io/api/pkg/initialize.LightInit()
	/go/src/code.vikunja.io/api/pkg/initialize/init.go:40 +0x17
code.vikunja.io/api/pkg/initialize.FullInit()
	/go/src/code.vikunja.io/api/pkg/initialize/init.go:79 +0x1d
code.vikunja.io/api/pkg/cmd.glob..func24(0x2078920?, {0x1391269?, 0x0?, 0x0?})
	/go/src/code.vikunja.io/api/pkg/cmd/web.go:72 +0x17
github.com/spf13/cobra.(*Command).execute(0x2078920, {0xc000032220, 0x0, 0x0})
	/srv/app/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:849 +0x5e3
github.com/spf13/cobra.(*Command).ExecuteC(0x2078920)
	/srv/app/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/srv/app/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902
code.vikunja.io/api/pkg/cmd.Execute()
	/go/src/code.vikunja.io/api/pkg/cmd/cmd.go:44 +0x25
main.main()
	/go/src/code.vikunja.io/api/main.go:22 +0x17

This is on a vserver running Debian stretch. This happens with 0.18.1 as well as with unstable. Am I doing something wrong?

in general, /proc/self/exe seems to work:

$ ls -al  /proc/self/exe
lrwxrwxrwx 1 root root 0 May  8 12:07 /proc/self/exe -> /bin/ls

What architecture are you using?

The arch is x86_64 resp. amd64.

The problem seems to be related to a combination of how we figure out the binary location and upx compressing and “optimizing” the final binary.

I’ve added a potential fix in fix: add more methods to figure out the current binary location · 9845fcc170 - api - Gitea.

Could you try again with the latest unstable build?

With v0.18.1+227-9845fcc170 the panic is gone. Thanks for fixing!

1 Like