[GUIDE] Immich v1.137.3 - Upgrade Recovery Process #6613
Gamechiefx
started this conversation in
Guides
Replies: 1 comment
-
As an added update to the guide, most of the broken upgrades I've seen are the result of npm not completing its build process due to an error or the fact that source files were not copied due to a script error. This guide essentially copies files from the source to the app directory and does an npm rebuild to complete the upgrade. all while maintaining immich data. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Immich Upgrade Recovery Guide - Complete Troubleshooting Documentation
Date: 2025-08-06
System: Proxmox LXC Container
Immich Version: 1.137.3
Issue: Immich upgrade broke application - blank page and missing build artifacts
Status: ✅ FULLY RESOLVED
📋 Problem Summary
After upgrading Immich using the Proxmox LXC community scripts, the application failed to start properly with multiple critical errors:
Cannot find module '/opt/immich/app/dist/main'
🔍 Initial Diagnosis
Step 1: Analyzed Startup Script
./start-web.sh
Error: Cannot find module '/opt/immich/app/dist/main'
Step 2: Directory Structure Assessment
/opt/immich/app/dist/main.js
was missingmachine-learning
directory present in/opt/immich/app/
/opt/immich/source/
but not compiledStep 3: Referenced GitHub Discussion
🛠️ Resolution Process
Phase 1: Backend Server Recovery
Issue: Node.js Build Dependencies Missing
node-gyp
failure forcanvas
packagepangocairo
,libcairo2-dev
, and graphics librariesSolution: Install System Dependencies
apt update && apt install -y pkg-config libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Issue: Missing Server Build Artifacts
/opt/immich/app/dist/main.js
and related compiled filesSolution: Rebuild Server from Source
dist/
directory created with all build artifactsmain.js
,main.js.map
, and full compiled applicationIssue: Incorrect Application Structure
/opt/immich/app/dist/main
Solution: Copy Build Artifacts to Runtime Location
Issue: Package.json Path Issues
Error: ENOENT: no such file or directory, open './package.json'
Solution: Copy Package.json to Multiple Locations
start-web.sh
andstart.sh
can find package.jsonPhase 2: Geodata and Resource Recovery
Issue: Reverse Geocoding Failure
Error: ENOENT: no such file or directory, open '/build/geodata/geodata-date.txt'
Solution: Copy and Symlink Geodata
cp -r /opt/immich/source/server/resources /opt/immich/app/ mkdir -p /build && ln -sf /opt/immich/geodata /build/geodata
Phase 3: Frontend Recovery
Issue: Blank Page in Browser
/build/www/index.html
)Unable to open /build/www/index.html, skipping SSR
Solution 1: Build TypeScript SDK Dependency
@immich/sdk
local packageSolution 2: Build Web Frontend
build/
directory with complete web applicationindex.html
(6,875 bytes), assets, service worker, etc.Solution 3: Deploy Frontend Files
mkdir -p /build/www cp -r /opt/immich/source/web/build/* /build/www/
Phase 4: Process Management and Startup
Issue: Port Conflicts
Error: listen EADDRINUSE: address already in use :::2283
Solution: Clean Process Management
Issue: Script Selection
start-web.sh
,start.sh
start.sh
starts both API and microservices workersSolution: Use Proper Startup Script
🎯 Final Verification
Backend Verification
curl -s -w "HTTP Status: %{http_code}\nResponse Time: %{time_total}s\n" http://127.0.0.1:2283/api/server-info/ping
Frontend Verification
curl -s -w "HTTP Status: %{http_code}\nContent Length: %{size_download} bytes\n" http://127.0.0.1:2283
Service Status
📊 Summary of Changes Made
Files Created/Modified:
Backend Build Artifacts:
/opt/immich/app/dist/
- Complete compiled application/opt/immich/app/node_modules/
- Runtime dependencies/opt/immich/app/package.json
- Package manifestFrontend Build Artifacts:
/build/www/index.html
- Main web interface (6,875 bytes)/build/www/_app/
- Svelte application assets/build/www/*.js
- Service workers and JavaScriptDependencies Built:
/opt/immich/source/open-api/typescript-sdk/build/
- TypeScript SDKlibcairo2-dev
,libpango1.0-dev
, etc.Resource Links:
/build/geodata/
→/opt/immich/geodata/
(symlink)System Commands Used:
apt install
,npm ci
,npm run build
cp -r
,mkdir -p
,ln -sf
pkill
,kill -9
,netstat
,nohup
curl
,head
,tail
,ls -la
1. Immich Upgrade Risks
2. Dependency Chain
3. Multiple Startup Methods
start.sh
for complete service4. Port Management
netstat -tlnp | grep :2283
5. File Path Expectations
/opt/immich/app/dist/main.js
/build/www/index.html
/build/geodata/geodata-date.txt
🚀 Usage Instructions Post-Recovery
Start Immich
cd /opt/immich ./start.sh
Stop Immich
Check Status
Access Web Interface
🛡️ Prevention for Future Upgrades
Pre-Upgrade Checklist
/opt/immich/.env
)Post-Upgrade Verification
curl http://127.0.0.1:2283/api/server-info/ping
Recovery Procedure Summary
npm ci && npm run build
in/opt/immich/source/server/
/opt/immich/source/open-api/typescript-sdk/
npm ci && npm run build
in/opt/immich/source/web/
📞 Troubleshooting Quick Reference
Error: "Cannot find module '/opt/immich/app/dist/main'"
Error: Blank page in browser
Error: "EADDRINUSE: address already in use"
netstat -tlnp | grep :2283
thenkill -9 [PID]
Error: "ENOENT: no such file or directory, open './package.json'"
cp /opt/immich/source/server/package.json /opt/immich/
Error: Missing geodata files
mkdir -p /build && ln -sf /opt/immich/geodata /build/geodata
✅ Final Status - Complete Success
Resolution Time: ~45 minutes
Current Status: ✅ FULLY OPERATIONAL
Version: Immich v1.137.3
All Features Working: Photo management, AI search, facial recognition, maps, etc.
Performance: <3ms response time, all original optimizations intact
This comprehensive recovery demonstrates that Immich upgrade issues can be resolved by rebuilding the application components from source when build artifacts are lost during the upgrade process.
Beta Was this translation helpful? Give feedback.
All reactions