Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project setup > failed to solve: sentry-self-hosted-local: pull access denied #3476

Open
1 task done
bobvandevijver opened this issue Dec 18, 2024 · 3 comments
Open
1 task done

Comments

@bobvandevijver
Copy link

Self-Hosted Version

24.12.0

CPU Architecture

x86_64

Docker Version

27.3.1

Docker Compose Version

2.29.7

Machine Specification

  • My system meets the minimum system requirements of Sentry

Steps to Reproduce

I'm resubmitting #2641 as I believe I have a reproducer, even though I am not absolutely sure it is related or even a sentry issue.

We are in the process of disabling the default bridge network to force all containers to have a dedicated network, and for that reason we needed to create a local builder on a dedicated build network.

V4_PREFIX=10.100.10
V6_PREFIX=fd00:foo:100:10

docker network create --subnet $V4_PREFIX.0/24 --gateway $V4_PREFIX.1 --ip-range $V4_PREFIX.128/25 \
        --ipv6 --subnet $V6_PREFIX::/64 --gateway $V6_PREFIX::1 --ip-range $V6_PREFIX:128::/80 build
docker buildx create --name local-builder --driver docker-container --driver-opt network=build --use

Docker compose automatically uses this container for its builds, but the sentry install procedure seems to have issues resolving a local image.
I tried changing dbuild to docker buildx build $proxy_args in install/dc-detect-version.sh, but that did not solve the issue.

Expected Result

I expect to be able to get sentry running, even with the custom local builder.

Actual Result

#0 building with "local-builder" instance using docker-container driver

#1 [sentry-cleanup internal] load build definition from Dockerfile
#1 transferring dockerfile: 469B done
#1 WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 2)
#1 DONE 0.0s

#2 [sentry-cleanup internal] load metadata for docker.io/library/sentry-self-hosted-local:latest
#2 ERROR: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
------
 > [sentry-cleanup internal] load metadata for docker.io/library/sentry-self-hosted-local:latest:
------
failed to solve: sentry-self-hosted-local: failed to resolve source metadata for docker.io/library/sentry-self-hosted-local:latest: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
Error in install/build-docker-images.sh:9.
'$dcb --force-rm "$service"' exited with status 17
-> ./install.sh:main:34
--> install/build-docker-images.sh:source:9

Cleaning up...

Event ID

No response

@BYK
Copy link
Member

BYK commented Dec 21, 2024

@bobvandevijver please do not trim the reproduction steps. Currently what you shared is not enough to reproduce the issue.

#1 WARN: InvalidDefaultArgInFrom: Default value for ARG ${BASE_IMAGE} results in empty or invalid base image name (line 2)

This warning indicates that your .env file is not loaded hence the sentry/Dockerfile cannot be built causing the error you are facing.

@bobvandevijver
Copy link
Author

@BYK I'm not sure which step you are missing, except for the ./install.sh invocation. Maybe you already had the local-builder container, in which case you need to remove that first.

These are the literal steps, running as root on a fresh Debian installation, that ensures you will get the error.

VERSION="24.12.0"
V4_PREFIX=10.100.10

git clone https://github.com/getsentry/self-hosted.git
cd self-hosted
git checkout ${VERSION}

docker buildx rm local-builder || true
docker network rm build || true
docker network create --subnet $V4_PREFIX.0/24 --gateway $V4_PREFIX.1 --ip-range $V4_PREFIX.128/25 build
docker buildx create --name local-builder --driver docker-container --driver-opt network=build --use

./install.sh

Removing the local builder image resolves the issues and lets the install.sh complete as expected:

docker buildx rm local-builder
./install.sh

(I removed the v6 networking in case you do not have docker configured for that.)

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Dec 21, 2024
@BYK
Copy link
Member

BYK commented Dec 21, 2024

@bobvandevijver ah, sorry I misread some stuff here. So here's what's going on:

The sentry-cleanup service is a cron service that uses the previously built sentry web image (with the name sentry-self-hosted-local). Since docker compose does not allow us to define any build dependencies, we manually do this ourselves in https://github.com/getsentry/self-hosted/blob/master/install/build-docker-images.sh which builds the web service image first. For some reason either that step is not being run in your setup or the build image from that step is unusable by the further build commands that we invoke due to your setup.

I don't know what we can do about this as we don't use the setup you are describing. If the information above gives you a hint to fix it, we are open to pull requests though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Community
Status: No status
Development

No branches or pull requests

3 participants