SOS report
Warning: always review the collected data before sharing it! The generated archive may contain data considered sensitive and its content should be reviewed by the originating organization before being passed to any third party.
Summary
Charmed PostgreSQL shipped with built-in SOS reporting tool. The SOS is an extensible, portable, support data collection tool primarily aimed at Linux distributions and other UNIX-like operating systems.
Using built-in sos (recommended)
Collecting logs on one unit:
To generate the troubleshooting report archiving all logs simply call sos report
(inside Juju unit):
juju ssh postgresql/0
> sudo sos report -o system,systemd,snap,charmed_postgresql --low-priority
As a result the archive will all logs will be generated and can be shared with your support representative:
...
Your sos report has been generated and saved in:
/tmp/sosreport-juju-d4c067-1-2025-04-07-chdmwlz.tar.xz
Size 216.36KiB
Owner root
sha256 b3bf2c54bb3d934ca61ab2a17c19e98b2abeafd45589f268b62bd02f6b2a4c5f
...
Use juju scp
to copy logs from Juju unit to localhost:
juju scp postgresql/0:/tmp/sosreport-juju-d4c067-1-2025-04-07-chdmwlz.tar.xz .
The full output as an example:
Summary
juju ssh postgresql/0
> ubuntu@juju-d4c067-1:~$ sudo sos report -o system,systemd,snap,charmed_postgresql --low-priority
sos report (version 4.8.2)
This command will collect system configuration and diagnostic
information from this Ubuntu system.
For more information on Canonical visit:
Community Website : https://www.ubuntu.com/
Commercial Support : https://www.canonical.com
The generated archive may contain data considered sensitive and its
content should be reviewed by the originating organization before being
passed to any third party.
No changes will be made to system configuration.
Press ENTER to continue, or CTRL-C to quit.
Optionally, please enter the case id that you are generating this report for []:
Setting up archive ...
Setting up plugins ...
Running plugins. Please wait ...
Starting 4/4 systemd [Running: charmed_postgresql system snap systemd]
Finishing plugins [Running: charmed_postgresql]
Finished running plugins
Creating compressed archive...
Your sos report has been generated and saved in:
/tmp/sosreport-juju-d4c067-1-2025-04-07-qntyqpz.tar.xz
Size 285.60KiB
Owner root
sha256 d318d7de7595ebae1bce093a375129fafbd397c297317de3006fbfe45e93d43d
Please send this file to your support representative.
ubuntu@juju-d4c067-1:~$ exit
juju scp postgresql/0:/tmp/sosreport-juju-d4c067-1-2025-04-07-qntyqpz.tar.xz .
Collecting logs from several units:
Note: execute the following command from outside the Juju units.
The sos tool allows you to collect logs from several Juju units (replace <UNIT_A/B/…> labels with proper Juju unit like postgresql/0
):
sos collect --cluster-type juju --no-local -c "juju.units=<UNIT_A>,<UNIT_B>,<...>" --batch -o system,systemd,snap,charmed_postgresql --low-priority
Using the latest sos plugins from Git
The latest version of sos plugins can be retrieved from Git easily:
git clone https://github.com/sosreport/sos.git
cd sos
sudo ./bin/sos report -a
The output will be the same to the example above providing archive with all logs as above:
Your sos report has been generated and saved in:
/tmp/sosreport-juju-d4c067-1-2025-04-07-egosqmi.tar.xz