@@ -242,10 +242,74 @@ jobs:
242242 # Set CI environment variables
243243 export CI_ENVIRONMENT=true
244244 export DEBIAN_FRONTEND=noninteractive
245+ export NEEDRESTART_MODE=a
246+ export NEEDRESTART_SUSPEND=1
247+
248+ # Debug: Check script exists and is executable
249+ echo "🔍 Checking remove-preinstalled.sh..."
250+ if [ -f "./removes/remove-preinstalled.sh" ]; then
251+ echo "✅ remove-preinstalled.sh exists"
252+ ls -la ./removes/remove-preinstalled.sh
253+ else
254+ echo "❌ remove-preinstalled.sh missing"
255+ ls -la ./removes/
256+ exit 1
257+ fi
258+
259+ # Debug: Check environment and fix EUID issue
260+ echo "🔍 Environment check:"
261+ echo "Current user: $(whoami)"
262+ echo "EUID: $EUID"
263+ echo "PWD: $PWD"
264+ echo "CI_ENVIRONMENT: $CI_ENVIRONMENT"
265+ echo "DEBIAN_FRONTEND: $DEBIAN_FRONTEND"
266+
267+ # Debug: Check required files exist
268+ echo "🔍 Checking required files..."
269+ if [ -f "/usr/local/bin/enginescript/enginescript-variables.txt" ]; then
270+ echo "✅ enginescript-variables.txt exists"
271+ else
272+ echo "❌ enginescript-variables.txt missing"
273+ fi
245274
246- sudo bash -c "cd /usr/local/bin/enginescript/scripts/install && timeout 300 ./removes/remove-preinstalled.sh" 2>&1 | sudo tee /tmp/ci-logs/removes.log || {
247- echo "⚠️ Remove preinstalled software had issues, continuing..."
275+ if [ -f "/home/EngineScript/enginescript-install-options.txt" ]; then
276+ echo "✅ enginescript-install-options.txt exists"
277+ else
278+ echo "❌ enginescript-install-options.txt missing"
279+ fi
280+
281+ # Run with enhanced debugging and CI-specific fixes
282+ echo "🚀 Starting preinstalled software removal with debug output..."
283+ sudo bash -c "
284+ set -x
285+ cd /usr/local/bin/enginescript/scripts/install
286+ export CI_ENVIRONMENT=true
287+ export DEBIAN_FRONTEND=noninteractive
288+ export NEEDRESTART_MODE=a
289+ export NEEDRESTART_SUSPEND=1
290+ export APT_LISTCHANGES_FRONTEND=none
291+
292+ # Force EUID to 0 for CI environment
293+ export EUID=0
294+
295+ # Ensure package manager is ready
296+ echo 'Preparing package manager...'
297+ apt-get update -qq
298+
299+ # Kill any hanging package managers
300+ killall -9 apt apt-get dpkg 2>/dev/null || true
301+
302+ # Remove package manager locks
303+ rm -f /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/lock
304+
305+ echo 'Starting remove-preinstalled.sh...'
306+ timeout 300 ./removes/remove-preinstalled.sh
307+ " 2>&1 | sudo tee /tmp/ci-logs/removes.log || {
308+ echo "❌ Remove preinstalled software failed or timed out"
309+ echo "📋 Last 30 lines of output:"
248310 tail -30 /tmp/ci-logs/removes.log
311+ echo "📋 Full log file size: $(wc -l < /tmp/ci-logs/removes.log 2>/dev/null || echo 0) lines"
312+ exit 1
249313 }
250314 sudo sync
251315 echo "✅ Preinstalled software removal completed"
@@ -285,16 +349,80 @@ jobs:
285349
286350 - name : Install Dependencies
287351 run : |
288- echo "� Installing dependencies..."
352+ echo "📦 Installing dependencies..."
289353 cd /usr/local/bin/enginescript/scripts/install
290354
291- # Set CI environment variables
355+ # Set CI environment variables with maximum verbosity
292356 export CI_ENVIRONMENT=true
293357 export DEBIAN_FRONTEND=noninteractive
358+ export NEEDRESTART_MODE=a
359+ export NEEDRESTART_SUSPEND=1
360+
361+ # Debug: Check script exists and is executable
362+ echo "🔍 Checking depends-install.sh..."
363+ if [ -f "./depends/depends-install.sh" ]; then
364+ echo "✅ depends-install.sh exists"
365+ ls -la ./depends/depends-install.sh
366+ else
367+ echo "❌ depends-install.sh missing"
368+ ls -la ./depends/
369+ exit 1
370+ fi
371+
372+ # Debug: Check environment and fix EUID issue
373+ echo "🔍 Environment check:"
374+ echo "Current user: $(whoami)"
375+ echo "EUID: $EUID"
376+ echo "PWD: $PWD"
377+ echo "CI_ENVIRONMENT: $CI_ENVIRONMENT"
378+ echo "DEBIAN_FRONTEND: $DEBIAN_FRONTEND"
379+
380+ # Debug: Check required files exist
381+ echo "🔍 Checking required files..."
382+ if [ -f "/usr/local/bin/enginescript/enginescript-variables.txt" ]; then
383+ echo "✅ enginescript-variables.txt exists"
384+ else
385+ echo "❌ enginescript-variables.txt missing"
386+ ls -la /usr/local/bin/enginescript/ | head -10
387+ fi
294388
295- sudo bash -c "cd /usr/local/bin/enginescript/scripts/install && timeout 900 ./depends/depends-install.sh" 2>&1 | sudo tee /tmp/ci-logs/depends.log || {
296- echo "⚠️ Dependencies installation had issues, continuing..."
389+ if [ -f "/home/EngineScript/enginescript-install-options.txt" ]; then
390+ echo "✅ enginescript-install-options.txt exists"
391+ else
392+ echo "❌ enginescript-install-options.txt missing"
393+ ls -la /home/EngineScript/
394+ fi
395+
396+ # Run with enhanced debugging and CI-specific fixes
397+ echo "🚀 Starting dependencies installation with debug output..."
398+ sudo bash -c "
399+ set -x
400+ cd /usr/local/bin/enginescript/scripts/install
401+ export CI_ENVIRONMENT=true
402+ export DEBIAN_FRONTEND=noninteractive
403+ export NEEDRESTART_MODE=a
404+ export NEEDRESTART_SUSPEND=1
405+ export APT_LISTCHANGES_FRONTEND=none
406+
407+ # Force EUID to 0 for CI environment
408+ export EUID=0
409+
410+ # Ensure package manager is ready
411+ apt-get update -qq
412+
413+ # Kill any hanging package managers
414+ killall -9 apt apt-get dpkg 2>/dev/null || true
415+
416+ # Remove package manager locks
417+ rm -f /var/lib/dpkg/lock-frontend /var/lib/dpkg/lock /var/cache/apt/archives/lock
418+
419+ timeout 300 ./depends/depends-install.sh
420+ " 2>&1 | sudo tee /tmp/ci-logs/depends.log || {
421+ echo "❌ Dependencies installation failed or timed out"
422+ echo "📋 Last 50 lines of output:"
297423 tail -50 /tmp/ci-logs/depends.log
424+ echo "📋 Full log file size: $(wc -l < /tmp/ci-logs/depends.log 2>/dev/null || echo 0) lines"
425+ exit 1
298426 }
299427 sudo sync
300428 echo "✅ Dependencies installation completed"
0 commit comments