Immich v2.4.1 → v2.5.0 Manual Upgrade Failures #25672
-
I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.
The bugEnvironmentProxmox Setup:
Immich Installation:
Network:
Issue DescriptionAttempted manual upgrade from v2.4.1 to v2.5.0 following standard procedure, but encountered multiple cascading failures related to module resolution, Python dependencies, and file structure issues. Attempted Upgrade ProcessStep 1: Pre-Upgrade Backup ✅# Created PostgreSQL backup
su - postgres -c "pg_dump immich -F c -f /var/lib/postgresql/backups/immich_pre_upgrade_$(date +%Y%m%d).backup"
# Result: 238MB backup created successfullyStep 2: Download & Extract v2.5.0 Sourcecd /opt/immich
systemctl stop immich-web immich-ml
rm -rf source
wget https://github.com/immich-app/immich/archive/refs/tags/v2.5.0.tar.gz
tar -xzf v2.5.0.tar.gz
mv immich-2.5.0 source
rm v2.5.0.tar.gzStep 3: Rebuild Server ❌cd /opt/immich/source/server
pnpm install # Completed successfully
pnpm build # Completed successfully
# Copied built files to app directory
rm -rf /opt/immich/app/*
cp -r dist/* /opt/immich/app/
cp package.json /opt/immich/app/
cp -r node_modules /opt/immich/app/Problem 1: Wrong directory structure - Files were flattened instead of preserving Errors EncounteredError 1: Module Not Found (kysely)Symptom: Root Cause:
Attempted Fixes:
Error 2: Python Dependencies MissingSymptom: # ML service failing
ModuleNotFoundError: No module named 'gunicorn'Root Cause:
Attempted Fixes:
Error 3: Python Executable Not FoundSymptom: Root Cause:
Fix Applied: ln -s /usr/bin/python3 /usr/bin/pythonError 4: Module Resolution PersistsEven after multiple attempts to fix node_modules:
Consistent Error: The pnpm symlink structure worked when running as root but failed when running as the Database Restoration IssuesWhen attempting to restore from backup after failed upgrade: Error: Cause: Fresh v2.4.1 installation had pre-created schema that conflicted with backup. Solution: su - postgres -c "dropdb immich"
su - postgres -c "createdb immich -O immich"
gunzip -c backup.sql.gz | su - postgres -c "psql immich"ResolutionAbandoned manual upgrade and performed clean rebuild:
su - postgres -c "psql -c \"ALTER USER immich WITH PASSWORD 'PASSWORD_FROM_ENV';\""Total time: ~3 hours of troubleshooting, 30 minutes for clean rebuild. RecommendationsFor Community Script Maintainers
function update_script() {
# Check version
# Stop services
# Backup database automatically
# Download new version
# Rebuild with proper structure
# Migrate if needed
# Restart services
}
For UsersDO NOT attempt manual upgrades. Wait for official community script support: # When officially supported, use:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/immich.sh)"
# And select "Update" option (when available)Before any upgrade attempt:
Technical DetailsFile Structure IssuesExpected: What happened during manual upgrade: Working Configuration (v2.4.1)Database Backup Schedule: "backup": {
"database": {
"cronExpression": "0 02 * * *",
"enabled": true,
"keepLastAmount": 14
}
}Storage:
Related Issues
System Information# Container
root@immich:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 13 (trixie)"
VERSION="13 (trixie)"
# Node.js
root@immich:~# node --version
v24.13.0
# pnpm
root@immich:~# pnpm --version
10.28.0
# Python
root@immich:~# python3 --version
Python 3.13.5
# PostgreSQL
root@immich:~# su - postgres -c "psql --version"
psql (PostgreSQL) 16.11ConclusionManual upgrades of Immich in the community-scripts environment are not recommended due to:
Recommendation: Wait for official community script update support for v2.5.0 before upgrading. Labels: The OS that Immich Server is running onDebian 13 (Trixie) Version of Immich Server2.5.0 Version of Immich Mobile App2.4.1 build .239 Platform with the issue
Device make and modelIphone 16 Pro Max Your docker-compose.yml contentN/A - Not using Docker
Installation Method: Native systemd deployment via Proxmox Community Scripts
Repository: https://github.com/community-scripts/ProxmoxVE
Script: ct/immich.sh
Deployment: LXC container with systemd services
See systemd service configuration above for equivalent deployment details.Your .env contentbash# Database Configuration
DB_HOSTNAME=127.0.0.1
DB_USERNAME=immich
DB_PASSWORD=******** # REDACTED
DB_DATABASE_NAME=immich
DB_VECTOR_EXTENSION=vectorchord
# Storage Configuration
IMMICH_MEDIA_LOCATION=/mnt/waihonaReproduction stepsReproduction Steps for Immich v2.4.1 → v2.5.0 Upgrade Failure Environment
Initial Installation# Install Immich v2.4.1 using Proxmox Community Scripts
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/immich.sh)"Container Configuration:
Verify Working Installation# Access web interface
http://:2283
# Verify services running
systemctl status immich-web immich-ml
# Both should show: active (running)
# Verify version
cat /opt/immich/app/package.json | grep version
# Should show: "version": "2.4.1"Reproduction StepsStep 1: Create Database Backup# Enter container (from Proxmox host)
pct enter
# Create backup directory
mkdir -p /var/lib/postgresql/backups
chown postgres:postgres /var/lib/postgresql/backups
# Create PostgreSQL backup
su - postgres -c "pg_dump immich -F c -f /var/lib/postgresql/backups/immich_pre_upgrade_$(date +%Y%m%d).backup"
# Verify backup created
ls -lh /var/lib/postgresql/backups/
# Expected: Backup file ~200-300MBStep 2: Stop Immich Servicessystemctl stop immich-web
systemctl stop immich-ml
# Verify stopped
systemctl status immich-web immich-ml
# Both should show: inactive (dead)Step 3: Download v2.5.0 Sourcecd /opt/immich
# Remove old source
rm -rf source
# Download v2.5.0
wget https://github.com/immich-app/immich/archive/refs/tags/v2.5.0.tar.gz
tar -xzf v2.5.0.tar.gz
mv immich-2.5.0 source
rm v2.5.0.tar.gz
# Verify download
ls -la /opt/immich/source/Step 4: Build Server Applicationcd /opt/immich/source/server
# Install dependencies
pnpm installExpected Output: # Build application
pnpm buildExpected Output: Step 5: Copy Built Files to App Directorycd /opt/immich
# Clear app directory
rm -rf app/*
# Copy files (WRONG - flattens directory structure)
cp -r source/server/dist/* app/
cp source/server/package.json app/
cp -r source/server/node_modules app/Result: Files are incorrectly flattened: Expected structure: Step 6: Attempt to Start Web Servicesystemctl start immich-web
# Check status
systemctl status immich-webExpected Error: Check logs: tail -30 /var/log/immich/web.logExpected Error in Logs: Attempted Fixes (All Failed)Fix Attempt #1: Correct Directory Structurecd /opt/immich/app
# Create dist directory
mkdir -p dist
# Move files into dist/
mv *.js *.map *.d.ts *.tsbuildinfo dist/
mv bin commands controllers cores dtos emails maintenance middleware \
repositories schema services sql-tools types utils workers dist/
# Verify structure
ls -la /opt/immich/app/dist/main.js
# Should exist nowRestart service: systemctl restart immich-web
tail -20 /var/log/immich/web.logResult: Same MODULE_NOT_FOUND error persists Fix Attempt #2: Reinstall node_modulescd /opt/immich/app
# Remove existing node_modules
rm -rf node_modules
# Reinstall dependencies
pnpm install --prodExpected Output: Check symlink structure: ls -la /opt/immich/app/node_modules/kyselyOutput: Verify target exists: ls -la /opt/immich/app/node_modules/.pnpm/kysely@0.28.2/node_modules/kyselyOutput: Restart service: systemctl restart immich-webResult: Still fails with MODULE_NOT_FOUND Fix Attempt #3: Test Module Resolution# Test as root user
cd /opt/immich/app
node -e "console.log(require('kysely'))"Output: ✅ Works as root! But service running as immich user still fails: systemctl start immich-web
tail /var/log/immich/web.logResult: MODULE_NOT_FOUND when running as immich user Fix Attempt #4: Fix Ownership# Set proper ownership
chown -R immich:immich /opt/immich/app
# Restart service
systemctl restart immich-webResult: Still fails with same error Machine Learning Service IssuesIssue #1: Python Dependencies Missingsystemctl start immich-ml
systemctl status immich-mlExpected Error: Check logs: tail /var/log/immich/ml.logExpected Error: Attempt to install: cd /opt/immich/source/machine-learning
pip install --break-system-packages -e .Result: pip3 install --break-system-packages -e .Result: python3 -m pip install --break-system-packages -e .Result: Issue #2: Install with uv (Partial Success)# Check if uv is available
which uvOutput: Install Python dependencies: cd /opt/immich/source/machine-learning
uv pip install --system -e .Expected Output: Try to start ML service: systemctl start immich-ml
tail /var/log/immich/ml.logExpected Error: Issue #3: Python Executable Not FoundFix: # Create python symlink
ln -s /usr/bin/python3 /usr/bin/python
# Verify
which python
python --versionOutput: Start ML service: systemctl start immich-ml
systemctl status immich-mlResult: ✅ ML service now starts successfully Final StateAfter all attempted fixes:
System Information# Container OS
cat /etc/os-release# Node.js version
node --version# pnpm version
pnpm --version# Python version
python3 --version# PostgreSQL version
su - postgres -c "psql --version"Working Restoration MethodAfter failed upgrade attempts, complete restoration was achieved: Step 1: Destroy Broken Container# From Proxmox host
pct stop
pct destroy Step 2: Reinstall Fresh v2.4.1# Use community script
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/immich.sh)"
# Use same container ID and configuration as beforeStep 3: Reconnect NFS Storage# On Proxmox host
mount -t nfs :/volume1/storage /mnt/storage
# Bind mount to container
pct stop
pct set -mp0 /mnt/storage,mp=/mnt/storage
pct start Step 4: Restore Database# Enter container
pct enter
# Drop and recreate database
su - postgres -c "dropdb immich"
su - postgres -c "createdb immich -O immich"
# Restore from backup
gunzip -c /mnt/storage/backups/immich_pre_upgrade_20260127.backup.sql.gz | \
su - postgres -c "psql immich"
# Verify restoration
su - postgres -c "psql -d immich -c 'SELECT COUNT(*) FROM asset;'"
# Should show your photo countStep 5: Fix Database Password# Get password from .env
grep DB_PASSWORD /opt/immich/.env
# Set password in PostgreSQL
su - postgres -c "psql -c \"ALTER USER immich WITH PASSWORD '';\""Step 6: Configure Storage Location# Add storage location to .env
echo "IMMICH_MEDIA_LOCATION=/mnt/storage" >> /opt/immich/.envStep 7: Start Servicessystemctl start immich-ml
systemctl start immich-web
# Verify both running
systemctl status immich-web immich-mlResult: ✅ Full restoration on v2.4.1 with all photos accessible Root Causes Identified
Expected BehaviorThe community script should provide:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/immich.sh)"
# Should detect existing installation and offer update option
Workaround for NowDo NOT attempt manual upgrade. Wait for official community script support for v2.5.0. To stay safe:
Additional Notes
Relevant log outputAdditional informationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
You're using an unsupported installation method, so there's no point in reporting this to us as we can't help with it. |
Beta Was this translation helpful? Give feedback.
-
|
For the future, the proper way to update the LXC script is to wait for the maintainers to release the update and then from the commandline just... |
Beta Was this translation helpful? Give feedback.
-
|
Please don't post issues with Immich on this issues board if you're using our install script. Thank you |
Beta Was this translation helpful? Give feedback.
For the future, the proper way to update the LXC script is to wait for the maintainers to release the update and then from the commandline just...
update.