Lee Chambers's picture

Hi,

On the most recent release of Invoice Ninja it will not allow a company logo to be uploaded.

Comes up with "There was a problem reading the image file, please try a different format."

I have tried uploading different formats and also the correct size according to Invoice Ninja website but no success.

Im not a linux genius but looking at the folder permissions they are 0775 which seems to be correct, im now at a loss, please help

Lee

Forum: 
Lee Chambers's picture

Still no success with this 

Jeremy Davis's picture

Thanks for reporting the issue.

Normally I'd also ask for the explicit version (e.g. v16.0), but in this case it doesn't matter as there is only one.

Regarding the issue, a bit of googling suggests that can be caused by the PHP GD extension not being installed. And sure enough, it's not installed, so perhaps that's the issue?

To install, please run the following (if not root, prefix all lines with 'sudo'):

apt update
apt install php-gd
systemctl restart apache2
Lee Chambers's picture

hi, Jeremy 

I will give this a try and report back i did read something about php-gd, but wasnt aware of what it was, i presumed it would of been included.

Thank you 

Jeremy Davis's picture

It's been a little while since I built Invoice Ninja, but I don't recall reading anything about it being a requirement. Regardless, if it's required for the base functionality, then it should be pre-installed. As this appears to be a bug, I've opened an issue so we can fix it in the next release.

FWIW on closer inspection, I note that there are a couple of other PHP extensions which may be dependencies, and aren't included by default. Namely: "php-xml" & "php-mbstring". Regardless I suggest that you install them too (even if they aren't strictly required, they won't hurt). They can be added to the instructions I posted above - at end of the line that includes 'php-gd'. Alternatively, they can be installed separately/after:

apt update
apt install php-xml php-mbstring
systemctl restart apache2
FWIW, my memory is a little vague now, but when I was working on Invoice Ninja v16.0, I was initially intending to install v5. They have been working on v5 for a while which is a full rewrite, however it's still in beta and apparently is not quite feature complete. So I went with v4. The docs for v5 are really good, but the v4 docs are somewhat vague about PHP dependencies (beyond the actual PHP versions supported) and it was hard to find precise info on the required PHP extensions for Invoice Ninja v4.

Anyway, hopefully that fixes it up. Please do not hesitate to post back if you have any further issues/questions.

Lee Chambers's picture

that was indeed the answer thank you for your help Jeremy, Turnkey is fantastic when you know how to use it lol :)

Jeremy Davis's picture

It's definately a bug then, so thanks to you fro reporting it and extra points for confirming the fix! :)

As I noted in my previous reply (and the bug report I've now opened), that it seems likely that there are some other deps missing too. If you haven't already, I suggest that you install them too. If you don't do that now and you hit any other weird issues, then I suggest installing those 2 additional packages as a first step and see if that fixes the issue.

Lee Chambers's picture

As it stands i have only installed the php-gd and spent most of yeasterday experimenting with it all and upto now less the other 2 dependencies, it seems to be working really well, to the point im going to start using this for my personal work, please dont drop this build lol.

Now this maybe quite obvious to some but, if anyone finds themselves struggling setting it up to work with the mobile app follow this guide.

Login to Webmin as root and navigate to Tools>Filemanager.
Expand folders var>www>invoiceninja
Right click on the .env file and choose edit.
Add in at the bottom of the page API_SECRET=password
**Replace password with your secret key of your choice
Click the save disk icon top right of the screen

You will now be able to use the secret you entered in the .env file on the mobile app

The linux gurus will possibly have a much easier way of doing this but as im just getting to grips with linux i found this way quite painless :) 

Jeremy Davis's picture

Thanks for this additional info. Not only will it help others using the current TurnKey Invoice Ninja applaince, but it's something that I'll look to add in to future TurnKey releases.

OZ's picture

The IN team just released V5 out of beta testing. It would be awesome to have V5 here too. Any plan for it?

Jeremy Davis's picture

Firstly, thanks for the heads up. And welcome to TurnKey! :)

So the short answer is "yes, but...". FWIW we do always hope to follow upstream's "latest stable". The pragmatics though mean that isn't always the case (especially with faster moving projects).

The longer answer (with context), is yes but not sure when. With a small team and 100+ appliances on a multitude of platforms, keeping every one on the latest upstream version is a big job! Plus the more time we spend maintaining the current library, the less time/energy for developing other/new features, etc. Every time you say yes to one thing, you are in effect saying no to a million other things. So we need to balance our priories and resources.

We also have the problem of keeping previous versions. Ideally we try to keep as many past releases as we can. But with each release around 500MB (min ~300MB, max 1.2+ GB), a number of different build types and 100+ appliances, the size of all those files adds up. Plus it's not just about our storage costs, it's also about being a good open source citizen. As an open source library, all our mirrors are provided to us gratis so we need to keep them happy! So in that context the less files on the mirror the better.

Despite all that, we are currently doing a refresh of the images. We made some major changes to our custom software in v16.0 and some of the earlier ones includes some buggy packages that we've fixed. Plus as I said above, we do try to keep them as up to date as possible.

Unfortunately though, Invoice Ninja has just been (re)built. Like literally only a few days ago. I still haven't updated the website or announced via the blog (both will hopefully happen today), but the image is already on the mirror. So I'm a bit loathe to rebuild it again so soon, especially when we're only about 1/3 of the way through the library. OTOH, v5.x is a major change/progression so making an update/rebuild to include that certainly has additional weight.

So in the meantime, I've opened an issue on our issue tracker.

Lee Chambers's picture

I did find that using the app it would not load a pdf view of an invoice but cant figure out why, i presume theres somekind of issue just not sure where
Jeremy Davis's picture

Is it sending the PDFs (as attachments) ok? Or is all PDF functionality not working?

At least the PDF attaching functionality (and perhaps viewing too?) is provided via phantomjs (see IN docs). By default Invoice Ninja uses an external service, but in the interests of privacy, we provide a local install of phantomjs instead. Having said that, I'm not sure if that also provides the ability to view PDFs?!

To diagnose what the issue may be, I suggest consulting the log file. IIRC it should be found in /var/www/invoiceninja/storage/logs/laravel-error.log. Please feel free to post here if you want a hand with that.

OZ's picture

Great! thanks for the heads up. I'd love to see a Turnkey of Invoice Ninja V5. I've tried to install it myself many times following a pletora of guides from their github (selfhosted, docker, Ubuntu guide, CentOS guide, etc) I find their docs are messy and the example config files they use are very confusing, misleading and lacking of proper separation (i.e. the mix v4 and v5 config files, commenting and uncommenting were needed). They claim that V5 is a completely different animal, but the install guides are mixed.

Turnkey intances are so neat. I love the structure, order and integrity of it, and I think Turnkey will bring simplicity to the IN install guide chaos.

Jeremy Davis's picture

Thanks for your kind words and I'm glad to hear that TurnKey is bring value for you! :)

So no ETA on a v5.x NI, but hopefully in the not too distant future...

Lee Chambers's picture

Hi Jeremy, Its attaching an sending perfectly fine, i thought it might be the android app at fault but no one seems to have reported the issue. On the app once you have created the invoice or quote you can view it within the app but it doesnt load it, you just get the loading icon forever i think once i got an error message but cant remember what it was i will try and recreate the issue and post back. I did install the missing packages as we discussed a while back but for this issue it made no difference. The upgrade to the new v5 would be most welcomed, being a sole trader is use the turnkey build and apart from this little issue its perfect and just does the job, much better than the simple invoices appliance. Lee
Jeremy Davis's picture

Hmm that is a weird one then!? Have you tried to reproduce the issue from a normal browser too? And/or different browsers? And/or from a desktop? (no need to check them all, but at least checking from one desktop browser would be good).

If you can reproduce it, then the logs would be helpful I'm sure. Ideally if you can explain how I can reproduce the issue myself (ideally via a desktop browser), I'm fairly confident I can develop a fix and/or workaround.

Thanks too for your feedback. I agree that Invoice Ninja is a much better SMB invoicing tool than Simple Invoices was! :)

If you are interested in upgrading to v5.x it should be possible on your current server but as OZ noted, their docs are a bit of a mess ATM. I'm hoping that once they get everything updated and things settle down a bit with v5.x that they will get tidied up.

PS thanks too for the heads up that they have an Android app. I should add a link to that (and the iOS app assuming there is one) to the appliance page!

Lee Chambers's picture

All browsers seem to work just fine, it seems only an issue with the android app, however the very decent part is you can connect the android app to the turnkey appliance and have your own self hosted mobile solution, i will investigate further with the app it could be an android permissions issue but to be able to self host and use it with the mobile app is very useful indeed, im currently looking into the suitecrm appliance now as this will allow me to completely self host everything i need, the self portal using joomla looks interesting but as turnkey doesnt have a joomla appliance i will have to test this via something else. The android app for invoice ninja is easy to setup just follow the guide i posted aa while back for setting the secret key otherwise it will refuse connection to the appliance  Lee
Jeremy Davis's picture

Hmm, yeah if you only experience it in the Android App, that does suggest a bug in the Android app. Although having said that, the Android app uses the API, whereas AFAIK (although could be wrong...) the v4.x web app (accessed via a web browser) doesn't directly interact with the API. If my understanding is correct, then it may still be an issue on the server causing this.

Flutter app (written in Dart) which means that the code base for the web app and the mobile app (and perhaps a desktop app even if they go that way) will actually all be the same codebase!

Re having to set the 'API_SECRET', I have opened an issue regarding that as it should really be auto-generated on firstboot (so you'd still need to check what it is; but you wouldn't need to change it). As I noted on the issue, after having a closer look, I thought that it was, but clearly that isn't the case...

Also, TurnKey does have a Joomla appliance! :)

Add new comment