Update error: FormatException: SyntaxError: Unexpected end of JSON input ⚠

Still think there needs an error catch to tell the user their memory limit is not enough. Seen lots of people still getting confused about this error.

1 Like

Maybe a forum sticky telling people that 256M is the minimum memory requirement?
(and update the documentation page too?)

Kind regards
AngryWarrior

1 Like

In a recent version we’ve added the memory limit to the health check.

@david should we show a warning if the limit is below a certain amount?

@hillel

since we dropped snappdf from being bundled, the file has reduced in size to 118mb so 128mb should be sufficient.

1 Like

I have 256mb php memory and still get “FormatException: Unexpected end of input (at character 1) ^” when trying to update from v5.5.15 to v5.5.17. I did the last update manually due to this error, but still throwing that error after snappdf removel. Before this auto-update worked.

It’s possible increasing the limit to 512 may help

My shared hosting has a 256mb limit

As a workaround you can try manually copying the latest release zip

Maybe you should consider to use a VPS instead?
Shared hosting is not a very private place and has a lot of limitations like for example the one you already mentioned.

256M should be sufficient for a Invoice Ninja installation and it should work when you upgrade.

We just did it ourselves and you are probably suffering from not getting the full 256M of memory from the shared server environment maybe…

Kind regards
AngryWarrior

@AngryWarrior thanks for your recommendation! I will consider that if i can’t get auto updates to work.

1 Like

Its my pleasure to help if I can. :facepunch:
I hope this issue solves for you.

Kind regards
AngryWarrior

@AngryWarrior thanks again! Unfortunately the problem is not solved yet.

1 Like

@AngryWarrior wait, my cli php memory limit is still 128mb, so i have to fix that.

$ php -i | grep “memory_limit”
memory_limit => 128M => 128M

It could be limitations set by the host too that prevents the change, (I’m not saying that it is that way, but some “shitty” hosts do some weird stuff so it could be the case too.).

Memory is a precious commodity on a shared server you know…

Especially hosting companies offering cheap (shared) hosting tend to do a lot of dirty tricks from my past experience to prevent users from using too much server resources.

Kind regards
AngryWarrior

I set the path alias php=‘php -c /xxx/xxx/bin/php.ini’ to an aditional php.ini for CLI in .bashrc with memory_limit=256M

Now i see 256M php memory for both webserver and CLI
$ php -i | grep “memory_limit”
memory_limit => 256M => 256M

I still get “FormatException: SyntaxError: Unexpected end of JSON input”

That is related to that Invoice Ninja doesn’t have access to enough memory to perform the upgrade.
At least it been like that in our case when we have received that error message.

So I am guessing it could be the same for you.

I would recommend that you order a VPS instead and install Invoice Ninja on that. That way you will have guaranteed memory and full access to it. Plus a bonus is that your data is 100% private which isn’t bad thing. :+1:

Kind regards
AngryWarrior

It may help to increase to 512

1 Like

Yes, but his shared hosting only allows 256M… So that is quite limited…
Kind regards
AngryWarrior

Thanks, you are correct. I see I already suggested this earlier in the thread.

1 Like

hello, i want to update invoiceninja too. I get the same error but i have increased the memory_limit to 512M and it doesnt work :frowning:

edit: where is the exact location of the php file?