March 5, 2023, 5:51pm
I got this error after updating to the most recent version thru the mac app:
FormatException: Unexpected character (at character 1)
On safari I am getting:
FormatException: SyntaxError: JSON Parse error: Unrecognized token ‘<’
The update seems to be installed.
March 5, 2023, 5:57pm
It may help to increase the server’s PHP memory limit and try again.
March 6, 2023, 5:39am
I would advice against using upgrade feature on apps or web browser. It has broken my invoiceninja more than few times.
I manually upgrade using FTP. No problems so far.
March 6, 2023, 7:54am
The error above is common if the PHP memory limit is set too low, there is a check for this in the health check dialog.
@david should we consider returning an error if a user tires to update without enough memory?
March 7, 2023, 7:29am
Well memory limit is set to 1024M. Should I increase to 2048?
March 7, 2023, 7:43am
Do you see that limit in the app in the health check dialog?
March 7, 2023, 10:10am
I would expect that to be enough but it may be worth trying.
It may also help to increase the max timeout for PHP.
March 7, 2023, 11:10am
ok. I increased both values and will check with the next update
March 10, 2023, 9:00am
After updating to the latest update the error still occurs, even with the increased values.
March 10, 2023, 9:08am
@david do you have any thoughts?
I can also confirm that I receive that same error every single time I upgrade in the app/browser as well. I have tried adjusting the php parameters and it still occurs.
Although the upgrade does complete, it doesn’t reflect until later or doing the /update?secret=secret
I have set in nginx:
fastcgi_buffers 8 1600k;
and in php.ini
March 11, 2023, 11:48am
The problem is that the update may take longer than the default gateway timeout.
What is most likely happening is that it is exceeding the 30 seconds which is why you are seeing the malformed json responses. The update will continue in the background however it will appear to “fail” due to this timeout.
We’d need to look into doing a multi step update whic downloads the file first, then runs the full update script, this would at least save the time it takes to download the file, which on some servers may be throttled and take a bit longer.