Error after instaling update

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.

Hi,

It may help to increase the server’s PHP memory limit and try again.

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.

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?

@hillel

That sounds reasonable.

Well memory limit is set to 1024M. Should I increase to 2048?

Do you see that limit in the app in the health check dialog?

Yes I do

I would expect that to be enough but it may be worth trying.

It may also help to increase the max timeout for PHP.

ok. I increased both values and will check with the next update :wink:

After updating to the latest update the error still occurs, even with the increased values.

@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:

  • client_max_body_size 50M;
  • fastcgi_buffer_size 3200k;
  • fastcgi_connect_timeout 300s;
  • fastcgi_send_timeout 300s;
  • fastcgi_buffers 8 1600k;
  • fastcgi_read_timeout 300s;

and in php.ini

  • memory_limit = 2048M

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.