getsentry / self-hosted

Sentry, feature-complete and packaged up for low-volume deployments and proofs-of-concept
https://develop.sentry.dev/self-hosted/
Other
7.75k stars 1.75k forks source link

Support ARM64 #1585

Open androidacy-user opened 2 years ago

androidacy-user commented 2 years ago

Self-Hosted Version

n/a

CPU Architecture

arm64

Docker Version

20.10.12

Docker Compose Version

1.29.2

Steps to Reproduce

  1. Try to run ./install.sh on a relatively fresh install of ubuntu 22.04
  2. Install fails

Expected Result

Install succeeds

Actual Result

Hits an error:

Step 4/5 : RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 ---> Running in 2ae646b00261
exec /bin/sh: exec format error

Note we don't have an enhance-image.sh anywhere in the directory

aminvakil commented 2 years ago

@ethanhs Can getsentry/sentry docker image run on a host with an arm64 cpu?

It may also help if to you try running ./install.sh again like this DEBUG=1 ./install.sh and paste the output in a gist.

ethanhs commented 2 years ago

Can getsentry/sentry docker image run on a host with an arm64 cpu?

No I think on macOS it is getting run by Rosetta maybe? I'm a bit uncertain. Theoretically it is unlikely that any of its dependencies won't work on ARM, I will ask around to see how feasible it is to build native ARM images.

androidacy-user commented 2 years ago

We're not on MacOS but Ubuntu 22.04 running on GCP.

@aminvakil would that even help? I think it's pretty obvious, the image used to run that script isn't respecting the system architecture and as such failing to run as it defaults to amd64

aminvakil commented 2 years ago

@androidacy-user What's the output of this command: docker info --format '{{.Architecture}}'?

androidacy-user commented 2 years ago

aarch64 as expected

ethanhs commented 2 years ago

I'll try to reproduce and fix this later.

ethanhs commented 2 years ago

Hm, unfortunately I think we will be stalled on this until we upgrade zookeeper, ref https://github.com/getsentry/self-hosted/issues/1292 as confluence's zookeeper image seems not to support ARM until the 7.x series.

licstar commented 2 years ago

Hm, unfortunately I think we will be stalled on this until we upgrade zookeeper, ref #1292 as confluence's zookeeper image seems not to support ARM until the 7.x series.

Can I replace zookeeper to some arm64 version? such as watershine

ethanhs commented 2 years ago

We use a rather old version of zookeeper, I'm not sure if it would be safe to upgrade but I'm looking into it.

licstar commented 2 years ago

I successfully run sentry on an ARM server, using this third-party version: https://github.com/Sentry-ARM/onpremise

ethanhs commented 2 years ago

Note that we don't support third-party repos for deployment. I do want to add aarch64 for Linux at some point, but there are several changes we'd need to make to see that happen.

nickjmv commented 2 years ago

We have also run into ARM issues while running the ./install.sh script. Apparently the getsentry/relay docker image is not built for ARM, only for AMD. We opened a separate issue for this: #1642

armenzg commented 2 years ago

I think I have code to build an arm64 build of Sentry in https://github.com/getsentry/sentry/pull/38180

checkolala commented 2 years ago

Hello,

we are facing the same issue on aws graviton (aarch64) while running ./install.sh seems, that the current sentry-image doesn't provide the platform aarch64

#7 [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#7 0.490 exec /bin/sh: exec format error
#7 ERROR: executor failed running [/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi]: exit code: 1
------
 > [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi:
#7 0.490 exec /bin/sh: exec format error
------
failed to solve: executor failed running [/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi]: exit code: 1
Error in build-docker-images.sh:6.
'$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm web' exited with status 17
-> ./install.sh:main:30
--> build-docker-images.sh:source:6
johnsturgeon commented 1 year ago

Getting the following error trying to build on my M1 Mac

container for service "zookeeper" is unhealthy
Error in bootstrap-snuba.sh:3.
'$dcr snuba-api bootstrap --no-migrate --force' exited with status 1
-> ./install.sh:main:33
--> bootstrap-snuba.sh:source:3

Cleaning up...
ethanhs commented 1 year ago

@johnsturgeon I believe that is an inconsistent issue that only happens some of the time, if you try again does it happen?

johnsturgeon commented 1 year ago

I tried again, and it did happen again.

I got around it by just doing a docker compose up that fired up quite a few containers... then docker compose down then redid the install.sh

johnsturgeon commented 1 year ago

The only problem I have now is whenever I start the stack the nginx container usually does not start, so I have to stop it / and the web container and restart them. That usually gets it going

johnsturgeon commented 1 year ago
image

This is the normal state after I start the stack

hubertdeng123 commented 1 year ago

note: Maybe M1 Max vs M1 Pro is causing issues with compatibility

I have to comment out this for self-hosted to work on M1 Max in docker-compose.yml while Chad and Ethan do not.

platform: ${DOCKER_PLATFORM:-} 
naiba commented 1 year ago

any update?

abersheeran commented 1 year ago

Any update?

kdckrs commented 1 year ago

Ping pong pang. Running into the same issue, anyone got a workaround?

hubertdeng123 commented 1 year ago

As of now, we have no update here as we don't have the bandwidth to tackle this issue 😔. If you'd like to look into this on your own, we do accept PR's

nohnaimer commented 1 year ago

Same issue:

#6 [2/4] COPY . /usr/src/sentry
#6 CACHED

#7 [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#7 0.333 exec /bin/sh: exec format error
#7 ERROR: process "/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi" did not complete successfully: exit code: 1
------
 > [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi:
#7 0.333 exec /bin/sh: exec format error
------
failed to solve: process "/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi" did not complete successfully: exit code: 1
+++ cleanup ERR
+++ local retcode=17
+++ local 'cmd=$dcb --force-rm web'
+++ [[ 0 -eq 1 ]]
+++ DID_CLEAN_UP=1
+++ [[ ERR != \E\X\I\T ]]
+++ set +o xtrace
Error in install/build-docker-images.sh:6.
'$dcb --force-rm web' exited with status 17
-> ./install.sh:main:29
--> install/build-docker-images.sh:source:6
# docker info --format '{{.Architecture}}'
aarch64

Still only linux/amd64:

SENTRY_IMAGE=getsentry/sentry:nightly
SNUBA_IMAGE=getsentry/snuba:nightly
RELAY_IMAGE=getsentry/relay:nightly
SYMBOLICATOR_IMAGE=getsentry/symbolicator:nightly
mmospanenko commented 1 year ago

Having the same issues with Ampere (ARM64) hosting, bash syntax error

trinhhuyit commented 1 year ago

Do we have a workaround for this ? I am using Ampere (Oracle-ARM64) but always getting the error related to bash

NikoGrano commented 1 year ago

Made some research and it seems to be snuba does not have support for the arm builds yet. However meanwhile we can try use these images to go around.

Realybig commented 1 year ago

This method is working for me!

trinhhuyit commented 1 year ago

This method is working for me!

How did you try ? Is it working with some service like amphere ?

hubertdeng123 commented 11 months ago

Seems like some users are experiencing this issue in Apple M1 chips

▶ Setting up / migrating database ...
 smtp Pulling
no matching manifest for linux/arm64/v8 in the manifest list entries
Error in install/set-up-and-migrate-database.sh:13.
'$dcr web upgrade' exited with status 18
-> ./install.sh:main:34
--> install/set-up-and-migrate-database.sh:source:13
gpetrov commented 11 months ago

Unfortunately Arm64 support is still not there. Tried to install sentry on the new Arm64 servers of hetzner and got nothing but errors. On intel/amd it works all fine.

Please improve the sentry Arm64 support.

hubertdeng123 commented 10 months ago

For those experiencing

▶ Setting up / migrating database ...
 smtp Pulling
no matching manifest for linux/arm64/v8 in the manifest list entries
Error in install/set-up-and-migrate-database.sh:13.
'$dcr web upgrade' exited with status 18
-> ./install.sh:main:34
--> install/set-up-and-migrate-database.sh:source:13

I encountered that today, and my workaround involved adding platform: linux/amd64 in the docker-compose.yml file under the smtp service.

maximal commented 9 months ago

+1 here.

Getting this on Oracle Cloud VM:

... ... ...
c888fb294e7b: Pull complete
ad893715fa48: Pull complete
Digest: sha256:3c5aaa9dab08339d017c5a8f3a6dee1f572338204a77ca5b21dac855e2331652
Status: Downloaded newer image for getsentry/sentry:nightly
docker.io/getsentry/sentry:nightly
++ echo ''

+ source install/build-docker-images.sh
++ echo '▶ Building and tagging Docker images ...'
▶ Building and tagging Docker images ...
++ echo ''

++ docker compose --ansi never --env-file .env build --build-arg http_proxy= --build-arg https_proxy= --build-arg no_proxy= --force-rm web
#0 building with "default" instance using docker driver

#1 [web internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [web internal] load build definition from Dockerfile
#2 transferring dockerfile: 463B done
#2 DONE 0.0s

#3 [web internal] load metadata for docker.io/getsentry/sentry:nightly
#3 DONE 1.0s

#4 [web internal] load build context
#4 transferring context: 371B done
#4 DONE 0.0s

#5 [web 1/4] FROM docker.io/getsentry/sentry:nightly@sha256:3c5aaa9dab08339d017c5a8f3a6dee1f572338204a77ca5b21dac855e2331652
#5 resolve docker.io/getsentry/sentry:nightly@sha256:3c5aaa9dab08339d017c5a8f3a6dee1f572338204a77ca5b21dac855e2331652 done
#5 DONE 0.2s

#6 [web 2/4] COPY . /usr/src/sentry
#6 DONE 0.0s

#7 [web 3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#7 0.222 exec /bin/sh: exec format error
#7 ERROR: process "/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi" did not complete successfully: exit code: 1
------
 > [web 3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi:
0.222 exec /bin/sh: exec format error
------
failed to solve: process "/bin/sh -c if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi" did not complete successfully: exit code: 1
+++ cleanup ERR
+++ local retcode=17
+++ local 'cmd=$dcb --force-rm web'
+++ [[ 0 -eq 1 ]]
+++ DID_CLEAN_UP=1
+++ [[ ERR != \E\X\I\T ]]
+++ set +o xtrace
Error in install/build-docker-images.sh:6.
'$dcb --force-rm web' exited with status 17
-> ./install.sh:main:29
--> install/build-docker-images.sh:source:6

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
exec /docker-entrypoint.sh: exec format error
peterdk commented 9 months ago

Trying to setup self hosted on AWS arm64 instance (Ubuntu 22.04, sentry 23.11.2), but unfortunately getting the same errors as @maximal:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
peterdk commented 9 months ago

Just experimented a bit more with a VM with ubuntu 22.04 on ARM, and all the Snuba docker images etc. that are pulled in are amd64 only on docker hub. So trying to force pull the arm64 version, just fails. It seems Sentry is not ready for ARM64, only maybe on MacOS where you can emulate amd64 as well.

Would love to run this on AWS gravitron instance, since they are much cheaper than Intel/AMD hosts and come with more memory.

So whats basically needed: update all dependend docker images to multiplatform amd64 and arm64.

abriginets commented 5 months ago

GitHub is currently working on ARM runners for Actions. There is a closed beta right now, but they just announced that it may be accessible for Orgs starting from June/July this year. Should definitely make it whole lot easier for Sentry devs to move towards ARM64 builds.

danielehrhardt commented 2 months ago

GitHub is currently working on ARM runners for Actions. There is a closed beta right now, but they just announced that it may be accessible for Orgs starting from June/July this year. Should definitely make it whole lot easier for Sentry devs to move towards ARM64 builds.

I can provide you a self-hosted arm GitHub runner. Please send me your ssh public key to daniel.ehrhardt@codext.de i will send you root access to a Arm Server. We can use it until Github Released the ARM Runner.

mmospanenko commented 2 months ago

Using not own servers for runners is not secure (CI secrets, etc), its better to rent (even cheap and powerful) VDS, for example Hetzner (link with small bonus, for few months will be enough).

But anyway, ARM is very important today, many companies moved infrastructure to ARM optimizing costs.

lechup commented 2 months ago

Hm... any solution for this?

ThearchyHelios commented 1 month ago

Any updates? zookeeper is running on v7 for now. https://github.com/getsentry/self-hosted/pull/2988

mmospanenko commented 1 month ago

yeah, critically important functionality, I'd like to shot down this old x86 server :)

enisn commented 1 month ago

I was just disappointed when I couldn't find ARM supported docker image.

This issue seems an old one. Will ARM64 be supported soon? Or does anyone know community-driven fork or arm64 build?

crmacca commented 1 month ago

There was Sentry-ARM, but it appears to be archived, very odd. Also refuses to install, quite slack to not support ARM64 in this day!

abriginets commented 1 month ago

Unfortunatelly we had to migrate away from Sentry to a competitor with a more lightweight solution. Managing Sentry is a challenge by itself considering the amount of containers and images. Having to pay huge hosting bills along the way while managing it's complexity and seeing no effort to make it less painfull for our wallets makes it a no-go for us. Sentry is a good end product and it definitely deserves better.

androidacy-user commented 1 month ago

Unfortunatelly we had to migrate away from Sentry to a competitor with a more lightweight solution. Managing Sentry is a challenge by itself considering the amount of containers and images. Having to pay huge hosting bills along the way while managing it's complexity and seeing no effort to make it less painfull for our wallets makes it a no-go for us. Sentry is a good end product and it definitely deserves better.

Off topic but care to share which one? We were investigating countly but they don't support ARM64 either

abriginets commented 1 month ago

@androidacy-user we switched to GlitchTip. It's not very feature-rich, but it utilizes Sentry SDK (so no code changes on our side, only changed SDN env variable) and uses only Postgres and Redis containers under the hood that had ARM support for a long time now. It only has error observability and performance/uptime monitoring, but that's quite all we need at this point.

jansorg commented 1 month ago

Signoz is quite nice, too. arm64 and self-hosting capable and much easier to handle than Sentry. Less capable for error reporting, but OpenTelemetry-based, which means no/less code changes in the future.

JHubi1 commented 1 month ago

So no solution or updates from the devs?

hubertdeng123 commented 4 weeks ago

I know this is not what you all want to hear, but this is not something we are prioritizing at the moment.