"Something went wrong..." pdf.invoicing.co is down, but I'm using snappdf?

Hello, as the title says our self-hosted InvoiceNinja server started showing “Something went wrong…” messages across the site. According to the larvel logs, it is due to pdf.invoicing.co being unreachable. Here’s the log entry.

2024-10-02 17:24:49] production.ERROR: file_get_contents(https://pdf.invoicing.co/api/version): Failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway
 {"userId":1,"exception":"[object] (ErrorException(code: 0): file_get_contents(https://pdf.invoicing.co/api/version): Failed to open stream: HTTP request failed! HTTP/1.1 502 Bad Gateway

 at /var/www/html/invoiceninja/app/Http/Controllers/SelfUpdateController.php:187)
[stacktrace]

Oddly, our system doesn’t use PDF_GENERATOR=hosted_ninja in our .env. We have it setup with snappdf. Why are we receiving this error? Thanks.

System
Email: smtp
queue: database
PDF: SnapPDF PDF Generator
Database Connection
passed
PHPweb: 8.2.20
cli: PHP 8.2.20 (cli) (built: Jun 17 2024 13:33:14) (NTS)
Memory: 700M
API: 5.10.24

Glad I’m not the only one. This has started happening for me as well, with the same errors in the log. I’m also using self hosted snappdf, so not relying on an external server for PDF generation.

I am having the same issue using the hosted_ninja pdf generator.

The last two days I’ve been having hecka problems with sending emails and pdf generation.

I do use invoice invoice ninjas pdf generator.

I did a ton of server work - did a fresh install and everything was working fine last night. This morning emails are sending fine but getting internal server errors when generating the pdf.

I’m wondering if this is what’s spiked our MySQL binlogs as well. Do any of you notice, if you check /var/lib/mysql, that you get large binlogs generating? I haven’t pinpointed if InvoiceNinja is the culprit yet, but since a V5 upgrade a few months ago, the binlog sizes have been skyrocketing and will frequently fill the log disk if they’re not purged regularly. Curious if any of you notice the same thing.

This is just today:

104967099 Oct  2 08:59  binlog.001113
104933407 Oct  2 09:54  binlog.001114
104962021 Oct  2 10:48  binlog.001115
104953653 Oct  2 11:43  binlog.001116
  4407674 Oct  2 11:45  binlog.001117

I’ve created one invoice today. The server is essentially idle, so I have no idea what it’s busy logging.

Again, this may all be a red herring, but thought I’d see what you’re experiencing.

Same here. I am experiencing the exact issue (with the same error in the log file) regardless of whether I am using hosted_ninja or snappdf as the pdf generator.

Me too with the same problem [2024-10-02 18:40:53] production.ERROR: Server error: POST https://pdf.invoicing.co/api/ resulted in a 502 Bad Gateway response
im using the self_hosted v5.10.29-C168 PHP 8.2 Memory Limit 1536

Glad i see this post, i’m trying to install invoiceninja on debian 12 , time after time all works well but i get the same error like OP, i’m about to buy the whitelabel license but first wanted to get rid of this error … it is a good thing this is a general issue, not something i do wrong with the setup. hopefully this will be resolved quickly.

I’ve got 4 instances running and have not seen this issue, so it’s rather interesting. I also processed about 8 invoices today without any generation issues.

Based on the vague responses thus far, I don’t think it has anything to do with migrating between versions 4 and 5.

@link470 From everything that I see, your second reply regarding bin logs is unrelated to the original post. If this is causing problems, kindly create a new topic.

To everyone with the problem, are you seeing the error when using one of the apps or the web UI or both?

For everyone that shared your InvoiceNinja, PHP and PDF generator, thanks. Everyone else, can you please share that information?

For those of you using the web UI, do you see any resolution after clearing your browser cache?

Has anyone reported a bug or started a discussion on GitHub?

I’ve got 4 instances running and have not seen this issue, so it’s rather interesting. I also processed about 8 invoices today without any generation issues.

The reason you most likely never saw this was just due to timing. I’m also not getting the issue now, but it’s also because https://pdf.invoicing.co/ is now up again. Earlier today, it was giving a CloudFlare error of the host not being reachable, but it’s now displaying a simple HTML page again.

The odd part, and I agree with the first post, is why is the “something went wrong” text appearing if the URL of pdf.invoicing.co is unavailable, even when not using the hosted PDF generation services? This “something went wrong” message appeared constantly for me earlier, even when not on an invoice editing page. So some code must be regularly calling that URL, and when it can’t reach it, displaying “something went wrong”.

Based on the vague responses thus far, I don’t think it has anything to do with migrating between versions 4 and 5.

I agree; this specific message wasn’t caused by that upgrade, it was caused by the URL pdf.invoicing.co being unavailable. But, code that exists in v5 does cause the “something went wrong” message to appear when pdf.invoicing.co is unavailable, where as I don’t believe this code existed in v4.

From everything that I see, your second reply regarding bin logs is unrelated to the original post.

You’re most likely correct; I just wanted to see if anyone else was experiencing this too and if the binlogs increased in size more when this error was occurring. My binlogs are still increasing at the same rate though, so this specific issue doesn’t seem to have inflated them faster.

This seems fixed now. But the underlying issue remains the same:
•Can InvoiceNinja confirm if there was indeed a problem earlier today with pdf.invoicing.co, and
•Why is a self-hosted installation continuously calling this URL even when a self hosted installation of SnapPDF is being used for PDF generation?

1 Like

Yes, this was an issue a couple of weeks ago as well. I believe that ended up being due to a Cloudflare issue and not the invoicing.co website specifically.

I completely agree. With this and with your point about v.5 pinging their website.

That being said, I’m also likely not seeing it because I have my personal instance buttoned up very tightly, with no ports open and only access it via Wireguard. Two of the other instances are for clients, so I’ll have to ask them. But, haven’t heard any complaints yet.

Got it. No problem. If it persists, please do create a new topic in case other users are experiencing this.

I think it will be hard to argue that the site wasn’t down. It’s likely more a matter of whether the outage was due to a Cloudflare issue or an InvoiceNinja issue. After seeing this earlier, I did a ping test and dig and both clearly showed the site as down.

Very good question. I hope there’s an answer and likely there is. I’m not a developer, just a moderator here, so I’m just as curious as you.

1 Like

I’m also likely not seeing it because I have my personal instance buttoned up very tightly, with no ports open and only access it via Wireguard

That’s actually very interesting; I would have thought that InvoiceNinja would always be displaying the error for you then in that case, since your instance of InvoiceNinja wouldn’t be able to reach out to the internet, and therefore, wouldn’t be able to see pdf.invoicing.co. Or maybe I’m not understanding your setup correctly?

My instance is working again now that https://pdf.invoicing.co/ is reachable again. Previously, I experienced a Cloudflare 502 error when I tried accessing it.

Agreed, I have the same question too. I would not have known it if this issue had not occurred.

HI , i can confirm even now when the website https://pdf.invoicing.co/ is responding, i still receive the error. also scrolling trough the replys i can confirm this happens in a fresh install of v5 (latest) , no migration. i followed tutorials on howto install the application (this is now with apache2, PHP8.3 and the invoiceninja version is v5.10.29. i’m using the default first created account in the webgui , haven’t tried the Apps yet. i’m also having a working LE certifcate. if i need to post logs or anything that helps please point me in the right direction. thanks

I’m almost positive your issue is different than the one being discussed here. I’d start a new post to have the best chance of receiving support.

1 Like

There was an issues earlier impacting the server, this has since resolved.

2 Likes

Thank you all for posting here. The temporary issue with Cloudflare was the source of my problem from the original post. Now that Cloudflare is not being problematic, the visible warning in the WebUI has gone away.

That being said, for those of us relying on local PDF generation, we should not be receiving a warning when pdf.invoicing.co is not available. When I get a free moment, I will look to see if a bug has been filed. If not, I will create one and link it to this thread.

Updated 10/3/24
Link to bug ticket: InvoiceNinja commicates with pdf.invoicing.co despite being configured for local PDF generation · Issue #10074 · invoiceninja/invoiceninja · GitHub

Hi, good to hear it works for you now the url is online again, sadly i still receive the message at every page even now when i can reach the URL, not sure if it is related although. i just tested the app on my phone and there the message is not presenting itself. not really sure what i can do to get this resolved. do i start a new post ? the only two thing i did not do is set up email provider , and buy the license, both of these was something i was about to set up after i knew invoiceninja is working like it should.
Regards

Yes, the cause of your issue sounds different than the one being discussed here.

2 Likes

I appreciate the point you make and understand where you’re coming from. I would have thought something similarly. I’ve used my main instance off and on for the past two days and I’ve yet to see this specific error

I was also trying some things on my test instance due to a client inquiry and didn’t notice any problems there either. And that one is open enough for clients to test.

@david Can you confirm whether or not self hosted instances are pinging involving.co? If so, what role or purpose does this serve? And if so, how can users opt out of this? I would suspect this is not compliant with GDPR, if this is true and users cannot opt out. Not to mention, I believe there are now at least 4 states in the US where similar type regulation has been implemented.