Collecting synchronization logs

Jolla Care -

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!

 

1. PREPARE FOR COLLECTING JOURNAL

To collect logs, follow these steps:

Enable the developer mode on your device.

Open an SSH terminal to your device (SSH Ubuntu, SSH Windows), and make a copy of the journal configuration file:

devel-su
cd /etc/systemd
cp journald.conf journald.conf.original

Next, edit file journald.conf and make the following changes (see below) to it. These changes are to ensure that 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.

  1. Stop the sync daemon so that it can later be restarted with extra logging enabled, via (as a normal user, nemo)
    systemctl --user stop msyncd
    killall msyncd    # this may yield "no such process" - just ignore it.
  2. Start the sync daemon with extra debug logging enabled, via
    devel-su -p
    MSYNCD_LOGGING_LEVEL=8 msyncd 2>&1 | cat > /home/nemo/msyncd.log
  3. 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.
  4. Wait for 30 seconds or until the sync cycle has completed. The logs collected from the msyncd terminal were saved to the following file msyncd.log.
  5. Go to chapter 5 and collect the journal log.

 

 

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 > /home/nemo/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 still more verbose by editing certain configuration files and rebooting the device before debugging. The file below is for the configuration of Exchange ActiveSync plugin.

 /home/nemo/.config/eas-sailfish.conf

You may want to save the original file first, so it it is easy to revert it after the debugging session:

devel-su 
cd /home/nemo/.config
cp eas-sailfish.conf eas-sailfish.conf.original

For example, to make the Exchange ActiveSync plugin fully verbose, first ensure that journald won't throttle logging output (see the notes on editing /etc/systemd/journald.conf in chapter 1 above) and then ensure that the /home/nemo/.config/eas-sailfish.conf file contains the following:

On Sailfish OS version 3.0.2 and newer:
[logging]
Sailfish.eas=d
Sailfish.easnetwork=d
Sailfish.easwbxml=d
Sailfish.logfile=/home/nemo/eas.log

Earlier OS versions:
[logging]
Sailfish.eas.debug=dwc
Sailfish.eas.error=dwc
Sailfish.eas.warning=dwc
Sailfish.easnetwork=dwc
Sailfish.easwbxml=dwc
Sailfish.logfile=/home/nemo/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 > /home/nemo/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 the 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 > /home/nemo/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/nemo/.config 
cp  eas-sailfish.conf.original eas-sailfish.conf
## let it overwrite
reboot
Have more questions? Submit a request
Powered by Zendesk