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.

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...

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!

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! :)

Jeremy Davis's picture

Apologies in advance for cross posting to similar threads (were some of you are probably subscribed to both).

As I just posted over on another Invoice Ninja thread v17.1 Invoice Ninja ISO (and TurnKey Hub and LXC on Proxmox) - with Invoice Ninja v5.5.23 - is now available.

Please check my post on the other thread for more detail and/or download the ISO from the Invoice Ninja appliance page.

Please feel free to post any feedback you have.

Hi All

After creating the container in proxmox and assigning a VLAN and IP, I'm having difficulty accessing Invoice Ninja.

I've logged in through the VM console as root and set the passwords up and timezone etc but I cannot go any further.

When I go to the assigned IP Address, I receive a 403 message from nginx on http and with https after accepting the Self Signed Cert.

403 Forbidden


nginx

Nor can I login to Adminer on port 12322

BUT I can login to the webmin console on port 12321 as well as the terminal on 12320

Curious.

Anyone tried installing this as an LXC and are able to get into InvoiceNinja V17.1.1??

Any hints where I'm going wrong?

Thx

Jay

 

Lee Chambers's picture

I had the exact same issue last night except i use xcp-ng

Dont use a template for your vm the relates to the debian version buster as it seems to fail the webserver installation , use other linux 64bit.

Reinstalling the appliance fixed it for me installing with default settings then changing the ip address to static via the config console it appears the webserver fails to start after install .. why i dont know 

Also the grub loader install is rather annoying as it wants to install it to dev/mapper which doesnt exist choosing dev/xvda option fails aswell but manually typing dev/xvda works..

Never had issues installing grub on the old appliances but this 17 version seems a bit bugged 

Jeremy Davis's picture

Sorry to hear of your frustrations with this one.

Please read the other post I just posted here (in direct response to Jays) for an explanation of the cause of the issue, and the fix (remove Nginx).

Even though it appears to be working ok for you, my guess is that it will eventually cause issues at a future reboot. So I urge you to apply the fix I note.

Re the Grub install, most of the di- live (our installer) components come from d-i (Debian Installer). FWIW, the default install uses LVM, which will create a logical volume called "turnkey-root" (which will be /dev/mapper/turnkey-root), although it shouldn't try to install grub there (it should install grub to the actual device, usually /dev/sda). So that's somewhat new to me. The issue you refer to (having to manually enter /dev/xvda rather than selecting the existing /dev/xvda option) has only been reported with VMware products. Although in my experience, /dev/xvda is usually a Xen device, right?

Eric P's picture

Ditto here --- it was working as late as last week, but when I tried again this morning, it failed.  I suspect a recent update is related, but I'm not sure which one off hand...   Looking forward to a resolution!  
Jeremy Davis's picture

Hi Eric. Sorry to hear of your frustrating times...

As I noted in my other post, the Invoice Ninja appliance includes Nginx as well as Apache and they fight... I reckon that Apache has been winning, but today Nginx won!

Good luck with it.

Jeremy Davis's picture

Thanks for reporting the issue Jays. I've opened an issue on our tracker so it doesn't get forgotten.

As glad as I am that you reported it, now that I know the cause, I'm a little frustrated and annoyed that this slipped through! Argh!

It turns out that the updated Invoice Ninja appliance has both Apache and Nginx installed... *sigh*. Removing Nginx resolves that "403" issue. I.e.

apt purge --autoremove nginx nginx-common

Note that will remove about 10 packages (except for 'libgeoip1', they should all start with 'nginx..' or 'libnginx...'). Once removal is complete, restart Apache:

systemctl restart apache2

And now things should be working...


FWIW, part of the cause of that occurring is that NodeJS is now required for Invoice Ninja v5.x. Another part is that since we added NodeJS based apps to our library, they have used Nginx (as a reverse proxy for NodeJS server). However, now in 2022 NodeJS has become a common component of lots of software stacks - even ones based on our LAMP appliance. So the proper fix will be to remove Nginx from the NodeJS plan and explicitly add Nginx to their relevant plans.

Apache and Nginx don't necessarily conflict with one another. However, by default only a single application can listen on any particular port. So with default config, both Apache and Nginx are trying to use ports 80 & 443 (vanilla HTTP & HTTPS respectively). Whichever starts first wins and the other will fail. It turns out that in the scenarios we used during build and testing (including my final ISO test), Apache starts first and Nginx fails. However as we weren't expecting Nginx, we never noticed. For whatever reason, in an LXC container it appears that Nginx wins more often - hence you discovering the issue and me being able to reproduce it so easily...

I'm not 100% sure when we'll do a fixed re-release, but I intend to apply the fix to the codebase shortly.

Thanks, Jeremy.

Issue resolved.

Until next time ...  

;-)

Jay

Add new comment