defang icon indicating copy to clipboard operation
defang copied to clipboard

Github Rate limit for Railpack

Open KevyVo opened this issue 5 months ago • 2 comments

When using Railpack to build an OCI image, we may need to pull dependencies from GitHub. However, frequent requests can trigger GitHub’s rate limits. While we could ask users to provide a GITHUB_TOKEN in their compose configuration, that adds friction and creates a suboptimal user experience.

services:
  app:
    build:
      context: .
      args:
        - GITHUB_TOKEN

Here are the codebuild rate limit logs:


[Container] 2025/07/25 22:16:06.703839 Running command railpack prepare ${CODEBUILD_SRC_DIR} --plan-out ./railpack-plan.json --info-out ./railpack-info.json
--
 
╭─────────────────╮
│ Railpack 0.0.69 │
╰─────────────────╯
 
↳ Detected Node
↳ Using npm package manager
↳ Deploying as vite static site
↳ Output directory: dist
 
Packages
──────────
node   │  22.17.1  │  railpack default (22)
caddy  │  2.10.0   │  railpack default (latest)
 
Steps
──────────
▸ install
$ npm ci
 
▸ build
$ npm run build
 
▸ caddy
$ caddy fmt --overwrite /Caddyfile
 
Deploy
──────────
$ caddy run --config /Caddyfile --adapter caddyfile 2>&1
 
 
[Container] 2025/07/25 22:16:07.771238 Running command docker buildx create --use --driver=docker-container
romantic_ramanujan
 
[Container] 2025/07/25 22:16:07.818173 Running command docker buildx build -t 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build:app-image-c6242015-x86_64 --build-arg BUILDKIT_SYNTAX="ghcr.io/railwayapp/railpack-frontend" -f ./railpack-plan.json --output type=docker,name=test ${CODEBUILD_SRC_DIR}
#0 building with "romantic_ramanujan" instance using docker-container driver
 
#1 [internal] booting buildkit
#1 pulling image moby/buildkit:buildx-stable-1
#1 pulling image moby/buildkit:buildx-stable-1 3.5s done
#1 creating container buildx_buildkit_romantic_ramanujan0
time="2025-07-25T22:16:11.928969117Z" level=info msg="loading plugin \"io.containerd.event.v1.publisher\"..." runtime=io.containerd.runc.v2 type=io.containerd.event.v1
time="2025-07-25T22:16:11.929014538Z" level=info msg="loading plugin \"io.containerd.internal.v1.shutdown\"..." runtime=io.containerd.runc.v2 type=io.containerd.internal.v1
time="2025-07-25T22:16:11.929027375Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.task\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
time="2025-07-25T22:16:11.929108206Z" level=info msg="loading plugin \"io.containerd.ttrpc.v1.pause\"..." runtime=io.containerd.runc.v2 type=io.containerd.ttrpc.v1
#1 creating container buildx_buildkit_romantic_ramanujan0 0.8s done
#1 DONE 4.4s
 
#2 [internal] load build definition from railpack-plan.json
#2 transferring dockerfile:
#2 transferring dockerfile: 4.71kB done
#2 DONE 0.0s
 
#3 resolve image config for docker-image://ghcr.io/railwayapp/railpack-frontend:latest
#3 DONE 0.7s
 
#4 docker-image://ghcr.io/railwayapp/railpack-frontend:latest@sha256:46c992da3e89c3dd327506efd3b7fbe9507bb63d7343d00fd45ce23f1e8a532b
#4 resolve ghcr.io/railwayapp/railpack-frontend:latest@sha256:46c992da3e89c3dd327506efd3b7fbe9507bb63d7343d00fd45ce23f1e8a532b 0.0s done
#4 sha256:e0e56b66646d8261251bea841adda8bce734ca710f69a342787d4730d8c3fb50 3.15MB / 7.79MB 0.2s
#4 sha256:e0e56b66646d8261251bea841adda8bce734ca710f69a342787d4730d8c3fb50 7.79MB / 7.79MB 0.2s done
#4 sha256:fe07684b16b82247c3539ed86a65ff37a76138ec25d380bd80c869a1a4c73236 3.80MB / 3.80MB 0.2s done
#4 extracting sha256:fe07684b16b82247c3539ed86a65ff37a76138ec25d380bd80c869a1a4c73236 0.1s done
#4 DONE 0.4s
 
#4 docker-image://ghcr.io/railwayapp/railpack-frontend:latest@sha256:46c992da3e89c3dd327506efd3b7fbe9507bb63d7343d00fd45ce23f1e8a532b
#4 extracting sha256:e0e56b66646d8261251bea841adda8bce734ca710f69a342787d4730d8c3fb50 0.1s done
#4 DONE 0.5s
 
#5 load build definition from railpack-plan.json
#5 transferring dockerfile: 4.71kB done
#5 DONE 0.0s
 
#6 loading .
#6 DONE 0.0s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 resolve ghcr.io/railwayapp/railpack-builder:latest
#7 ...
 
#8 docker-image://ghcr.io/railwayapp/railpack-runtime:latest
#8 resolve ghcr.io/railwayapp/railpack-runtime:latest 0.6s done
#8 DONE 0.6s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 resolve ghcr.io/railwayapp/railpack-builder:latest 0.8s done
#7 DONE 0.9s
 
#6 loading .
#6 transferring context: 168.29kB done
#6 DONE 0.1s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 sha256:4c6d6396838b0bab96e1d48a7003807271da9c7535806ba7f3e942ea64ebfc41 119B / 119B 0.1s done
#7 sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B 0.1s done
#7 sha256:ca6ef7bca8ed2706fbc275417397f4b002343f301f926491a31606b6ecc96480 10.02MB / 10.02MB 0.2s done
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 4.19MB / 224.47MB 0.2s
#7 sha256:255774e0027b72d2327719e78dbad5ad8c9cf446d055e45be7fc149418470bae 12.58MB / 64.40MB 0.2s
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 48.23MB / 224.47MB 0.3s
#7 sha256:255774e0027b72d2327719e78dbad5ad8c9cf446d055e45be7fc149418470bae 50.33MB / 64.40MB 0.3s
#7 sha256:091eb8249475f42de217265c501e0186f0a3ea7490ef7f51458c30db91fb3cac 2.10MB / 24.01MB 0.2s
#7 sha256:7cd785773db44407e20a679ce5439222e505475eed5b99f1910eb2cda51729ab 0B / 48.47MB 0.2s
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 78.64MB / 224.47MB 0.5s
#7 sha256:255774e0027b72d2327719e78dbad5ad8c9cf446d055e45be7fc149418470bae 64.40MB / 64.40MB 0.4s done
#7 sha256:091eb8249475f42de217265c501e0186f0a3ea7490ef7f51458c30db91fb3cac 24.01MB / 24.01MB 0.3s done
#7 sha256:7cd785773db44407e20a679ce5439222e505475eed5b99f1910eb2cda51729ab 36.70MB / 48.47MB 0.3s
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 157.29MB / 224.47MB 0.8s
#7 sha256:7cd785773db44407e20a679ce5439222e505475eed5b99f1910eb2cda51729ab 48.47MB / 48.47MB 0.4s done
#7 extracting sha256:7cd785773db44407e20a679ce5439222e505475eed5b99f1910eb2cda51729ab
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 196.08MB / 224.47MB 0.9s
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 224.47MB / 224.47MB 1.1s
#7 sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 224.47MB / 224.47MB 1.3s done
#7 extracting sha256:7cd785773db44407e20a679ce5439222e505475eed5b99f1910eb2cda51729ab 1.0s done
#7 DONE 2.6s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 extracting sha256:091eb8249475f42de217265c501e0186f0a3ea7490ef7f51458c30db91fb3cac
#7 extracting sha256:091eb8249475f42de217265c501e0186f0a3ea7490ef7f51458c30db91fb3cac 0.3s done
#7 DONE 2.9s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 extracting sha256:255774e0027b72d2327719e78dbad5ad8c9cf446d055e45be7fc149418470bae
#7 extracting sha256:255774e0027b72d2327719e78dbad5ad8c9cf446d055e45be7fc149418470bae 1.3s done
#7 DONE 4.2s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 extracting sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132
#7 extracting sha256:59ec0b6dd4e2e8d50eb376a027f451987a1a77cbff84baba2fe959f1ef0cf132 4.1s done
#7 DONE 8.3s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 extracting sha256:ca6ef7bca8ed2706fbc275417397f4b002343f301f926491a31606b6ecc96480 0.1s done
#7 DONE 8.4s
 
#7 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#7 extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0.0s done
#7 extracting sha256:4c6d6396838b0bab96e1d48a7003807271da9c7535806ba7f3e942ea64ebfc41 0.0s done
#7 DONE 8.4s
 
#9 mise install-into [email protected] /railpack/caddy
#9 0.263 mise [email protected]    install
#9 0.422 mise WARN  GitHub rate limit exceeded. Resets at 2025-07-25 22:57:05
#9 0.430 mise WARN  GitHub rate limit exceeded. Resets at 2025-07-25 22:57:05
#9 0.430 mise WARN  GitHub API returned a 403 Forbidden error. This likely means you have exceeded the rate limit.
#9 0.430 mise WARN  GITHUB_TOKEN is not set. This means mise is making unauthenticated requests to GitHub which have a lower rate limit.
#9 0.430 To increase the rate limit, set the GITHUB_TOKEN environment variable to a GitHub personal access token.
#9 0.430 Create a token at https://github.com/settings/tokens and set it as GITHUB_TOKEN in your environment.
#9 0.430 You do not need to give this token any scopes.
#9 0.430 mise ERROR HTTP status client error (403 Forbidden) for url (https://api.github.com/repos/caddyserver/caddy/releases/tags/2.10.0)
#9 0.430 mise ERROR HTTP status client error (403 Forbidden) for url (https://api.github.com/repos/caddyserver/caddy/releases/tags/v2.10.0)
#9 0.430 mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
#9 ...
 
#10 mkdir /etc/mise
#10 DONE 3.2s
 
#9 mise install-into [email protected] /railpack/caddy
#9 ERROR: process "mise install-into [email protected] /railpack/caddy" did not complete successfully: exit code: 1
------
> mise install-into [email protected] /railpack/caddy:
0.422 mise WARN  GitHub rate limit exceeded. Resets at 2025-07-25 22:57:05
0.430 mise WARN  GitHub rate limit exceeded. Resets at 2025-07-25 22:57:05
0.430 mise WARN  GitHub API returned a 403 Forbidden error. This likely means you have exceeded the rate limit.
0.430 mise WARN  GITHUB_TOKEN is not set. This means mise is making unauthenticated requests to GitHub which have a lower rate limit.
0.430 To increase the rate limit, set the GITHUB_TOKEN environment variable to a GitHub personal access token.
0.430 Create a token at https://github.com/settings/tokens and set it as GITHUB_TOKEN in your environment.
0.430 You do not need to give this token any scopes.
0.430 mise ERROR HTTP status client error (403 Forbidden) for url (https://api.github.com/repos/caddyserver/caddy/releases/tags/2.10.0)
0.430 mise ERROR HTTP status client error (403 Forbidden) for url (https://api.github.com/repos/caddyserver/caddy/releases/tags/v2.10.0)
0.430 mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information
------
ERROR: failed to solve: process "mise install-into [email protected] /railpack/caddy" did not complete successfully: exit code: 1
time="2025-07-25T22:16:25.712126340Z" level=error msg="Error running exec a4209437fa2d33b7adb276c4c3ce62f529a0e7a121a5de8d15672b6abb110db0 in container: exec attach failed: error attaching stdout stream: write unix /var/run/docker.sock->@: write: broken pipe" spanID=87d3ee4670492090 traceID=18c5aa8fa4807c9e5deb4d72fda7f17f
 
[Container] 2025/07/25 22:16:25.714388 Command did not exit successfully docker buildx build -t 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build:app-image-c6242015-x86_64 --build-arg BUILDKIT_SYNTAX="ghcr.io/railwayapp/railpack-frontend" -f ./railpack-plan.json --output type=docker,name=test ${CODEBUILD_SRC_DIR} exit status 1
[Container] 2025/07/25 22:16:25.719940 Phase complete: BUILD State: FAILED
[Container] 2025/07/25 22:16:25.719956 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: docker buildx build -t 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build:app-image-c6242015-x86_64 --build-arg BUILDKIT_SYNTAX="ghcr.io/railwayapp/railpack-frontend" -f ./railpack-plan.json --output type=docker,name=test ${CODEBUILD_SRC_DIR}. Reason: exit status 1
[Container] 2025/07/25 22:16:25.771736 Entering phase POST_BUILD
[Container] 2025/07/25 22:16:25.772640 Running command echo Build completed on $(date)
Build completed on Fri Jul 25 10:16:25 PM UTC 2025
 
[Container] 2025/07/25 22:16:25.780630 Running command echo Pushing the Docker image...
Pushing the Docker image...
 
[Container] 2025/07/25 22:16:25.787215 Running command docker push 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build:app-image-c6242015-x86_64
The push refers to repository [993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build]
An image does not exist locally with the tag: 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build
 
[Container] 2025/07/25 22:16:25.806614 Command did not exit successfully docker push 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build:app-image-c6242015-x86_64 exit status 1
[Container] 2025/07/25 22:16:25.812077 Phase complete: POST_BUILD State: FAILED
[Container] 2025/07/25 22:16:25.812095 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: docker push 993944650415.dkr.ecr.us-west-2.amazonaws.com/kaniko-build:app-image-c6242015-x86_64. Reason: exit status 1
[Container] 2025/07/25 22:16:25.861529 Set report auto-discover timeout to 5 seconds
[Container] 2025/07/25 22:16:25.861588 Expanding base directory path:  .
[Container] 2025/07/25 22:16:25.864190 Assembling file list
[Container] 2025/07/25 22:16:25.864202 Expanding .
[Container] 2025/07/25 22:16:25.866803 Expanding file paths for base directory .
[Container] 2025/07/25 22:16:25.866815 Assembling file list
[Container] 2025/07/25 22:16:25.866818 Expanding **/*
[Container] 2025/07/25 22:16:25.869625 No matching auto-discover report paths found
[Container] 2025/07/25 22:16:25.869652 Report auto-discover file discovery took 0.008122 seconds
[Container] 2025/07/25 22:16:25.869662 Phase complete: UPLOAD_ARTIFACTS State: SUCCEEDED
[Container] 2025/07/25 22:16:25.869669 Phase context status code:  Message:


KevyVo avatar Jul 25 '25 22:07 KevyVo

@KevyVo Can you explain why GitHub is needed for this? Isn't the build context using code from local? What does GitHub provide?

nullfunc avatar Aug 05 '25 22:08 nullfunc

@KevyVo Can you explain why GitHub is needed for this? Isn't the build context using code from local? What does GitHub provide?

In this case, it looks like when the dockerfile is trying to make the image it does use the local code but the caddy package is downloaded from Github to serve it.

KevyVo avatar Aug 08 '25 16:08 KevyVo