Zulip Maintenance: Difference between revisions

From Hackers & Designers
(Created page with "{{Article |MainNavigation=No }}")
 
(Add debug notes)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Article
Some rough notes on running Zulip:
 
* it requires to run on its own VPS, eg it does not like if you setup other web services (with Nginx) on the same machine
* it needs something slightly more than a basic small VPS, as it runs Python and needs enough CPU and disk space to run decently
* in my experience (maybe due to having left-overs of other web services setup on the same machine, see first point), after each upgrade the HTTPS certificate would break
 
Given this, the installation instruction are quite clear https://zulip.readthedocs.io/en/stable/production/install.html.
 
=== Upgrading ===
Refer to the [https://zulip.readthedocs.io/en/stable/production/upgrade-or-modify.html#upgrading-to-a-release official docs]. We're not running Zulip inside Docker or patching Zulip, so the default instructions can be followed as-is.
 
Steps:
 
* SSH-login to the VPS
* download the latest version of Zulip: <code>curl -fLO <nowiki>https://download.zulip.com/server/zulip-server-latest.tar.gz</nowiki></code>
* run this command: <code>sudo /home/zulip/deployments/current/scripts/upgrade-zulip zulip-server-latest.tar.gz</code>
* wait for the upgrade to take place and note if any errors is being reported during the process; during this time Zulip will be offline for a few minutes only (hopefully)
* as I'm not sure if the HTTPS problem still happens after a Zulip upgrade, but I remove any left-over of Nginx from the system except Zulip's own files, I'll upgrade this entry after the next upgrade!
 
Please check [https://zulip.readthedocs.io/en/stable/production/install.html#troubleshooting this Troubleshooting section] in case of problems (how to look up logs, debug, etc).
 
=== Startup ===
In the case the VPS is being shut down and booted up again, Zulip might have some problems. At last, we figured Zulip's Nginx was clashing with a leftover instance of Apache — both instructed to restart on startup time and both trying to connect to port 80 (Nginx lost).
 
To debug this, first check what's Zulip status:<syntaxhighlight lang="shell">
supervisorctl status
</syntaxhighlight>Then try to restart Django / and or "everything":<syntaxhighlight lang="shell">
supervisorctl restart zulip-django
 
supervisorctl restart all
</syntaxhighlight>In case nothing is still working, check Nginx status:<syntaxhighlight lang="shell">
systemctl status nginx
</syntaxhighlight>If you get something like below, it could be Apache2 is still lingering around:<syntaxhighlight lang="shell">
dev.hackersanddesigners.nl nginx[3214]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
dev.hackersanddesigners.nl nginx[3214]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
 
</syntaxhighlight>Check what's running on port 80 and stop it:<syntaxhighlight lang="shell">
netstat -plant | grep 80
 
systemctl stop apache2
 
</syntaxhighlight>Start back Nginx and Zulip should be running fine afterwards:<syntaxhighlight lang="shell">
systemctl start nginx
</syntaxhighlight>{{Article
|MainNavigation=No
|MainNavigation=No
}}
}}
[[Category:Maintenance]]

Latest revision as of 21:28, 7 April 2023

Some rough notes on running Zulip:

  • it requires to run on its own VPS, eg it does not like if you setup other web services (with Nginx) on the same machine
  • it needs something slightly more than a basic small VPS, as it runs Python and needs enough CPU and disk space to run decently
  • in my experience (maybe due to having left-overs of other web services setup on the same machine, see first point), after each upgrade the HTTPS certificate would break

Given this, the installation instruction are quite clear https://zulip.readthedocs.io/en/stable/production/install.html.

Upgrading

Refer to the official docs. We're not running Zulip inside Docker or patching Zulip, so the default instructions can be followed as-is.

Steps:

  • SSH-login to the VPS
  • download the latest version of Zulip: curl -fLO https://download.zulip.com/server/zulip-server-latest.tar.gz
  • run this command: sudo /home/zulip/deployments/current/scripts/upgrade-zulip zulip-server-latest.tar.gz
  • wait for the upgrade to take place and note if any errors is being reported during the process; during this time Zulip will be offline for a few minutes only (hopefully)
  • as I'm not sure if the HTTPS problem still happens after a Zulip upgrade, but I remove any left-over of Nginx from the system except Zulip's own files, I'll upgrade this entry after the next upgrade!

Please check this Troubleshooting section in case of problems (how to look up logs, debug, etc).

Startup

In the case the VPS is being shut down and booted up again, Zulip might have some problems. At last, we figured Zulip's Nginx was clashing with a leftover instance of Apache — both instructed to restart on startup time and both trying to connect to port 80 (Nginx lost).

To debug this, first check what's Zulip status:

supervisorctl status

Then try to restart Django / and or "everything":

supervisorctl restart zulip-django

supervisorctl restart all

In case nothing is still working, check Nginx status:

systemctl status nginx

If you get something like below, it could be Apache2 is still lingering around:

dev.hackersanddesigners.nl nginx[3214]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
dev.hackersanddesigners.nl nginx[3214]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

Check what's running on port 80 and stop it:

netstat -plant | grep 80

systemctl stop apache2

Start back Nginx and Zulip should be running fine afterwards:

systemctl start nginx
MainNavigation No