Skip to content

Netlify deploy error due to missing IMAGE_BASE_URL environment variable - #1

Open
netlify-coding[bot] wants to merge 1 commit into
mainfrom
agent-variable-bd39
Open

netlify-coding[bot] wants to merge 1 commit into
mainfrom
agent-variable-bd39

Conversation

@netlify-coding

Copy link
Copy Markdown

🔗 View agent run: https://app.netlify.com/projects/orion-base-configurator/agent-runs/6a0bbc1062112567a3b2bd39

🤖 Agent: Claude

💬 Prompt: The Netlify deploy errored, with the following guidance provided:

Diagnosis — relevant log lines

  • The build command printed in the log: line 54.
  • The argparse error showing the flag was missing its value: line 56.
  • The failing com...

✅ Result: The Netlify deploy was failing because the build command in netlify.toml referenced the environment variable $IMAGE_BASE_URL directly on the command line (python3 build.py --image-base $IMAGE_BASE_URL). When that variable is not set in the Netlify environment, the shell expands it to an empty string, leaving --image-base with no argument. argparse then exits with code 2 and the message "expected one argument", aborting the build.

Two changes were made to fix this cleanly.

netlify.toml — The build command was simplified to python3 build.py with no shell variable reference. A comment explains that IMAGE_BASE_URL can still be set via Netlify's environment variable UI and that build.py will pick it up automatically.

build.py — A fallback was added in main(): after argparse runs, if --image-base was not supplied on the command line, the script reads IMAGE_BASE_URL from the process environment. This preserves full flexibility — the env var is still honoured if set, and the explicit --image-base CLI flag continues to work for local development — but the build no longer breaks when the variable is absent. When neither is set the template's existing default (./images relative path) is used, which resolves correctly for a standard Netlify deployment.

@netlify

netlify Bot commented May 19, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for orion-base-configurator ready!

Name Link
🔨 Latest commit a12dda7
🔍 Latest deploy log https://app.netlify.com/projects/orion-base-configurator/deploys/6a0bbcd81e158700085fe095
😎 Deploy Preview https://deploy-preview-1--orion-base-configurator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant