For some unknown reason, I no longer get updates notifications. This has started a while ago on a previous version (last time the updates notifications worked was around 5.2.x IIRC), but I didn’t report it at the time, since I thought it may eventually be fixed, but apparently the notifications never came back, so here I am, reporting this.
My cron jobs appear to work properly and when I try to the “force update” setting in IN, it tells me that I’m running the latest version - which right now is not true since I just checked Github and the latest version is .80, whereas I’m running .79.
I tried anyway to force the update through the interface and I got
FormatException: Unexpected character (at character 1)
<html><head><title>500 Internal Server Error</title></head><body>
When I do manual updates (unzip source code → php artisan optimize), everything works fine, though.
Did something change with the update checks in the past few months?
Are there any details about the 500 error in storage/logs?
Nope, nothing logged at all!
It has been a while since we have pushed a release, and the self host systems only check once per day for the latest version.
The self-updater has changed since 5.3.78, it only consists of 5 lines now:
$this->testWritable(); //check the filesystem is writable
copy($this->getDownloadUrl(), storage_path('app/invoiceninja.zip')); //copy release to local system
$file = Storage::disk('local')->path('invoiceninja.zip');
$zipFile = new \PhpZip\ZipFile();
$zipFile->openFile($file); // open zip file
$zipFile->extractTo(base_path()); // extract and overwrite files
unlink($file); //delete release
It may be a platform issue that is not allowing the system to download the release file?
And whats happen with docker version? Will show notifications of new versions?
For Docker, you only have to do
Tanks for the details! It might be related to a platform issue, indeed. I guess I’ll have to eventually upgrade my shared server to a VPS to get the most out of IN.
Sorry for resurrecting this old thread, but I did end up upgrading my hosting to VPS several months down the line, so now I can’t blame anything on my shared server anymore
When setting up the new server initially, I had a notification for an update when firing up Invoice Ninja for the first time - well, not the first time since I migrated the previous installation, but that was its first run on the new server. The update ran successfully (I had to run it twice for some reason, but it worked).
It’s been over ten days now, though, and I’ve not had any other update notifications since the first one, I’m still running v5.5.45, which is 4 versions old.
Is there something I could be looking in the logs for that might prevent updates? There is nothing in the Laravel log, but maybe somewhere else? Or can I setup a separate cron job to force checking for updates (and then forcing updates if one is available) ?
Is there anything you can see? I can see the version endpoint has the current version.
Do you see an update option when clicking the about icon in the lower left corner?
@hillel I see the “force update” button, but there is no “regular” update button!
Can you post screenshots of the app and the about dialog?
Thanks! .51 was just released yesterday, it may take up to 24 hours to show in the app.
Thanks, but the update still doesn’t show up more than two days later!
Since my last post, by the way, I also reverted back from PHP 8.2 to PHP 8.1 just in case, since I noticed that some SnapPDF dependencies were complaining about not being run on the right version of PHP when I reinstalled them. I thought that might help, but no.
Back to the self-updater, it used to work qui a bit of time ago on my end in the early releases of v5 (and for most of 2021 I think), before the self-update code was changed in 5.3.78 (as noted by David earlier in this thread):
I thought moving my installation to a VPS with more access to the system would solve some quirks like that, but alas, no. I’m not savvy enough to understand the code that David posted above; is there a special service that has to run on the server or something for the update check to work? Or maybe this is some kind of firewall issue? Is there a port that has to be opened?
In the meantime, I can somewhat rely on Softaculous to keep my install updated (semi) automatically without having to deal with manual updates, but its repository is updated several days, sometimes weeks, after the official releases, and I’d rather have everything run natively in IN anyway, if possible.
This is from today:
That makes me think… if Softaculous uses a cron job to check for updates in its depository, could I maybe add a separate cron job to force IN itself to look for updates in the GitHub repository? If so, what command could that be?
Can you check the response to the refresh request in the network tab of the browser console to see which version is being returned.
Sure, here it is:
Looks like the app is failing the update check, because it’s “stuck” at .5.50!
@david do you have any ideas?
I tried doing a separate, new, completely fresh install from Softaculous (which is at .5.54). The app is still reporting that 5.5.50 is the latest version, despite running 5.5.54!
If it is stuck at 5.5.50, it means your cron is not running the daily check to see if there is a new version available
The app polls the following URL for the latest version
it is currently showing 5.5.55