Recent upgrades don't automatically upgrade anymore

Hi guys - I’ve noticed the last 4 updates I’ve performed recently no longer automatically upgrade - instead I have to point the URL to /update for the upgrade to complete.

I’ve been using WinSCP to upload the files in default transfer mode for yonks.

Any idea why this is happening?

What software stack is your installation running on?

Ubuntu Server 16.04 LTS - All updates applied

Regards

Sounds like permissions may have been changed or the FTP server isn’t cooperating.

If you have SSH access, try having the server grab the files itself. (The usual “use this advice at your own risk, I take no responsibility, etc.” disclaimers apply here.)

wget -P /home/<username>/download https://download.invoiceninja.com/ninja-v3.7.1.zip

unzip -q /home/<username>/download/ninja-v3.7.1.zip -d /home/<username>/download/

sudo rsync -tr /home/<username>/download/ninja/ /var/www/ninja/

Once that’s done, be sure to reset the permissions for /ninja/storage (default is usually www-data)

sudo chown -R www-data:www-data /var/www/ninja/storage/
sudo chmod -R 775 /var/www/ninja/storage/

If all that works, you can run this script (modified to match your install) as a cronjob under root to automatically check for updates every day and install them as they come out.

How can I verify all permissions are correct in /var/www/ninja? - Uploading used to work without issue with WinSCP in default transfer mode, and I’d be redirected to /update automatically.

I’ll look into the the shell script once I’ve resolved the permission issues.

I should add that this is a standard SFTP server install - straight out of the box when I installed Ubuntu Server.

Many thanks

I was mainly just spitballing on the permissions part. But if everything is default with your install, then www-data should be the owner and group for /var/www/ninja/storage/. You can try running sudo chown -R www-data:www-data /var/www/ninja/storage/ and sudo chmod -R 775 /var/www/ninja/storage/ then see if that works. Beyond that, it’s probably something the dev will have to address.

Many thanks Titanfail - It looks like several files below the parent hadn’t inherited permissions correctly. I’ll setup that shell script for future updates and see how it pans out.

Cheers

Happy to help! :slight_smile:

Hi Titanfail - The script is working perfectly via CRON, however I’m still having to navigate to /update after the upgrades complete (otherwise I get a ‘whoops something went wrong’ - is there any way I can force an /update automatically after the script completes?

Many thanks