whishper icon indicating copy to clipboard operation
whishper copied to clipboard

[Bug] Whishper-backend exec format error on ARM64

Open beastarman74 opened this issue 1 year ago • 5 comments

I get the error: /app/whishper: exec format error on the Whishper-backend docker build. The build has an ARM64 build on Docker Hub.

Build details.: ARM64 Ubuntu 22.04 LTS build on Oracle Cloud. Using the Ampere A1, 4 OCPUs and 24 GB.

Screenshot off failure to bring the service up: Screenshot_20230913_180226

Screenshot of the log output for the Whishper-backend: Screenshot_20230913_184411

I am using the example docker-compose.yml, .env and nginx.conf. All the other components appear to start correctly.

I cannot spot what I may have done/got wrong.

beastarman74 avatar Sep 13 '23 19:09 beastarman74

huh, that's strange, I can't seem to reproduce it. did you find out anything else about the issue?

pluja avatar Sep 27 '23 10:09 pluja

I am running it on an Oracle Cloud VPS, the free tier. with 4 virtual core, 24gb RAM.

I have tried it on a Raspberry Pi 4b (8gb) and I get the same error.

beastarman74 avatar Sep 30 '23 17:09 beastarman74

Hey @beastarman74 can you try latest version v2.0.0?

pluja avatar Oct 27 '23 17:10 pluja

Hi @pluja Experiencing same issue on v2.0.0 and beta branch

kenvenin avatar Nov 11 '23 22:11 kenvenin

The issue is related to the source image, which is devops-works/golang-upx. That docker image gets built for amd64 only unfortunately, which causes the arm64 to pull the wrong image and try to build on top of that. My solution looks like follows:

  1. Pull golang-upx repository from here: https://github.com/devops-works/docker-golang-upx

  2. Patch the dockerfile to download the arm64 upx binary instead of the amd64 one. That part is hardcoded, so we'd need to ask for support for $BUILDPLATFORM and create a separate issue over at the golang-upx repository to get that problem solved, or patch it manually for the time being. I decided for the latter because I needed a quickfix.

  3. I then added the following to the whishper docker file top:

# syntax = devthefuture/dockerfile-x

You can now replace the requirement of devops-works/golang-upx:latest with this line:

FROM ./docker-golang-upx/Dockerfile as backend-builder

Make sure to use the correct path to your golang-upx Dockerfile.

  1. Now build your own whishper image, which will run just fine on arm64. You can also directly reference the whishper Dockerfile inside of your docker-compose.yml too if you want to.

Hope that helps someone. There is no better solution to the problem for now, or I don't know any better one.

Best permanent fix would be to either request a fix over at golang-upx or step away from that image/implementation entirely, or manually patch and build within the CI/release process to get a proper ARM64 image built and pushed.

Timtam avatar Jan 30 '24 20:01 Timtam