Sources:
Chris A.
https://sailfishos.org/wiki/CalDAV_and_CardDAV_Community_Contributions#Sync_Logs
https://sailfishos.org/wiki/Sailfish_OS_Cheat_Sheet#Diagnostics
This article contains instructions for collecting logs from various sync processes, be it Google, EAS, Dropbox or anything.
Using the tools below requires that Linux is familiar to you and that you are confident in working with the command line. Do not continue if you feel unsure!
NOTE: On some phones with a long Sailfish OS update history, the primary user of the phone might still be 'nemo' instead of 'defaultuser' - take that into account in the commands below.
1. PREPARE FOR COLLECTING JOURNAL
The journal collects a lot of events when synchronization is set to a debugging mode. We need to prepare to be able to catch all of the events.
Enable the developer mode on your device.
Open an SSH terminal to your device (SSH instructions), and make a copy of the journal configuration file:
devel-su cd /etc/systemd cp journald.conf journald.conf.original
Next, edit the file journald.conf
and make the following changes (see below) to it. These changes are to ensure that the journal is persistent over device reboots and that logs don't get truncated. If those values are different, or if those keys are commented out (prefixed by hash or semi-colon), edit the file "as root" (with super-user rights). If needed, read more about the available text editors.
Storage=persistent
RateLimitBurst=9999 RateLimitInterval=5s
Save the file, and then reboot your device and open an SSH terminal to it again once it has booted.
NOTE: We will revert this configuration to its original status in chapter 7 below.
2. BASIC SYNC LOGS
Preparations: do as instructed in chapter 1 above.
Here we prepare your device for collecting the actual sync logs. Note that rebooting the device will bring it back to its normal state. Hence the settings below are in effect till the next reboot only.
- Stop the sync daemon so that it can later be restarted with extra logging enabled, via (as a normal user, 'defaultuser' or 'nemo')
systemctl --user stop msyncd killall msyncd # this may yield "no such process" - just ignore it.
- Start the sync daemon with extra debug logging enabled, via
devel-su
MSYNCD_LOGGING_LEVEL=8 msyncd 2>&1 | cat > msyncd.log - Trigger a sync cycle by opening up "Settings > Accounts". Then long-press either the account you want to debug. Tap Sync in the pop-up menu.
- Wait for 30 seconds or until the sync cycle has completed. The logs collected from the msyncd terminal were saved to file msyncd.log.
- Use <ctrl>C to stop the previous command.
- Go to chapter 5 and collect the journal log. Then proceed to 6 and 7.
3. MORE DETAILED LOGS ON CONTACT SYNC
Preparations: do as instructed in chapter 1 above.
The level of debugging enabled in step 2 of chapter 2 does not make the system print out too much data on contact sync. If there is a need to get deeper insight to the issues in contact sync then consider using the following setup
(make sure that you copy the whole long command):
devel-su -p QTCONTACTS_SQLITE_TRACE=1 MSYNCD_LOGGING_LEVEL=8 msyncd 2>&1 | cat > msyncd.log
Hence follow the instructions of chapter 2 otherwise but replace step 2 with these commands.
Go to chapter 5 and collect the journal log.
4. DETAILED EAS LOGS
PREPARATIONS: do as instructed in chapter 1 above.
Some processes can be made more verbose by editing certain configuration files and rebooting the device before debugging. The file below is for the configuration of the Exchange ActiveSync plugin.
/home/defaultuser/.config/eas-sailfish.conf
You may want to save the original file first, so it is easy to revert it after the debugging session:
devel-su
cd /home/defaultuser/.config
cp eas-sailfish.conf eas-sailfish.conf.original
Before we can make the Exchange ActiveSync plugin fully verbose ensure that journald won't throttle logging output (see the notes on editing /etc/systemd/journald.conf in chapter 1 above).
Next, ensure that the /home/defaultuser/.config/eas-sailfish.conf
file contains the following extra lines (it works on Sailfish OS generations 3 and 4):
[logging] Sailfish.eas=d Sailfish.easnetwork=d Sailfish.easwbxml=d Sailfish.logfile=eas.log
Save the file, and then reboot your device and open an SSH terminal to it again once it has booted.
Next, start the sync daemon with extra debug logging enabled by setting the following environment variable for EAS. Type the lines below in Terminal:
systemctl --user stop msyncd
killall msyncd
MSYNCD_LOGGING_LEVEL=8 msyncd 2>&1 | cat > msyncd.log
The preparations are done.
Trigger a sync cycle by opening up page "Settings > Accounts". Then, long-press the account you want to debug. Tap Sync in the pop-up menu. Wait for 30 seconds or until the sync cycle has completed.
5. COLLECT THE JOURNAL LOG
Now that you have done the sync debugging, it is time to collect the generic log, i.e. the journal:
Saving logs is always useful - here it goes to a file:
devel-su journalctl -a -b > journal-sync.txt
6. SENDING LOGS
You should now have the following log files:
- eas.log
- msyncd.log
- journal-sync.txt
These files can be sent to Jolla customer service.
PLEASE NOTE:
The log files probably contain personal information from you. We will not share them in public but simply look for technical issues in them by a chief engineer in Jolla R&D. If you are in doubt, glance through the files or do not send them at all.
7. REVERTING THE DEVICE TO ORIGINAL CONFIGURATIONS
devel-su
cd /etc/systemd
cp journald.conf.original journald.conf
## let it overwrite
reboot
If you did as instructed in chapter 4, then do this as well:
Once done, revert to the original configuration to avoid log data piling up:
cd /home/defaultuser/.config cp eas-sailfish.conf.original eas-sailfish.conf
## let it overwrite reboot