Office365/Exchange Account Stops Working After Re-boot

Normally restarting the EAS service would do the trick for me in the past, but now the service ends up in a failed state.

[nemo@XperiaXA2 ~]$ systemctl --user status sailfish-eas
● sailfish-eas.service - sailfish-eas daemon
   Loaded: loaded (/usr/lib/systemd/user/sailfish-eas.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2023-02-21 19:13:58 CET; 25min ago
  Process: 16053 ExecStart=/usr/bin/invoker -o --type=qt5 --global-syms /usr/bin/sailfish-eas (code=exited, stat
us=1/FAILURE)
 Main PID: 16053 (code=exited, status=1/FAILURE)

Looks like the process being started by the service fails to run correctly and is exited. When checking all services that are failed only sailfish-eas pops up.

Continuing my investigation. When I run the sailfish-eas command as user I get the following output.

[nemo@XperiaXA2 ~]$ sailfish-eas

** (process:21311): WARNING **: 19:56:51.787: Cannot create directory: /home/nemo/.local/share/system/privileged/Accounts/libaccounts-glib

** (process:21311): WARNING **: 19:56:51.788: Error opening accounts DB: unable to open database file

** (process:21311): WARNING **: 19:56:51.789: Cannot create directory: /home/nemo/.local/share/system/privileged/Accounts/libaccounts-glib

** (process:21311): WARNING **: 19:56:51.789: Error opening accounts DB: unable to open database file

** (process:21311): CRITICAL **: 19:56:51.792: ag_manager_list_enabled: assertion 'AG_IS_MANAGER (manager)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.044: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.044: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.044: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.044: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.045: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.045: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.045: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.045: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.045: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.045: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.045: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.045: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.045: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.045: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.046: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-WARNING **: 19:56:57.046: invalid (NULL) pointer instance

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.046: g_signal_handlers_disconnect_matched: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed

(process:21311): GLib-GObject-CRITICAL **: 19:56:57.046: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

The first lines indicate to a permission problem. The NULL pointer problems after that could be causes by the missing database access. The directory exists, but is not accessible for the user. The directory /home/nemo/.local/share/system/privileged is not accessible by the user.

[root@XperiaXA2 system]# ls -l
total 8
drwxr-xr-x    4 nemo     privileg      4096 Apr 27  2020 Contacts
drwxrwx---   19 privileg privileg      4096 Feb 10 22:59 privileged

Most of the directories inside privileged are owned by nemo and are part of group privileged. BTW nemo is not part of the group privileged. user sailfish-mdm is the only one part of group privileged, besides the user privileged. And sailfish-mdm is probably linked to the MDM (Mobile device management) Framework. Hopefully someone has some pointers were the look next.

Found something else. There is a typo in sailfish-eas.service

[root@XperiaXA2 user]# cat sailfish-eas.service
[Unit]
Description=sailfish-eas daemon
Requires=sailfish-eas-accounts-check.service
Requires=booster-qt5.service
Wants=messageserver5.service
After=sailfish-eas-accounts-accounts-check.service
After=messageserver5.service
After=booster-qt5.service

[Service]
Type=dbus
BusName=org.sailfishos.easdaemon
ExecStart=/usr/bin/invoker -o --type=qt5 --global-syms /usr/bin/sailfish-eas
Restart=on-failure
RestartSec=1

[Install]
WantedBy=user-session.target

After=sailfish-eas-accounts-accounts-check.service. Is there an editor in Sailfish OS I can use to change the file?

Editor found. Vi is installed on the system. Correcting the service file did not solve the problem.

I was on the wrong path. It had nothing to do with the ownership of the privileged directory.

When I removed or disabled all the exchange accounts on my device (I have two) and restart the device, the service would not fail and I could add an exchange account without problems. Reactivating an disabled account would crash the service and none of the account would work any more. So, I needed to remove all the exchange accounts, restart the device and add the accounts back again. For me it survives a restart, so that is different from the OP.

Side note: This also solved my problem with the login screen not responding for several seconds after a reboot.

1 Like

Give it time and see if they fail again after a few hours, days, or when you go from WIFI to mobile, or when there’s no connectivity because of lack of signal. That’s when my accounts (I had four of them) failed.

I will monitor the accounts. I suspect that a strange entry in the database could cause the problem.

Next time when it fails one could deactivate all the accounts and reboot the device. Then activate the accounts one by one to see when the service starts to fail again. Then see what the last activity on this account was. Maybe it could give the software engineers some pointers where to look.

Unfortunately I don’t have the exchange accounts on my SFOS phone anymore. I need them for work as they are the email systems of my clients which require me to use their internal email rather than my own. So they need to work reliably and all the time, especially when I’m on the road.

I tried using MS Outlook on the SFOS phone using Android support, but mobile data doesn’t work properly in Android. It was great using WIFI - all four exchange accounts worked flawlessly, but as soon as I left the house they stopped receiving email.

Now gone back to an iPhone as daily driver until this all gets fixed maybe in a few year’s time :disappointed:

Final note. The service is still running and I can still sync the two accounts. But not all my meetings are showing up in the agenda. It seems to be that some of the more complex ones fail to be imported. These are meetings that also have a location given. I will start a different bug report for this issue.

EAS is still working and syncing. But to be fair there is not a lot of activity on the two account except for agenda events. So I have added another e-mail account where I get a lot of spam on to see if it breaks.

1 Like

Ok, so I don’t know if this helps @Jolla diagnose the problem or not, but…

I have four Office365 email accounts. They all have the same settings and all use the same server (outlook.office365.com). With all four accounts set up on SFOS as described above it doesn’t work properly, as described above.

But if I have just ONE of those accounts set up on SFOS then it does work - or at least its been working fine for at least a week now without locking up, or having a sync failure, or having to be deleted and recreated to get it to work.

Why could this be?

Ok, so false hope I’m afraid. Sadly the phone crashed (i.e. No apps would load, just got a rotating circle on the cover page of the app before it just disappeared) so had to reboot. Then the sole Office365 account stopped synchronizing as per this bug report :disappointed:

I also have encountered a synchronisation error. I needed to restart the service to get it up and running again. At least I did not have to setup a fresh account. Unfortunately I was not logging the debug output of the EAS plug-in at the time of the sync error. Logging is now running again lets see if we can find the problem.

What I did find is that recurring events are not always correctly handle by the plug-in. Once a recurring event has exceptions which are not a simple delete, then the plug-in false to load them into the database.

Added to internal bugzilla

I have two accounts on my phone and both work fine, even after reboot

Are those accounts on the same or different domains?

Each account is for a completely different company, so I assume they will all have their own different domain.

You’re luckier than some of us then.

Right. That’s the case on my device as well, the issue is not related to that.

Luckily I haven’t needed to reboot my phone for a couple of weeks now and the single ‘test’ Office365 account (just one of my client’s real email system, not a test system per se) is still working fine despite numerous network flips from Wifi to mobile as I have been out and about. This seems to be an improvement, maybe introduced in .19?

Had to reboot my phone to test this bug

And the single configured Office365 account has stopped working as above and expected :disappointed:

1 Like

Hello,
Every reboot a phone cause syncing an office365 account (emails only) stops working.

REPRODUCIBILITY: 100%
OSVERSION: 4.5.0.24
HARDWARE: Sony Xperia XA2
UI LANGUAGE: (PL)
REGRESSION: ?
MODIFICATIONS : None

Also after reboot the phone a sailfish-eas service is not active, trying start it fails. Maybe it would be possible to add a recreate an account action/button?

It looks like the authorize established for an exchange server is wiped during reboot. The same happens on dropbox account. But dropbox at first syncing after a reboot warns that user should log into DP through webbrowser. And account works. Similar feature would be very useful to O365 account.