Introduction
GitLab CI artifact upload fails when storage quota exceeded or network issue. This guide provides step-by-step diagnosis and resolution.
Symptoms
Typical error output:
bash
Error: CI/CD pipeline execution failed
Check pipeline logs for details
Verify runner/agent connectivity and configurationCommon Causes
- 1.Runner/agent offline or disconnected from server
- 2.Configuration YAML has syntax error
- 3.Required secret or credential not configured
- 4.Resource quota or timeout exceeded
Step-by-Step Fix
Step 1: Check Current State
bash
# Check CI/CD status
curl -s https://ci.example.com/api/status
# View pipeline logs
tail -f /var/log/ci/pipeline.log
# Check runner/agent connectivity
ps aux | grep runnerStep 2: Identify Root Cause
bash
# Check pipeline configuration
cat .ci/pipeline.yaml
# Verify runner connectivity
ping ci-server.example.com
# Check logs
tail -f /var/log/ci/runner.logStep 3: Apply Primary Fix
```bash # Primary fix: Check and reconfigure # Verify runner registration ci-runner register --token <token> --url https://ci.example.com
# Test pipeline locally ci-cli validate pipeline.yaml
# Restart runner service systemctl restart ci-runner ```
Step 4: Apply Alternative Fix
bash
# Alternative: Debug configuration
cat .ci/pipeline.yaml
# Check logs
grep -i error /var/log/ci/*.log
# Verify secrets
ci-cli secrets listStep 5: Verify the Fix
bash
curl -s https://ci.example.com/api/pipelines | jq '.status'
# Should show "running" or "success"
ci-cli pipeline statusCommon Pitfalls
- Not testing pipeline changes in branch before merging
- Using hardcoded secrets instead of secret management
- Not setting appropriate timeouts for long-running jobs
- Forgetting to update runner capabilities after adding new tools
Best Practices
- Use YAML validators before committing pipeline changes
- Implement proper secret rotation policies
- Monitor runner/agent health continuously
- Keep CI/CD tools updated to latest stable versions
Related Issues
- CI/CD Runner Offline
- Pipeline YAML Syntax Error
- Secret Not Found
- Build Timeout