Minimal network diagnostic - no package installs
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 18s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 18s
- Use only built-in commands (cat, wget, bash) - Test basic connectivity with /dev/tcp - 5 second timeouts to prevent hanging - Check if runner has ANY internet access - Diagnose runner network configuration issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
fabc795911
commit
43c969bf55
1 changed files with 38 additions and 81 deletions
|
|
@ -10,103 +10,60 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Debug - Network and DNS Configuration
|
||||
- name: Quick Network Test (no installs)
|
||||
run: |
|
||||
echo "=== Installing debug tools ==="
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq dnsutils iputils-ping curl iproute2 2>/dev/null || echo "Some tools failed to install"
|
||||
|
||||
echo ""
|
||||
echo "=== Network Configuration ==="
|
||||
ip addr show 2>/dev/null || ifconfig 2>/dev/null || echo "No network tools available"
|
||||
|
||||
echo ""
|
||||
echo "=== DNS Configuration ==="
|
||||
cat /etc/resolv.conf
|
||||
cat /etc/resolv.conf || echo "Cannot read resolv.conf"
|
||||
|
||||
echo ""
|
||||
echo "=== Hostname ==="
|
||||
hostname
|
||||
cat /etc/hosts
|
||||
echo "=== Hosts file ==="
|
||||
cat /etc/hosts || echo "Cannot read hosts"
|
||||
|
||||
echo ""
|
||||
echo "=== Testing DNS Resolution ==="
|
||||
echo "Testing Google DNS:"
|
||||
nslookup google.com || echo "Failed to resolve google.com"
|
||||
echo "=== Can we reach the internet? ==="
|
||||
timeout 5 wget -O- http://google.com 2>&1 | head -5 || echo "Cannot reach google.com"
|
||||
|
||||
echo ""
|
||||
echo "Testing forgejo.sivic.me:"
|
||||
nslookup forgejo.sivic.me || echo "Failed to resolve forgejo.sivic.me"
|
||||
echo "=== Can we reach Forgejo? ==="
|
||||
timeout 5 wget -O- https://forgejo.sivic.me 2>&1 | head -5 || echo "Cannot reach forgejo.sivic.me"
|
||||
|
||||
echo ""
|
||||
echo "=== Testing with dig ==="
|
||||
dig forgejo.sivic.me || echo "dig failed"
|
||||
|
||||
echo ""
|
||||
echo "Using Google DNS directly:"
|
||||
dig @8.8.8.8 forgejo.sivic.me || echo "dig @8.8.8.8 failed"
|
||||
|
||||
echo ""
|
||||
echo "=== Testing connectivity ==="
|
||||
ping -c 3 8.8.8.8 || echo "Cannot ping 8.8.8.8"
|
||||
|
||||
echo ""
|
||||
echo "=== Testing HTTP access ==="
|
||||
curl -v https://forgejo.sivic.me 2>&1 | head -30 || echo "Failed to curl forgejo.sivic.me"
|
||||
|
||||
- name: Debug - Check current directory
|
||||
run: |
|
||||
echo "=== Current Directory ==="
|
||||
pwd
|
||||
ls -la
|
||||
|
||||
echo ""
|
||||
echo "=== Environment Variables ==="
|
||||
echo "Git SHA: ${{ github.sha }}"
|
||||
echo "=== Environment ==="
|
||||
echo "Repository: ${{ github.repository }}"
|
||||
echo "Actor: ${{ github.actor }}"
|
||||
echo "Server URL: ${{ github.server_url }}"
|
||||
|
||||
- name: Clone repository with debugging
|
||||
echo ""
|
||||
echo "=== Network interfaces ==="
|
||||
cat /proc/net/dev || echo "Cannot read network devices"
|
||||
|
||||
echo ""
|
||||
echo "=== Default route ==="
|
||||
cat /proc/net/route || echo "Cannot read routing table"
|
||||
|
||||
- name: Test if we're online at all
|
||||
run: |
|
||||
echo "=== Attempting to clone ==="
|
||||
echo "URL: ${{ github.server_url }}/${{ github.repository }}"
|
||||
echo "Testing basic connectivity..."
|
||||
|
||||
# Try normal clone first
|
||||
if git clone ${{ github.server_url }}/${{ github.repository }} repo 2>&1; then
|
||||
echo "Clone succeeded!"
|
||||
else
|
||||
echo "Clone failed, trying with IP..."
|
||||
FORGEJO_IP=$(dig +short forgejo.sivic.me | head -1)
|
||||
echo "Forgejo IP: $FORGEJO_IP"
|
||||
# Try to connect to Google's DNS
|
||||
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/8.8.8.8/53' 2>&1 && echo "Can reach 8.8.8.8:53" || echo "CANNOT reach 8.8.8.8:53"
|
||||
|
||||
if [ -n "$FORGEJO_IP" ]; then
|
||||
echo "Attempting clone with IP: $FORGEJO_IP"
|
||||
git -c http.sslVerify=false clone https://$FORGEJO_IP/kevinsivic/ratemyclient repo || {
|
||||
echo "IP clone also failed"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
echo "Could not determine IP address"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
# Try to connect to Google HTTP
|
||||
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/google.com/80' 2>&1 && echo "Can reach google.com:80" || echo "CANNOT reach google.com:80"
|
||||
|
||||
cd repo
|
||||
git checkout ${{ github.sha }}
|
||||
ls -la
|
||||
# Try to connect to Forgejo
|
||||
timeout 5 bash -c 'cat < /dev/null > /dev/tcp/forgejo.sivic.me/443' 2>&1 && echo "Can reach forgejo.sivic.me:443" || echo "CANNOT reach forgejo.sivic.me:443"
|
||||
|
||||
- name: Build Docker image
|
||||
- name: Stop here and report
|
||||
run: |
|
||||
cd repo
|
||||
docker build -t forgejo.sivic.me/${{ github.repository }}:latest \
|
||||
-t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} .
|
||||
|
||||
- name: Log in to Forgejo Container Registry
|
||||
run: |
|
||||
echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Push Docker image
|
||||
run: |
|
||||
docker push forgejo.sivic.me/${{ github.repository }}:latest
|
||||
docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
|
||||
echo ""
|
||||
echo "================================================================"
|
||||
echo "DIAGNOSIS:"
|
||||
echo "If you cannot reach 8.8.8.8:53, your runner has NO internet access"
|
||||
echo "This is a runner configuration issue, not a DNS issue"
|
||||
echo ""
|
||||
echo "Fix: Check your Forgejo runner network configuration"
|
||||
echo "- Is the runner container using host networking?"
|
||||
echo "- Does the host have internet access?"
|
||||
echo "- Are there firewall rules blocking the runner?"
|
||||
echo "================================================================"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue