Error 500 for certain clients Documents

Hello all,
I recently started using InvoiceNinja a few weeks ago. As I am trying to get my clients to use the client portal to view and approve everything, it has been brought to my attention that one client of my clients recieves “500 — Server Error” when accessing the Documents section of the portal. Out of my half dozen clients I have imported so far, only one client has this issue, and it is only the Documents section.
Currently on Self Hosted v5.4.9.

Hi,

Are there any details about the error in storage/logs?

Note: it may help to update to the latest version of the app.

Hi,
Thank you for your quick reply. This shows up in the log:

[2022-12-25 15:42:39] production.ERROR: Undefined array key "webp" (View: /var/www/invoiceninja/resources/views/portal/ninja2020/components/livewire/documents-table.blade.php) (View: /var/www/invoiceninja/resources/views/portal/ninja2020/components/livewire/documents-table.blade.php) {"userId":4,"exception":"[object] (Illuminate\\View\\ViewException(code: 0): Undefined array key \"webp\" (View: /var/www/invoiceninja/resources/views/portal/ninja2020/components/livewire/documents-table.blade.php) (View: /var/www/invoiceninja/resources/views/portal/ninja2020/components/livewire/documents-table.blade.php) at /var/www/invoiceninja/storage/framework/views/a2623889dbf0a4a32ef9c7de7dc553c1f6f1eb12.php:120)
[stacktrace]

I tried updating to the new version with the web interface, but I get error:

FormatException: SyntaxError: Unexpected token '<', "<html>
<h"... is not valid JSON

@david any thoughts on the error?

Increasing the server’s PHP memory limit may help with the update.

Note: the v5.5.x release require PHP 8.1.

What is the recommended memory limit? I have it set to 512M and I am still getting the error. It does seem like it takes longer to error out now that I have increased the memory.

FormatException: SyntaxError: Unexpected token '<', "<html>
<h"... is not valid JSON

and

[2022-12-25 15:53:04] production.ERROR: syntax error, unexpected token ")" {"exception":"[object] (ParseError(code: 0): syn>
[stacktrace]

It may help to increase to 1024M and/or increase the max request timeout

Ok, I increased to 1024M and set the timeout to 300. This time I got error

FormatException: SyntaxError: Unexpected end of JSON input

Now I am getting a 500 error when I try to sign in to the admin portal. Nothing has been recorded in the logs since the last error I posted.

@hillel I went through and deleted all files associated with this client [in the documents section] and everything is working now.

I am not sure what the issue was, but in the event anyone has any similar issues, try deleting the client uploads first.

1 Like

Glad to hear it’s working, thanks for sharing the solution!

1 Like