Activesync(z-push) and 2FA MFA enabled problems

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2):
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.5 LTS
Apache or nginx version (eg, Apache 2.4.25): nginx/1.14.0
PHP version (eg, 7.1): 7.2.24

The issue you are facing:

sync breaks when enabling any of the 2FA, MFA etc.

Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

  1. Enable 2FA
  2. use activesync

The output of your Nextcloud log in Admin > Logging:

	Error: Undefined offset: 3 at /usr/local/lib/owncloud/lib/private/legacy/OC_Helper.php#548

(But i get this even without the 2FA activated.)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'datadirectory' => '/home/user-data/owncloud',
  'instanceid' => '',
  'forcessl' => true,
  'overwritewebroot' => '/cloud',
  'overwrite.cli.url' => '/cloud',
  'user_backends' =>
  array (
    0 =>
    array (
      'class' => 'OC_User_IMAP',
      'arguments' =>
      array (
        0 => '',
        1 => 143,
        2 => NULL,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'administrator',
  'passwordsalt' => 'dfgdfgdfg',
  'secret' => '/dfgdfgdf',
  'trusted_domains' =>
  array (
    0 => ''
  'dbtype' => 'sqlite3',
  'version' => '',
  'installed' => true,
  'logtimezone' => 'Europe/Stockholm',
  'logdateformat' => 'Y-m-d H:i:s',
  'mail_domain' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' =>
  array (
  'twofactor_enforced_excluded_groups' =>
  array (
  'updater.secret' => '',
  'mail_sendmailmode' => 'smtp',

Z-push-top log : OK:AuthenticationRequiredException

It isn’t really difficult to use the search function of this forum, is it? :wink:

Install NC 20.0.2 and the problem should have been fixed.

Well, perhaps you where a bit too quick to judge, as that is not my problem. My problem is broken sync when using 2FA.

I don’t know how Activesync(z-push) works but you should usually configure an app specific password for such kind of applications. Have you done this?

Yes, i have tried with app-token. but this would mean i need to configure 3 accounts in my phone instead of one. calendarsync, contactsync and one imap account. I want to use the activesync and still be able to use 2FA.

Unfortunately I don’t know Activesync (z-push) and cannot help you any further.