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]:
	/go/src/ +0xde9
	/go/src/ +0x2b
	/go/src/ +0x17
	/go/src/ +0x1d, {0x1391269?, 0x0?, 0x0?})
	/go/src/ +0x17*Command).execute(0x2078920, {0xc000032220, 0x0, 0x0})
	/srv/app/pkg/mod/ +0x5e3*Command).ExecuteC(0x2078920)
	/srv/app/pkg/mod/ +0x3b4*Command).Execute(...)
	/go/src/ +0x25
	/go/src/ +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!