Page MenuHomePhabricator

Versitygw certificate update doesn't get picked by the service
Open, HighPublic

Description

From 2026-06-12 until 2026-06-24 on codfw and from 2026-05-19 until 2026-06-24 on eqiad, mediabackups stopped being updated with newly uploaded files. Restoration or deletion of files (but not querying) would have failed also due to an expired TLS certificate, due to a missed refresh dependency on puppet code.

Original info:

My guess it is due to some of the following:

  • The puppet code has a bug where refresh of the certificate doesn't trigger an automatic reload (just a mistake due to setup being done in a hurry)
  • A reload is not enough to refresh the presented certificate and it requires a full restart (which will be an issue for ensuring continuous availability)

As automatic certificated renewal is there.

Two actionables are needed:

  1. Monitor freshness of service certificate so it alerts if invalid or expired
  2. Debug and fix the above issue so new certificates are picked right away, with minimal downtime

Event Timeline

Change #1305356 had a related patch set uploaded (by Jcrespo; author: Jcrespo):

[operations/puppet@production] versitygw: Fix service not reloading after certificate change

https://gerrit.wikimedia.org/r/1305356

Apologies @Tgr, that was supposed to add Data-Persistence-Backup not platform.

Change #1305356 merged by Jcrespo:

[operations/puppet@production] versitygw: Fix service not reloading after certificate change

https://gerrit.wikimedia.org/r/1305356

I am going to resolve it because it was a one time mistake, and while monitoring is still needed, we will need a separate ticket and extensive approach to it.

• jcrespo reopened this task as Open.EditedAug 4 2026, 9:16 PM

This happened again- but I caught it quickly this time. Either the reload didn't work (certainly the puppet patch is not enough) or it requires a full service restart, which opens questions on how to do it without causing downtime.

A rolling restart of all daemons made it work again- until next month.

Type=notify-reload seems to be the right way to go about this.

Change #1321123 had a related patch set uploaded (by Jcrespo; author: Jcrespo):

[operations/puppet@production] mediabackups: Update versitygw systemd unit file to SIGHUP on reload

https://gerrit.wikimedia.org/r/1321123

This will break again on Sep 5 12:44:00 2026 GMT.

This will break again on Sep 5 12:44:00 2026 GMT.

That will be in 4 days.

I have tested the HUP, all works as expected:

cwilliams@backup2019 ~ % echo -n | openssl s_client -connect $(hostname -f):9000 | openssl x509 -noout -dates                                                                                                                                                         
Connecting to 10.192.47.6
depth=2 C=US, ST=California, L=San Francisco, O=Wikimedia Foundation, Inc, OU=Cloud Services, CN=Wikimedia_Internal_Root_CA
verify return:1
depth=1 C=US, L=San Francisco, O=Wikimedia Foundation, Inc, OU=SRE Foundations, CN=discovery2026
verify return:1
depth=0 CN=backup2019.codfw.wmnet
verify return:1
DONE
notBefore=Aug 25 12:10:00 2026 GMT
notAfter=Sep 22 12:10:00 2026 GMT

cwilliams@backup2019 ~ % pgrep -f /srv/objectstorage00 | xargs ps -opid,ppid,etime,cmd | tee                 
    PID    PPID     ELAPSED CMD
3438848       1  4-02:24:55 /usr/bin/versitygw --cert /etc/versitygw/ssl/discovery2026__backup2019_codfw_wmnet.chained.pem --key /etc/versitygw/ssl/discovery2026__backup2019_codfw_wmnet-key.pem posix /srv/objectstorage00

cwilliams@backup2019 ~ % sudo pkill -HUP -f /srv/objectstorage00

cwilliams@backup2019 ~ % echo -n | openssl s_client -connect $(hostname -f):9000 | openssl x509 -noout -dates
Connecting to 10.192.47.6
depth=2 C=US, ST=California, L=San Francisco, O=Wikimedia Foundation, Inc, OU=Cloud Services, CN=Wikimedia_Internal_Root_CA
verify return:1
depth=1 C=US, L=San Francisco, O=Wikimedia Foundation, Inc, OU=SRE Foundations, CN=discovery2026
verify return:1
depth=0 CN=backup2019.codfw.wmnet
verify return:1
DONE
notBefore=Sep 11 11:40:00 2026 GMT
notAfter=Oct  9 11:40:00 2026 GMT

cwilliams@backup2019 ~ % sudo journalctl -u versitygw@objectstorage00.service --since "2 minutes ago" --no-pager
Sep 15 13:08:10 backup2019 versitygw[3438848]: caught signal hangup
Sep 15 13:08:10 backup2019 versitygw[3438848]: srv cert reloaded (cert: /etc/versitygw/ssl/discovery2026__backup2019_codfw_wmnet.chained.pem, key: /etc/versitygw/ssl/discovery2026__backup2019_codfw_wmnet-key.pem)

I will update the MR for this/replace it with a new one.

For now, as the certs were already regenerated, I have issued a HUP across all of the instances:

cwilliams@cumin1004 ~ % sudo cumin --batch-size=1 --batch-sleep=5 --mode=sync 'P{O:mediabackup::new_storage}' 'pkill -HUP -f "^/usr/bin/versitygw"'                               
12 hosts will be targeted:
backup[2015-2020].codfw.wmnet,backup[1015-1020].eqiad.wmnet
OK to proceed on 12 hosts? Enter the number of affected hosts to confirm or "q" to quit: 12
===== NO OUTPUT =====                                                                                                                                                                                                                                                  
PASS | 100% (12/12) [01:09<00:00,  5.82s/hosts]
FAIL |  0% (0/12) [01:09<?, ?hosts/s]
100.0% (12/12) success ratio (>= 100.0% threshold) for command #1: 'pkill -HUP -f "^/usr/bin/versitygw"'.
100.0% (12/12) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.

cwilliams@cumin1004 ~ % sudo cumin 'P{O:mediabackup::new_storage}' 'echo -n | openssl s_client -connect $(hostname -f):9000 | openssl x509 -noout -enddate'
....
===== NODE GROUP =====                                                                                                                                                                                                                                                 
(1) backup1018.eqiad.wmnet                                                                                                                                                                                                                                             
----- OUTPUT for command #1: 'echo -n | openss... -noout -enddate' -----                                                                                                                                                                                               
Connecting to 10.64.185.4                                                                                                                                                                                                                                              
depth=2 C=US, ST=California, L=San Francisco, O=Wikimedia Foundation, Inc, OU=Cloud Services, CN=Wikimedia_Internal_Root_CA
verify return:1
depth=1 C=US, L=San Francisco, O=Wikimedia Foundation, Inc, OU=SRE Foundations, CN=discovery2026
verify return:1
depth=0 CN=backup1018.eqiad.wmnet
verify return:1
DONE
notAfter=Oct  9 11:25:00 2026 GMT
================                                                                                                                                                                                                                                                       
PASS | 100% (12/12) [00:01<00:00, 10.66hosts/s]
FAIL |   0% (0/12) [00:01<?, ?hosts/s]
100.0% (12/12) success ratio (>= 100.0% threshold) for command #1: 'echo -n | openss... -noout -enddate'.
100.0% (12/12) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.

Change #1321123 merged by CWilliams:

[operations/puppet@production] mediabackups: Update versitygw systemd unit file to SIGHUP on reload

https://gerrit.wikimedia.org/r/1321123

The MR has been merged with its original intent, to SIGHUP on reload. However, a new MR will be needed to do the correct checks to determine if the content changed, as the File subscription does not relate to the content, merely its permissions, ownership, etc.

Does this need to continue being tracked as an open Wikimedia-Incident ?

@MLechvien-WMF I don't believe so. We have monitoring now, the certificates can be reloaded with systemctl reload, so it is just the automated reload that is missing as that needs so more work.