Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh

Commit

When Cloudflare refuses the registry login a container build needs, the build's log says so and why, and that the token needs Containers: Edit, where the registry step answered a bare 500.

syntaqxcommitted Parent94224f0Browse files
1 file+11−10/1 viewed
+11−1
12601260 return Response.json({ ok: false, error }, { status: 409 });
12611261 }
12621262 const instanceType = instanceTypeOf((await this.settingsRow(row.project_id))?.instance_type);
1263− const login = await cloudflare.registryLogin();
1263+ let login: Awaited<ReturnType<typeof cloudflare.registryLogin>>;
1264+ try {
1265+ login = await cloudflare.registryLogin();
1266+ } catch (error) {
1267+ // Said in the build's log, not as a bare 500: most often the
1268+ // operator's Cloudflare token lacks Containers: Edit.
1269+ const reason = error instanceof Error ? error.message : String(error);
1270+ console.error("registry login refused", row.id, reason);
1271+ const message = `Cloudflare refused a login to push the image (${reason}). Its API token needs the Containers: Edit permission.`;
1272+ return Response.json(fail("unavailable", message), { status: 502 });
1273+ }
12641274 return Response.json(
12651275 ok({
12661276 registry: REGISTRY_HOST,

Comments

Sign in to comment.