Home Forums Support Error 500 when uploading files to an expense via Android app

This topic contains 4 replies, has 3 voices, and was last updated by  Hillel Coren 6 days, 21 hours ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #22128



    First off, thanks for developing such a fantastic product!

    I’m self hosting Invoice Ninja (v4.5.14 running on Ubuntu/nginx/php) on my own server, and I can happily upload files and attachments to Expenses without problem via the web site. However, I am unable to do the same from the Android app – I just get an error message: 500: An error occurred.

    On the server, I get the following error in laravel-error.log:

    [2019-10-07 11:20:57] production.ERROR: ***ErrorException*** [0] : /var/www/ninja/app/Ninja/Repositories/DocumentRepository.php [Line 112] => getimagesize(): Read error! {"context":"PHP","user_id":1,"account_id":1,"user_name":"******","method":"POST","user_agent":"Dart/2.5 (dart:io)","locale":"en","ip":"XX.XX.XX.XX","count":1,"is_console":"no","is_api":"yes","db_server":"mysql","url":"api/v1/documents"} []

    Any thoughts?


    Hillel Coren

    I think the problem is with the image file itself (hence the ‘read error’), please check if it works with a different image format.



    Hi Hillel,

    You’re right it does seem to be an image format issue. A different image from a different source (WhatsApp) seems to work fine. However, this means I can’t upload any images taken by my phone camera via the app (Samsung Note 4).

    I don’t have this problem when uploading the same image from the web interface. That accepts everything just fine. Are the mobile app and web interface using different APIs? Is the mobile one perhaps a bit out of date?



    I get the exact same issue (self hosted) using the app and taking a picture to upload for an expense using a Samsung S8. I re-iterate this is a great platform and appreciate the hard work. If this could be looked into that would be great as it would be very handy on the go to use you mobile to capture receipts etc straight to the server without having to scan then send.

    PS i also ensure my php settings were correct to allow large post/max upload sizes.



    Hillel Coren

    That’s strange, the web and mobile apps rely on the same code.

    If anyone else is seeing an error please confirm you see the same “getimagesize(): Read error!” message in the logs.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Posted in: