Skip to main content

Upstream Ceph Cannot Decode RHCS RGW Period

Summary

When switching RGW daemons from a Red Hat Ceph Storage (RHCS) image to an upstream Ceph image, the upstream image may fail to decode the period object stored in .rgw.root. This prevents RGW daemons from starting.

Root Cause

The period object is missing a realm_name field. This field is expected to appear at the very end of the encoded period structure, immediately after the realm_id field. Period objects written by versions of Ceph prior to Luminous or past versions of RHCS might not contain this field.

The RHCS image contains backported fixes that allow it to tolerate the missing field and decode the period correctly. The upstream image does not, and returns the following error when it encounters a period object without realm_name:

error: End of buffer [buffer:2]

Symptoms that can be used to diagnose this problem

The following error messages might indicate a missing realm_name field.

systemd fails

If systemd's unit status reads failed (exit code 5/NOTINSTALLED) and systemd gives up after 5 restart attempts while providing the error code below, then this might indicate a missing realm_name field:

rgw main: ERROR: failed to decode obj from
.rgw.root:periods.1b5ebe13-50af-432f-b9c9-b9577507bd19.4 rgw main: failed to
load current period: (5) Input/output error Couldn't init storage provider
(RADOS)

radosgw-admin commands fail

If radosgw-admin commands fail, this might indicate a missing realm_name field. For example:

$ radosgw-admin period get 

failed to load period: (5) Input/output error
2026-04-21T09:28:03.308+0000 7feb4b221900 0 ERROR: failed to decode obj from
.rgw.root:periods.1b5ebe13-50af-432f-b9c9-b9577507bd19.4

Fix

Rewrite the period object using the RHCS image, which will add the missing field:

radosgw-admin period update --commit

After running this command, confirm that radosgw-admin period get returns a JSON object containing a realm_name field. The upstream image should then be able to decode the period correctly and RGW daemons can be switched to the upstream image.