Skip to content

Conversation

@hubertdeng123
Copy link
Member

Fresh install of self-hosted was throwing an exception here on my M1 macbook pro:

▶ Setting up / migrating database …
...
Container sentry-self-hosted-clickhouse-1  Healthy
Container sentry-self-hosted-kafka-1  Healthy
Container sentry-self-hosted-kafka-1  Healthy
Container sentry-self-hosted-kafka-1  Healthy
Container sentry-self-hosted-redis-1  Healthy
Container sentry-self-hosted-clickhouse-1  Healthy
Container sentry-self-hosted-clickhouse-1  Healthy
Container sentry-self-hosted-clickhouse-1  Healthy
Container sentry-self-hosted-snuba-sessions-consumer-1  Starting
Container sentry-self-hosted-snuba-subscription-consumer-events-1  Starting
Container sentry-self-hosted-snuba-outcomes-consumer-1  Starting
Container sentry-self-hosted-snuba-transactions-consumer-1  Starting
Container sentry-self-hosted-snuba-api-1  Starting
Container sentry-self-hosted-snuba-consumer-1  Starting
Container sentry-self-hosted-snuba-subscription-consumer-transactions-1  Starting
Container sentry-self-hosted-snuba-replacer-1  Starting
Container sentry-self-hosted-snuba-outcomes-consumer-1  Started
Container sentry-self-hosted-snuba-api-1  Started
Container sentry-self-hosted-snuba-subscription-consumer-events-1  Started
Container sentry-self-hosted-snuba-transactions-consumer-1  Started
Container sentry-self-hosted-snuba-subscription-consumer-transactions-1  Started
Container sentry-self-hosted-snuba-sessions-consumer-1  Started
Container sentry-self-hosted-snuba-replacer-1  Started
Container sentry-self-hosted-snuba-consumer-1  Started
Error response from daemon: image with reference sentry-self-hosted-local was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64

This is happening in the installation process because certain images are only available for linux/amd64 and the platform parameter here forces us to look for a linux/arm64 image, eventually erroring out. For M1 macs, I don't think we can confidently assume the platform to be linux/arm64 as long as we are running linux/amd64 single arch images. For multi-arch images, docker should automatically pull in the image that matches the current OS and architecture.

Github thread here for more context on a similar scenario:
docker/for-linux#1170 (comment)

Docker multi-arch support:
https://docs.docker.com/desktop/multi-arch/

Follow up on
#1538

@chadwhitacre
Copy link
Member

certain images are only available for linux/amd64
as long as we are running linux/amd64 single arch images

Which images? Do we control them or are they third-party or ... ?

Can you link where/why the platform option was added in the first place? What problem was it intended to solve and why are we confident that we're not regressing with this?

Copy link
Member

@chadwhitacre chadwhitacre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked on a call ... I am good with this if @ethanhs (who added the platform option in #1538) is.

@hubertdeng123
Copy link
Member Author

For more context, the images that I'm encountering issues with are from snuba, which doesn't support arm64 at the moment.

@hubertdeng123
Copy link
Member Author

error stack trace from ethanhs:

▶ Parsing command line ...
▶ Detecting Docker platform
Detected Docker platform is linux/arm64
▶ Initializing Docker Compose ...
▶ Setting up error handling ...
▶ Checking for latest commit ... 
▶ Checking minimum requirements ...
Found Docker version 20.10.16
Found Docker Compose version 2.6.0
▶ Turning things off ...
Warning: No resource found to remove for project "sentry-self-hosted".
Warning: No resource found to remove for project "sentry_onpremise".
▶ Creating volumes for persistent storage ...
Created sentry-clickhouse.
Created sentry-data.
Created sentry-kafka.
Created sentry-postgres.
Created sentry-redis.
Created sentry-symbolicator.
Created sentry-zookeeper.
▶ Ensuring files from examples ...
../sentry/sentry.conf.py already exists, skipped creation.
../sentry/config.yml already exists, skipped creation.
../symbolicator/config.yml already exists, skipped creation.
▶ Ensuring Relay credentials ...
../relay/config.yml already exists, skipped creation.
../relay/credentials.json already exists, skipped creation.
▶ Generating secret key ...
▶ Replacing TSDB ...
▶ Fetching and updating Docker images ...
nightly: Pulling from getsentry/sentry
Digest: sha256:4c7cb27216d71cd3b75124fa2b8aefbced45dedef1b68195a397c4d5c0818dd5
Status: Image is up to date for getsentry/sentry:nightly
docker.io/getsentry/sentry:nightly
▶ Building and tagging Docker images ...
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 32B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for docker.io/getsentry/sentry:nightly
#3 DONE 1.3s
#4 [internal] load build context
#4 transferring context: 297B done
#4 DONE 0.0s
#5 [1/4] FROM docker.io/getsentry/sentry:nightly@sha256:4c7cb27216d71cd3b75124fa2b8aefbced45dedef1b68195a397c4d5c0818dd5
#5 resolve docker.io/getsentry/sentry:nightly@sha256:4c7cb27216d71cd3b75124fa2b8aefbced45dedef1b68195a397c4d5c0818dd5 done
#5 DONE 0.1s
#6 [2/4] COPY . /usr/src/sentry
#6 DONE 0.0s
#7 [3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#7 DONE 0.1s
#8 [4/4] RUN if [ -s /usr/src/sentry/requirements.txt ]; then     echo "sentry/requirements.txt is deprecated, use sentry/enhance-image.sh - see https://github.com/getsentry/self-hosted#enhance-sentry-image";     pip install -r /usr/src/sentry/requirements.txt; fi
#8 DONE 0.2s
#9 exporting to image
#9 exporting layers 0.0s done
#9 writing image sha256:f85f3f90054e98bb7ae74552d270bc120417764eff3378cd1d290f0414309e62 done
#9 naming to docker.io/library/sentry-self-hosted-local done
#9 DONE 0.0s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
#1 [symbolicator-cleanup-self-hosted-local internal] load build definition from Dockerfile
#1 transferring dockerfile: 32B done
#1 DONE 0.0s
#2 [sentry-self-hosted-local internal] load build definition from Dockerfile
#2 transferring dockerfile: 32B done
#2 DONE 0.0s
#3 [snuba-cleanup-self-hosted-local internal] load build definition from Dockerfile
#3 transferring dockerfile: 32B done
#3 DONE 0.0s
#4 [clickhouse-self-hosted-local internal] load build definition from Dockerfile
#4 transferring dockerfile: 31B done
#4 DONE 0.0s
#5 [sentry-cleanup-self-hosted-local internal] load build definition from Dockerfile
#5 transferring dockerfile: 32B done
#5 DONE 0.0s
#6 [sentry-self-hosted-local internal] load .dockerignore
#6 transferring context: 2B done
#6 DONE 0.0s
#7 [sentry-cleanup-self-hosted-local internal] load .dockerignore
#7 transferring context: 2B done
#7 DONE 0.0s
#8 [clickhouse-self-hosted-local internal] load .dockerignore
#8 transferring context: 2B done
#8 DONE 0.0s
#9 [symbolicator-cleanup-self-hosted-local internal] load .dockerignore
#9 transferring context: 2B done
#9 DONE 0.0s
#10 [snuba-cleanup-self-hosted-local internal] load .dockerignore
#10 transferring context: 2B done
#10 DONE 0.0s
#11 [symbolicator-cleanup-self-hosted-local internal] load metadata for docker.io/getsentry/symbolicator:nightly
#11 ...
#12 [clickhouse-self-hosted-local internal] load metadata for docker.io/altinity/clickhouse-server:21.6.1.6734-testing-arm
#12 DONE 0.0s
#13 [clickhouse-self-hosted-local 1/1] FROM docker.io/altinity/clickhouse-server:21.6.1.6734-testing-arm
#13 CACHED
#14 [clickhouse-self-hosted-local] exporting to image
#14 exporting layers done
#14 writing image sha256:74114ee4566dcca9906a2d4442990eef4af07d3c7f973f46d0ea605503dadce2 done
#14 naming to docker.io/library/clickhouse-self-hosted-local done
#14 DONE 0.0s
#15 [sentry-self-hosted-local internal] load metadata for docker.io/getsentry/sentry:nightly
#15 DONE 0.2s
#16 [sentry-self-hosted-local 1/4] FROM docker.io/getsentry/sentry:nightly@sha256:4c7cb27216d71cd3b75124fa2b8aefbced45dedef1b68195a397c4d5c0818dd5
#16 DONE 0.0s
#17 [sentry-self-hosted-local internal] load build context
#17 transferring context: 297B done
#17 DONE 0.0s
#18 [sentry-self-hosted-local 3/4] RUN if [ -s /usr/src/sentry/enhance-image.sh ]; then     /usr/src/sentry/enhance-image.sh; fi
#18 CACHED
#19 [sentry-self-hosted-local 2/4] COPY . /usr/src/sentry
#19 CACHED
#20 [sentry-self-hosted-local 4/4] RUN if [ -s /usr/src/sentry/requirements.txt ]; then     echo "sentry/requirements.txt is deprecated, use sentry/enhance-image.sh - see https://github.com/getsentry/self-hosted#enhance-sentry-image";     pip install -r /usr/src/sentry/requirements.txt; fi
#20 CACHED
#14 [sentry-self-hosted-local] exporting to image
#14 exporting layers done
#14 writing image sha256:f85f3f90054e98bb7ae74552d270bc120417764eff3378cd1d290f0414309e62 done
#14 naming to docker.io/library/sentry-self-hosted-local done
#14 DONE 0.0s
#21 [snuba-cleanup-self-hosted-local internal] load metadata for docker.io/getsentry/snuba:nightly
#21 CANCELED
#22 [sentry-cleanup-self-hosted-local internal] load metadata for docker.io/library/sentry-self-hosted-local:latest
#22 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
#11 [symbolicator-cleanup-self-hosted-local internal] load metadata for docker.io/getsentry/symbolicator:nightly
#11 CANCELED
------
 > [sentry-cleanup-self-hosted-local internal] load metadata for docker.io/library/sentry-self-hosted-local:latest:
------
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
An error occurred, caught SIGERR on line 7
Cleaning up..

@chadwhitacre
Copy link
Member

I ran this in a clean clone and got:

------
 > [sentry-cleanup-self-hosted-local internal] load metadata for docker.io/library/sentry-self-hosted-local:latest:
------
failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
An error occurred, caught SIGERR on line 7
Cleaning up...

https://gist.github.com/chadwhitacre/27c0fc14b082e2a769a167113a092081

@hubertdeng123
Copy link
Member Author

noting that there is a PR here to build an arm64 image for sentry that may help

getsentry/sentry#38180

@github-actions
Copy link

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@chadwhitacre
Copy link
Member

Note from @hubertdeng123 ... this does propagate into our self-hosted dogfood instance, so we can see if others are hitting this.

@github-actions github-actions bot closed this Oct 11, 2022
@hubertdeng123
Copy link
Member Author

note here:
I'm using M1 Max and others are using M1 Pro

@chadwhitacre chadwhitacre deleted the setup/fix-arm-fresh-install branch October 17, 2022 21:50
@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants