https://linen.dev logo
Github write: packages permission
# 🖥│support-forum
b
hi I am encountering an authentication issue when attempting to push code via GitHub Actions, utilizing Composio's OAuth2 for GitHub. The specific error message received is: buildx failed with: ERROR: failed to build: failed to solve: failed to push ghcr.io/bioanywhere/mcp-gitlab-mcp-server:main: denied: permission_denied: write_package Could you please advise on how to resolve this permission denied error, specifically regarding the "write_package" scope, or suggest alternative solutions?
u
Hey @bio, could you share the logId of the tool call? It'll help us in debugging.
b
Sure
log_SZTC4NatWsAK
Specifically, i get:
#16 pushing layers 332 #16 pushing layers 0.2s done 333 54f5c147a98a56cdd9ef5ebbed54 done #16 ERROR: failed to push ghcr.io/bioanywhere/mcp-gitlab-mcp- server:main: denied: permission_denied: write_package 334 335 > exporting to image: 336 337 338 ERROR: failed to build: failed to solve: failed to push ghcr.io/bioanywhere/mcp- gitlab-mcp-server:main: denied: permission_denied: write_package Error: buildx failed with: ERROR: failed build: failed to solve: failed to push ghcr.io/bioanywhere/mcp-gitlab-mcp- server:main: denied: permission_denied: write_package
u
Hey @bio, we just checked your logId and looks like the tool call is successful from our end and the error (
ERROR: failed to push ghcr.io/bioanywhere/mcp-gitlab-mcp- server:main: denied: permission_denied: write_package
) seems to be due to Docker push fail. — Could you check the issue on your end and lmk?
b
Hello, thanks for following up, I just fixed it! This is the solution in case anyone experiences the same thing. I want to share the solution here since I didn't find anything after hours of Googling.
there's a way to auto-link the repository during the build using Docker labels.
By adding the org.opencontainers.image. source label, the package automatically links to the repository with proper permissions.
The github workflow should adds the org.opencontainers. image. source label during the Docker build:
labels: org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} org.opencontainers.image.description=MCP Server Docker Image org.opencontainers.image.licenses=MIT
Thank you
u
It'll be super useful for anyone with similar error. Thanks a lot!