community-scripts / community-scripts/ProxmoxVED
pixelfed.sh update_script: composer install fails (runs from /root instead of /opt/pixelfed)
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 191
- Forks
- 497
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 33
Description
Description
Running the update script for the Pixelfed LXC (update / ct/pixelfed.sh) reliably fails during update_script() at the composer install step, aborting the update with services already stopped.
Error
⏳ Updating Pixelfed
Composer could not find a composer.json file in /root
To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage
✖️ in line 53: exit code 1 (General error / Operation not permitted): while executing command composer install --no-dev --no-ansi --no-interaction --optimize-autoloader
Root cause
In update_script(), the sequence is:
chown -R pixelfed:pixelfed /opt/pixelfed
chmod -R 755 /opt/pixelfed
chmod -R 775 /opt/pixelfed/storage /opt/pixelfed/bootstrap/cache
export COMPOSER_ALLOW_SUPERUSER=1
$STD composer install --no-dev --no-ansi --no-interaction --optimize-autoloader
There's no cd /opt/pixelfed before the composer install call. Composer therefore runs against whatever the caller's current working directory happens to be (e.g. /root when the update is triggered from an interactive root shell), not the app directory, and fails immediately since there's no composer.json there. Because this happens after "Stopping Services" and after the release has already been deployed, the script aborts with Pixelfed's services left stopped and the update incomplete (no composer install, no artisan migrate, no service restart).
Suggested fix
Add cd /opt/pixelfed && before the composer call (or an explicit cd /opt/pixelfed on its own line before it), matching how the rest of update_script() already assumes /opt/pixelfed as the working directory:
cd /opt/pixelfed
export COMPOSER_ALLOW_SUPERUSER=1
$STD composer install --no-dev --no-ansi --no-interaction --optimize-autoloader
Workaround
Manually run the remaining steps after a failed update, from /opt/pixelfed:
cd /opt/pixelfed
export COMPOSER_ALLOW_SUPERUSER=1
composer install --no-dev --no-ansi --no-interaction --optimize-autoloader
chown -R pixelfed:pixelfed /opt/pixelfed
sudo -u pixelfed php artisan storage:link
sudo -u pixelfed php artisan migrate --force
sudo -u pixelfed php artisan route:cache
sudo -u pixelfed php artisan view:cache
sudo -u pixelfed php artisan config:cache
systemctl start pixelfed-horizon pixelfed-scheduler.timer
Environment
- Script:
ct/pixelfed.sh(update_script()) - Reproduced updating Pixelfed 0.12.7 → 0.12.10 on a Debian 13 (trixie) LXC
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open ct/pixelfed.sh and inspect update_script(), especially the composer install call after the permissions setup. Ensure the command runs from /opt/pixelfed, then reproduce the Pixelfed update path to confirm composer install, migrations, caching, and service restart complete instead of leaving services stopped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100