Office365/Exchange Account Stops Working After Re-boot

REPRODUCIBILITY: 100% (always)
OSVERSION: 4.5.0.18
HARDWARE: Sony Xperia 10 III - xqbt52 - xqbt52 - 1.0.1.18 - aarch64
UI LANGUAGE: English (UK) (user: en_GB, os: en_GB.utf8)
REGRESSION: not specified

DESCRIPTION:

Office365/Exchange accounts work reliably after being first setup, but do not survive a re-boot of the phone. When trying to fetch email (‘Update’ on top pulley menu), or via a timed update (e.g. Every 15 mins), following a re-boot the account gets stuck (spinner or top menu pulsing line) for about 3 mins and then errors with ‘Connection Timeout’. Any further update attempts gives the same timeout result. The only way to fix is to completely delete the account and set it up again from scratch.

PRECONDITIONS:

Sailfish X with exchange support is needed

STEPS TO REPRODUCE:

  1. Setup Office365/Exchange email account. Use it, it works fine
  2. Re-boot phone
  3. Email account no longer works

EXPECTED RESULTS:

Office365 email account works after a phone re-boot

ACTUAL RESULTS:

Office365 email account doesn’t work ever again after a re-boot

MODIFICATIONS:

  • Patchmanager: no
  • OpenRepos: yes
  • Chum: yes
  • Other: none specified

ADDITIONAL INFORMATION:

Happens on XA2 4.5.0.16 as well. This looks to be very similar, if not the same, as the 4.4 bug where Office365/Exchange accounts got signed out after a reboot which was apparently fixed in 4.5.
Device Owner User: defaultuser
Home Encryption: enabled


the initial version of this bug report was created using Bugger 0.9.9+git2
5 Likes

For me the exchange plugin also stopper working for my Kerio account. It used to work fine on 4.4. I have tried removing the account and setting it up again. But that end up in “Checking server settings and policies”.

The last sentence is a translation from Dutch: “Serverinstellingen en -beleid worden gecontrolleerd”

REPRODUCIBILITY: 100%
OSVERSION: 4.5.0.18
HARDWARE: Sony Xperia XA2
UI LANGUAGE: Dutch (NL)
REGRESSION: Worked on 4.4
MODIFICATIONS : None

edit: Added some more info

I have the same problem… Xperia 10 III on 4.5.0.18
On 4.4 I had slow syncs from time to time, but it always ended up working.
Currently I tested the same as Rawnar and got the same result.
No modification of the OS currently, it’s my daily and it’s annoying.

REPRODUCIBILITY: 100%
OSVERSION: 4.5.0.18
HARDWARE: Sony Xperia 10 III - xqbt52 - 1.0.1.18 - aarch64
UI LANGUAGE: French (FR)
REGRESSION: not specified

MODIFICATIONS : Nothing

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?