502 Bad Gateway on saving invoice with >2 rows

Sorry for what seems like a duplicate - I have searched and found similar posts but no answers seem to apply. Just installed 1.4.6 - when adding 3 items to an invoice, I get a hang with the spinning gear - my Chrome dev tools say 502 from /invoices/ajax/save

Tried to debug it, but then tried the demo at https://demo.invoiceplane.com/ and found I got the same error there - it hangs saving any invoice with >= 3 items. Sometimes it may work the first time you click Save; but then hang on the second. This is on both IE and Chrome.

Can anyone else reproduce/confirm this on the demo site?

This is very weird…
I can add and save up to 20 different items on my local machine but I can’t imagine why the app should return a 502…

Did you downloaded InvoicePlane 1.4.6 from the website?

Will investigate tomorrow.

I solved this by adding the following directives to the nginx configuration:

fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;

The 502 Bad Gateway error were caused by the following error:

748#0: *639014 upstream sent too big header while reading response header from upstream

Many thanks for the reply - I did see some similar replies in previous threads and tried it on my server (using 1.4.6 downloaded from the site) but no luck yet.

Did you apply those changes on your own demo server? I feel I am missing something obvious but I am still seeing this problem on demo.invoiceplane.com. I’ve tried it on different computers and different OS with the same result…

Update - I resolved this at my end following the nginx config changes from this thread: [Solved] Random 502 errors when using nginx

Apologies for missing that earlier - I had tried but am not well-up on nginx so must have missed something first time I tried!

Don’t quite understand why it is an issue - I have other ajax-heavy apps on this server - but IP now running nicely, thank you :slight_smile:

But as above, FYI I still see this on your demo server?

Thanks for the info, forgot to change the settings.

I don’t understand it too. But I try to resolve this issue as it may cause problems with shared-hosting providers…