garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
1.72k stars 50 forks source link

arm v7 scratch container failing to start #509

Closed riccardo1991 closed 1 month ago

riccardo1991 commented 1 month ago

Describe the bug The container for arm v7 (v1.5.1-scratch-armv7) is failing to start.

To Reproduce Run the v1.5.1-scratch-armv7 container.

Expected behavior Tini able to init backrest.

Platform Info

cat /proc/cpuinfo
processor   : 0
model name  : ARMv7 Processor rev 1 (v7l)
BogoMIPS    : 2655.84
Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part    : 0xc09
CPU revision    : 1

processor   : 1
model name  : ARMv7 Processor rev 1 (v7l)
BogoMIPS    : 2655.84
Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x4
CPU part    : 0xc09
CPU revision    : 1

Hardware    : Marvell Armada 380/381/382/383/384/385/388 (Device Tree)

Additional context I have tried to startup the container passing the -v flag to tini, but no meaningful logs are shown:

[INFO  tini (1)] Spawned child process '/backrest' with pid '8'

[FATAL tini (8)] exec /backrest failed: Exec format error

[INFO  tini (1)] Main child exited normally (with status '1')

[INFO  tini (1)] Spawned child process '/backrest' with pid '7'

[FATAL tini (7)] exec /backrest failed: Exec format error

[INFO  tini (1)] Main child exited normally (with status '1')

[INFO  tini (1)] Spawned child process '/backrest' with pid '7'

[INFO  tini (1)] Main child exited normally (with status '1')

[FATAL tini (7)] exec /backrest failed: Exec format error

[...]
garethgeorge commented 1 month ago

Thanks for the report on this!

I don’t have access to an armv7l device so it’s hard to test on my end.

To narrow down whether this is a problem with how the dockerfile is building, are you able to download and run the armv7 binary from releases / does that launch on your device? (Launching it will create files in .local/share/backrest and .config/backrest in your users home directory if you want to cleanup after testing).

riccardo1991 commented 1 month ago

In the release page I see only the arm v6 binary, ayway I have just tried it and it works fine (binary itself no problem, install script worked only with sudo as I got a group issue). Now up and running.

In fact the Synology DSM is working very strangely when accessing from local LAN to hosted "not packaged" services: if I access from my laptop nasIP:9898, I get a Connection refused, while nasIP:9443 (Portainer) I am able to access it. Some shady things are happening in the DSM integrated proxy. That's why I wanted to give Backrest a try directly via Docker.

For now I can think this as a minor issue: the workaround for me is running the binary on bare metal and access the webUI via a cloudflared tunnel I have set it up. Not ideal to bounce over Cloudflare to access an internal UI, but it works.

garethgeorge commented 1 month ago

For what it’s worth, there is an armv6 docker image which (may?) work for you in that case, but I would expect the armv7 image to work for your processor, will leave this open for a bit and perhaps see if someone can confirm whether this works or not on a common armv7 cpu e.g. raspberry pi.

riccardo1991 commented 1 month ago

I have just tried the container v1.5.1-scratch-armv6 and it still fails:

[FATAL tini (7)] exec /backrest failed: Exec format error

I have a Pi laying around but it is Arm v8. In a month or so I expect to dismiss it from its task, so I will try on it if the container is able to start.

Thank you for the support!

garethgeorge commented 1 month ago

Thanks for giving that a go! Looking at the release config again, it looks like the build pipeline actually is using different settings when building the binary for docker vs what I’m using for the standalone binaries.

Seems the go arch for the built binary for docker is specified correctly for arm64 https://github.com/garethgeorge/backrest/blob/50b4be737b780890fc38b331bbdbd417ad54876e/.goreleaser.yaml#L97 looks like I need to do the same for the various 32 bit arm builds.

garethgeorge commented 1 month ago

I believe this will be fixed by https://github.com/garethgeorge/backrest/commit/4fa30e3f7ee7456d2bdf4afccb47918d01bdd32e which will go out in the next release.

garethgeorge commented 1 month ago

Should be fixed in 1.6.0, please let me know if the scratch image works for you.