Skip to content

Conversation

@ebembi-crdb
Copy link
Contributor

Summary

  • Fixes the retry logic that wasn't working due to pipeline exit code masking
  • The tee command was masking Jekyll's exit code, making failed builds appear successful
  • Adds set -o pipefail to properly propagate exit codes through the pipeline

The Bug

When Jekyll failed with a network error like:

Liquid Exception: Failed to open TCP connection to raw.githubusercontent.com:443 (getaddrinfo: Temporary failure in name resolution)

The pipeline bundle exec jekyll build ... | tee "$build_log" would return tee's exit code (0) instead of Jekyll's exit code (non-zero), so the retry logic never kicked in.

Testing This PR

This PR includes a network error simulation that's enabled for the deploy preview:

  • SIMULATE_NETWORK_ERROR=1 - enables simulation
  • SIMULATE_NETWORK_ERROR_ATTEMPTS=2 - fails first 2 attempts

Expected behavior on the deploy preview:

  1. Attempt 1: Simulated network error → retry
  2. Attempt 2: Simulated network error → retry
  3. Attempt 3: Real build → should succeed

Check the Netlify deploy logs to verify retry logic is working.

Before Merging

Remove these lines from netlify.toml:

SIMULATE_NETWORK_ERROR = "1"
SIMULATE_NETWORK_ERROR_ATTEMPTS = "2"

Related

Fixes retry logic from #20409

The retry logic wasn't working because pipeline exit codes were
being masked by tee. When Jekyll failed, tee would still succeed,
causing the script to think the build passed.

Changes:
- Add set -o pipefail to propagate Jekyll's exit code through the pipeline
- Add SIMULATE_NETWORK_ERROR env var to test retry behavior
- Enable simulation in netlify.toml to test on this PR's deploy preview

After verifying the fix works, remove SIMULATE_NETWORK_ERROR lines
from netlify.toml before merging.
@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit dadd3de
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/696fb47b7674080008e03ae3

@netlify
Copy link

netlify bot commented Jan 20, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit dadd3de
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/696fb47b46b807000803560f

@github-actions
Copy link

Files changed:

  • src/current/netlify.toml
  • src/current/netlify/build.sh

@netlify
Copy link

netlify bot commented Jan 20, 2026

Netlify Preview

Name Link
🔨 Latest commit dadd3de
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/696fb47b13e784000864d76f
😎 Deploy Preview https://deploy-preview-22258--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

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