DigialOcean Server Timeout?

So I’ve managed to get my server upgraded and running, but for some reason the server keeps timing out on me. I was just wondering if this was normal or if there was a way to extend the run time. It usually times out within a few hours.

What size droplet are you read running I use one up from the smallest and have not issue, I am about to take it back to the smallest and see if that affects anything

I’m running it on 1G of RAM droplet ($10 a month). I did a shutdown through the command yesterday. Now, once I ‘kegbot runserver’ it only stays connected for a few hours before shooting me to the 502 internal server error - at which point I have to ssh and runserver again. It seems to be giving me a broken pipe error

I am running the smallest droplet size and since setting it up last week have not had any issues? Have not rebooted once.

“Kegbot runserver” is not part of the production install. That’s just for testing. The docs should be pretty clear on this, LMK where I can fix them.

I’m on the road but someone else can probably chime in and help.

So when I first installed kegbot using the instructions from “Digital Ocean Install Instructions”, The server started up with no problem. The server was never down and I never had to run “kegbot runserver” to boot it.

Now in order to get the 1.2.1 update,I ran:
su - kegbot
. kegbot-server.venv/bin/activate
pip install --upgrade kegbot
kegbot upgrade

I then updated supervisor.conf to match the command:
[group:kegbot]
programs=gunicorn,workers
[program:gunicorn]
command=/data/kegbot/kb/bin/gunicorn pykeg.web.wsgi:application -w 3
directory=/data/kegbot
user=ubuntu
autostart=true
autorestart=true
redirect_stderr=true
[program:workers]
command=/data/kegbot/kb/bin/kegbot run_workers
directory=/data/kegbot
stopasgroup=true
user=ubuntu
autostart=true
autorestart=true
redirect_stderr=true

Once I got that done, I ran the following from root@kegbot:
sudo shutdown -r now

I tried connecting to my server, at which point I got a “502 Bad Gateway” error.
As a result I now have to:
ssh in
su - kegbot
. kegbot-server.venv/bin/activate
kegbot runserver

I have to do this about once an hour to keep the server from timing out - like said, I didn’t have this problem before the upgraded and other than the server timing out, the upgrade works great.

Also, If I close out my Terminal, It shuts the server down and throws the 502 error back at me.

You need to alter the kegbot.conf, not the supervisor.conf
(Located in /etc/supervisor/conf.d/kegbot.conf)

Leave the supervisor.conf as is when you install the server. Also I not sure if spaces matter in the conf file but mine looks like this:
[group:kegbot]
programs=gunicorn,workers

[program:gunicorn]
command=/data/kegbot/kb/bin/gunicorn pykeg.web.wsgi:application -w 3
directory=/data/kegbot
user=ubuntu
autostart=true
autorestart=true
redirect_stderr=true

[program:workers]
command=/data/kegbot/kb/bin/kegbot run_workers
directory=/data/kegbot
stopasgroup=true
user=ubuntu
autostart=true
autorestart=true
redirect_stderr=true

Hope that helps

Hey, I cant thank you enough for the help! Oh and sorry for the confusion, It was the kegbot.conf that I altered, not the supervisor. I used the following command:

nano /etc/supervisor/conf.d/kegbot.conf

Once in, I deleted what was there and replaced it with the new.

Also tried:

sudo supervisorctl start kegbot: gunicorn

sudo supervisorctl start kegbot: workers

Both required a “password” for kegbot - No idea what it might be.
I’m kind of just shooting in the dark so I have no idea if the above commands would even help.

Think I may of fixed the problem. I ran the following command:

gunicorn pykeg.web.wsgi:application pykeg

Not quite sure what it did but the sever seems to working properly.

Appreciate all the help!!!

Good to hear its working! And just an FYI this is a reply from mikey from another thread…

Hi @joshuawhite5522 ,

Sorry for the confusion. The kegbot user doesn’t have a password.

You should run kegberry upgrade as the default login user (root on Digital Ocean). The command handles running sudo when necessary – which root can do, but kegbot cannot.
Hope that makes sense. I’ll try to make this a little less painful in future revisions…