fix: improve feed update error handling and validation
Major improvements to feed management across all workflows: 1. **build-openwrt-packages.yml:** - Removed 'base' feed (not needed for SDK) - Added comprehensive error handling with retry logic - Verify feed directories exist after update - Fail fast if feeds don't update successfully - Log feed update/install output for debugging 2. **build-secubox-images.yml & test-validate.yml:** - Added feed verification after update/install - Capture logs for debugging feed issues - Exit with error if critical feeds missing - Show feed directory sizes for verification Key changes: - Feeds are now validated to exist before continuing - Better error messages when feeds fail to update - Logs captured for troubleshooting - Workflow fails immediately if feeds missing This should fix the 'find: feeds/packages: No such file or directory' error by ensuring feeds are actually cloned successfully.
This commit is contained in:
parent
2432001fcd
commit
5bd25d9b8e
67
.github/workflows/build-openwrt-packages.yml
vendored
67
.github/workflows/build-openwrt-packages.yml
vendored
@ -251,42 +251,87 @@ jobs:
|
|||||||
echo "✅ Removed telephony and routing from feeds.conf.default"
|
echo "✅ Removed telephony and routing from feeds.conf.default"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use GitHub mirrors - only essential feeds
|
# Use GitHub mirrors - only essential feeds for SDK
|
||||||
cat > feeds.conf << 'FEEDS'
|
cat > feeds.conf << 'FEEDS'
|
||||||
src-git base https://github.com/openwrt/openwrt.git;openwrt-23.05
|
|
||||||
src-git packages https://github.com/openwrt/packages.git;openwrt-23.05
|
src-git packages https://github.com/openwrt/packages.git;openwrt-23.05
|
||||||
src-git luci https://github.com/openwrt/luci.git;openwrt-23.05
|
src-git luci https://github.com/openwrt/luci.git;openwrt-23.05
|
||||||
FEEDS
|
FEEDS
|
||||||
|
|
||||||
echo "📋 feeds.conf:"
|
echo "📋 feeds.conf:"
|
||||||
cat feeds.conf
|
cat feeds.conf
|
||||||
|
echo ""
|
||||||
|
|
||||||
# Update feeds individually with error handling
|
# Update feeds individually with error handling
|
||||||
echo ""
|
|
||||||
echo "🔄 Updating feeds..."
|
echo "🔄 Updating feeds..."
|
||||||
|
|
||||||
FEEDS_OK=0
|
FEEDS_OK=0
|
||||||
|
REQUIRED_FEEDS=2
|
||||||
|
|
||||||
for feed in base packages luci; do
|
for feed in packages luci; do
|
||||||
|
echo ""
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
echo "Updating feed: $feed"
|
echo "Updating feed: $feed"
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
|
||||||
|
FEED_SUCCESS=0
|
||||||
for attempt in 1 2 3; do
|
for attempt in 1 2 3; do
|
||||||
if ./scripts/feeds update $feed 2>&1; then
|
echo "Attempt $attempt of 3..."
|
||||||
echo " ✅ $feed updated"
|
if ./scripts/feeds update $feed 2>&1 | tee feed-update-${feed}.log; then
|
||||||
FEEDS_OK=$((FEEDS_OK + 1))
|
if [[ -d "feeds/$feed" ]]; then
|
||||||
break
|
echo " ✅ $feed updated successfully"
|
||||||
|
FEEDS_OK=$((FEEDS_OK + 1))
|
||||||
|
FEED_SUCCESS=1
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo " ⚠️ Feed directory not created, retrying..."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo " ⚠️ Update command failed, retrying..."
|
||||||
fi
|
fi
|
||||||
echo " ⚠️ Attempt $attempt failed, retrying..."
|
|
||||||
sleep $((10 * attempt))
|
sleep $((10 * attempt))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ $FEED_SUCCESS -eq 0 ]]; then
|
||||||
|
echo " ❌ Failed to update $feed after 3 attempts"
|
||||||
|
echo "Last attempt log:"
|
||||||
|
tail -20 feed-update-${feed}.log 2>/dev/null || echo "No log available"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "📊 Feeds updated: $FEEDS_OK/3"
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
echo "📊 Feeds Status: $FEEDS_OK/$REQUIRED_FEEDS updated"
|
||||||
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||||
|
|
||||||
|
# Verify feeds exist before continuing
|
||||||
|
if [[ $FEEDS_OK -lt $REQUIRED_FEEDS ]]; then
|
||||||
|
echo ""
|
||||||
|
echo "❌ ERROR: Not all required feeds were updated successfully"
|
||||||
|
echo "SDK feeds directory contents:"
|
||||||
|
ls -la feeds/ || echo "feeds directory doesn't exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Install feeds
|
# Install feeds
|
||||||
echo ""
|
echo ""
|
||||||
echo "📦 Installing feeds..."
|
echo "📦 Installing feeds..."
|
||||||
./scripts/feeds install -a 2>&1 || true
|
if ! ./scripts/feeds install -a 2>&1 | tee feed-install.log; then
|
||||||
|
echo "⚠️ Feed installation had errors, checking if critical..."
|
||||||
|
# Continue anyway as some warnings are normal
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify critical directories exist
|
||||||
|
echo ""
|
||||||
|
echo "🔍 Verifying feed installation..."
|
||||||
|
for feed in packages luci; do
|
||||||
|
if [[ -d "feeds/$feed" ]]; then
|
||||||
|
FEED_SIZE=$(du -sh "feeds/$feed" 2>/dev/null | cut -f1)
|
||||||
|
echo " ✅ feeds/$feed exists ($FEED_SIZE)"
|
||||||
|
else
|
||||||
|
echo " ❌ feeds/$feed is missing!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Verify luci.mk exists
|
# Verify luci.mk exists
|
||||||
if [[ -f "feeds/luci/luci.mk" ]]; then
|
if [[ -f "feeds/luci/luci.mk" ]]; then
|
||||||
|
|||||||
26
.github/workflows/build-secubox-images.yml
vendored
26
.github/workflows/build-secubox-images.yml
vendored
@ -157,8 +157,30 @@ jobs:
|
|||||||
echo "✅ Removed telephony and routing from feeds.conf.default"
|
echo "✅ Removed telephony and routing from feeds.conf.default"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./scripts/feeds update -a
|
echo "🔄 Updating feeds..."
|
||||||
./scripts/feeds install -a
|
if ! ./scripts/feeds update -a 2>&1 | tee feed-update.log; then
|
||||||
|
echo "⚠️ Feed update had errors:"
|
||||||
|
tail -30 feed-update.log
|
||||||
|
echo "Continuing anyway..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "📦 Installing feeds..."
|
||||||
|
if ! ./scripts/feeds install -a 2>&1 | tee feed-install.log; then
|
||||||
|
echo "⚠️ Feed install had warnings, checking directories..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify feeds were created
|
||||||
|
echo "🔍 Verifying feeds..."
|
||||||
|
for feed in packages luci; do
|
||||||
|
if [[ -d "feeds/$feed" ]]; then
|
||||||
|
FEED_SIZE=$(du -sh "feeds/$feed" 2>/dev/null | cut -f1 || echo "?")
|
||||||
|
echo " ✅ feeds/$feed ($FEED_SIZE)"
|
||||||
|
else
|
||||||
|
echo " ❌ feeds/$feed missing!"
|
||||||
|
ls -la feeds/ || echo "feeds directory doesn't exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Copy SecuBox packages
|
- name: Copy SecuBox packages
|
||||||
if: ${{ github.event.inputs.include_secubox == 'true' }}
|
if: ${{ github.event.inputs.include_secubox == 'true' }}
|
||||||
|
|||||||
26
.github/workflows/test-validate.yml
vendored
26
.github/workflows/test-validate.yml
vendored
@ -237,8 +237,30 @@ jobs:
|
|||||||
echo "✅ Removed telephony and routing from feeds.conf.default"
|
echo "✅ Removed telephony and routing from feeds.conf.default"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./scripts/feeds update -a
|
echo "🔄 Updating feeds..."
|
||||||
./scripts/feeds install -a
|
if ! ./scripts/feeds update -a 2>&1 | tee feed-update.log; then
|
||||||
|
echo "⚠️ Feed update had errors:"
|
||||||
|
tail -30 feed-update.log
|
||||||
|
echo "Continuing anyway..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "📦 Installing feeds..."
|
||||||
|
if ! ./scripts/feeds install -a 2>&1 | tee feed-install.log; then
|
||||||
|
echo "⚠️ Feed install had warnings, checking directories..."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Verify feeds were created
|
||||||
|
echo "🔍 Verifying feeds..."
|
||||||
|
for feed in packages luci; do
|
||||||
|
if [[ -d "feeds/$feed" ]]; then
|
||||||
|
FEED_SIZE=$(du -sh "feeds/$feed" 2>/dev/null | cut -f1 || echo "?")
|
||||||
|
echo " ✅ feeds/$feed ($FEED_SIZE)"
|
||||||
|
else
|
||||||
|
echo " ❌ feeds/$feed missing!"
|
||||||
|
ls -la feeds/ || echo "feeds directory doesn't exist"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Final cleanup of unwanted feeds
|
# Final cleanup of unwanted feeds
|
||||||
rm -f feeds/telephony.index feeds/routing.index 2>/dev/null || true
|
rm -f feeds/telephony.index feeds/routing.index 2>/dev/null || true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user