03-05-2021, 10:02 PM | #1 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
502 Bad Gateway errors on nginx server
I now have Calibre Content Server running with nginx as a virtual host, which has received a SSL certificate from Certbot for security's sake. They all run on Ubuntu 20.04 on a VPS. And I also set up a startup service that runs Calibre:
Code:
/opt/calibre/calibre-server /home/ubuntu/Calibre --enable-local-write --enable-auth --auth-mode "basic" --ban-after 5 --ban-for 5 --log /home/ubuntu/log/calibre.log Code:
[error] 641#641: *1773 connect() failed (111: Connection refused) while connecting to upstream ... Any idea why this might happen? Is there anything I can do to fix this? |
03-05-2021, 10:22 PM | #2 |
creator of calibre
Posts: 44,419
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You sure there is nothing in the calibre server logs? Does it happen after doing a particular type of activity?
|
Advert | |
|
03-06-2021, 02:25 AM | #3 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
Yes, nothing on calibre.log other than the normal:
Code:
calibre server listening on 0.0.0.0:8080 OPDS feeds advertised via BonJour at: .... |
03-06-2021, 05:15 AM | #4 |
creator of calibre
Posts: 44,419
Karma: 24044628
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Without anything in the logs I cant really help you. Other than to suggest that you make sure you are running the official calibre binaries and not the distro packaed version of calibre.
|
03-06-2021, 08:17 AM | #5 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
Understood. And yes, I am using the official binaries. Will try to get more info if I can.
|
Advert | |
|
03-31-2021, 03:21 AM | #6 |
Enthusiast
Posts: 42
Karma: 10
Join Date: Oct 2020
Device: MacBook, iPhone, Kindle Paperwhite
|
I think I figured out what went wrong.
So my VPS instance has only 512 MBs of RAM. Although all it does is running Calibre Content Server on nginx, it still runs out of memory through time. And when the memory runs out on a Linux machine, something named Out of Memory (OOM) killer is triggered and kills Calibre, which results in nginx not being able to connect to the backend so finally "502 Bad Gateway". I added 1GB of swap memory to my instance, and Calibre has not been killed since then. |
Tags |
calibre, content server, nginx |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any suggestions? Intermittant problems with Content Server/NGINX | haertig | Calibre | 4 | 02-28-2018 12:50 AM |
Calibre device and server errors | wn1ytw | Devices | 9 | 10-25-2013 08:24 AM |
Excited! But errors for headless server. | apiontek | Devices | 3 | 08-25-2013 04:07 PM |
0.9.36 related server errors | khahoon | Calibre | 0 | 06-26-2013 03:26 PM |
Stand alone server - Chrome errors | robin58 | Calibre | 7 | 02-19-2013 11:29 PM |