users: setup issues in unstable image

I built an unstable image including plinth-0.19.0. After starting the image, Plinth is stuck at the "Please wait for FreedomBox to finish installation. You can start using your FreedomBox once it is done." message. Plinth log shows the following errors:

[2017-12-19 14:42:38,545] plinth.setup   INFO     Running module setup - users
[2017-12-19 14:42:38,554] plinth.setup   INFO     Running step for module - users, step
 - post
[2017-12-19 14:42:38,554] plinth.actions INFO     Executing command - ['sudo', '-n', '/usr/share/plinth/actions/users', 'setup']
[2017-12-19 14:42:40,166] plinth.actions ERROR    Error executing command - ['sudo', '-n', '/usr/share/plinth/actions/users', 'setup'], , debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
debconf: DbDriver "_ENV_stack": unable to save changes to: nslcd/ldap-uris nslcd/ldap-base nslcd/ldap-auth-type
Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.
/etc/nsswitch.conf: enable LDAP lookups for group
/etc/nsswitch.conf: enable LDAP lookups for passwd
/etc/nsswitch.conf: enable LDAP lookups for shadow
slapd.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable slapd
nslcd.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nslcd
ldap_add: Server is unwilling to perform (53)
        additional info: no global superior knowledge
Traceback (most recent call last):
  File "/usr/share/plinth/actions/users", line 154, in create_organizational_unit
    ], stdout=subprocess.DEVNULL, check=True)
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ldapsearch', '-Q', '-Y', 'EXTERNAL', '-H', 'ldapi:///', '-s', 'base', '-b', 'ou=users,dc=thisbox', '(objectclass=*)']' returned non-zero exit status 32.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/plinth/actions/users", line 375, in <module>
    main()
  File "/usr/share/plinth/actions/users", line 371, in main
    subcommand_method(arguments)
  File "/usr/share/plinth/actions/users", line 114, in subcommand_setup
    configure_ldap_structure()
  File "/usr/share/plinth/actions/users", line 143, in configure_ldap_structure
    create_organizational_unit('users')
  File "/usr/share/plinth/actions/users", line 164, in create_organizational_unit
    stdout=subprocess.DEVNULL, check=True)
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ldapadd', '-Q', '-Y', 'EXTERNAL', '-H', 'ldapi:///']' returned non-zero exit status 53.

[2017-12-19 14:42:40,167] plinth.setup   ERROR    Error running setup - ('users', '', 'debconf: unable to initialize frontend: Dialog\ndebconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)\ndebconf: falling back to frontend: Readline\ndebconf: unable to initialize frontend: Readline\ndebconf: (This frontend requires a controlling tty.)\ndebconf: falling back to frontend: Teletype\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\ndebconf: DbDriver "_ENV_stack": unable to save changes to: nslcd/ldap-uris nslcd/ldap-base nslcd/ldap-auth-type\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\n/etc/nsswitch.conf: enable LDAP lookups for group\n/etc/nsswitch.conf: enable LDAP lookups for passwd\n/etc/nsswitch.conf: enable LDAP lookups for shadow\nslapd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable slapd\nnslcd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable nslcd\nldap_add: Server is unwilling to perform (53)\n\tadditional info: no global superior knowledge\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 154, in create_organizational_unit\n    ], stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapsearch\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\', \'-s\', \'base\', \'-b\', \'ou=users,dc=thisbox\', \'(objectclass=*)\']\' returned non-zero exit status 32.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 375, in <module>\n    main()\n  File "/usr/share/plinth/actions/users", line 371, in main\n    subcommand_method(arguments)\n  File "/usr/share/plinth/actions/users", line 114, in subcommand_setup\n    configure_ldap_structure()\n  File "/usr/share/plinth/actions/users", line 143, in configure_ldap_structure\n    create_organizationa
l_unit(\'users\')\n  File "/usr/share/plinth/actions/users", line 164, in create_organizational_unit\n    stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapadd\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\']\' returned non-zero exit status 53.\n')
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/plinth/setup.py", line 85, in run
    self.module.setup(self, old_version=current_version)
  File "/usr/lib/python3/dist-packages/plinth/modules/users/__init__.py", line 62, in setup
    helper.call('post', actions.superuser_run, 'users', ['setup'])
  File "/usr/lib/python3/dist-packages/plinth/setup.py", line 124, in call
    return method(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/plinth/actions.py", line 117, in superuser_run
    return _run(action, options, input, async, True)
  File "/usr/lib/python3/dist-packages/plinth/actions.py", line 191, in _run
    raise ActionError(action, output, error)
plinth.errors.ActionError: ('users', '', 'debconf: unable to initialize frontend: Dialog\ndebconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)\ndebconf: falling back to frontend: Readline\ndebconf: unable to initialize frontend: Readline\ndebconf: (This frontend requires a controlling tty.)\ndebconf: falling back to frontend: Teletype\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\ndebconf: DbDriver "_ENV_stack": unable to save changes to: nslcd/ldap-uris nslcd/ldap-base nslcd/ldap-auth-type\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\n/etc/nsswitch.conf: enable LDAP lookups for group\n/etc/nsswitch.conf: enable LDAP lookups for passwd\n/etc/nsswitch.conf: enable LDAP lookups for shadow\nslapd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable slapd\nnslcd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable nslcd\nldap_add: Server is unwilling to perform (53)\n\tadditional info: no global superior knowledge\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 154, in create_organizational_unit\n    ], stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapsearch\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\', \'-s\', \'base\', \'-b\', \'ou=users,dc=thisbox\', \'(objectclass=*)\']\' returned non-zero exit status 32.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 375, in <module>\n    main()\n  File "/usr/share/plinth/actions/users", line 371, in main\n    subcommand_method(argume
nts)\n  File "/usr/share/plinth/actions/users", line 114, in subcommand_setup\n    configure_ldap_structure()\n  File "/usr/share/plinth/actions/users", line 143, in configure_ldap_structure\n    create_organizational_unit(\'users\')\n  File "/usr/share/plinth/actions/users", line 164, in create_organizational_unit\n    stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapadd\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\']\' returned non-zero exit status 53.\n')
[2017-12-19 14:42:40,170] plinth.setup   ERROR    Error running setup - ('users', '', 'debconf: unable to initialize frontend: Dialog\ndebconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)\ndebconf: falling back to frontend: Readline\ndebconf: unable to initialize frontend: Readline\ndebconf: (This frontend requires a controlling tty.)\ndebconf: falling back to frontend: Teletype\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\ndebconf: DbDriver "_ENV_stack": unable to save changes to: nslcd/ldap-uris nslcd/ldap-base nslcd/ldap-auth-type\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\n/etc/nsswitch.conf: enable LDAP lookups for group\n/etc/nsswitch.conf: enable LDAP lookups for passwd\n/etc/nsswitch.conf: enable LDAP lookups for shadow\nslapd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable slapd\nnslcd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable nslcd\nldap_add: Server is unwilling to perform (53)\n\tadditional info: no global superior knowledge\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 154, in create_organizational_unit\n    ], stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapsearch\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\', \'-s\', \'base\', \'-b\', \'ou=users,dc=thisbox\', \'(objectclass=*)\']\' returned non-zero exit status 32.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 375, in <module>\n    main()\n  File "/usr/share/plinth/actions/users", line 371, in main\n    subcommand_method(arguments)\n  File "/usr/share/plinth/actions/users", line 114, in subcommand_setup\n    configure_ldap_structure()\n  File "/usr/share/plinth/actions/users", line 143, in configure_ldap_structure\n    create_organizational_unit(\'users\')\n  File "/usr/share/plinth/actions/users", line 164, in create_organizational_unit\n    stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapadd\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\']\' returned non-zero exit status 53.\n')
[2017-12-19 14:42:40,170] plinth.setup   WARNING  Unable to complete setup: ('users', '', 'debconf: unable to initialize frontend: Dialog\ndebconf: (Dialog frontend will not
work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)\ndebconf: falling back to frontend: Readline\ndebconf: unable to initialize frontend: Readline\ndebconf: (This frontend requires a controlling tty.)\ndebconf: falling back to frontend: Teletype\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\ndebconf: DbDriver "_ENV_stack": unable to save changes to: nslcd/ldap-uris nslcd/ldap-base nslcd/ldap-auth-type\nUse of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, <__ANONIO__> chunk 1.\n/etc/nsswitch.conf: enable LDAP lookups for group\n/etc/nsswitch.conf: enable LDAP lookups for passwd\n/etc/nsswitch.conf: enable LDAP lookups for shadow\nslapd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable slapd\nnslcd.service is not a native service, redirecting to systemd-sysv-install.\nExecuting: /lib/systemd/systemd-sysv-install enable nslcd\nldap_add: Server is unwilling to perform (53)\n\tadditional info: no global superior knowledge\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 154, in create_organizational_unit\n    ], stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapsearch\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\', \'-s\', \'base\', \'-b\', \'ou=users,dc=thisbox\', \'(objectclass=*)\']\' returned non-zero exit status 32.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/usr/share/plinth/actions/users", line 375, in <module>\n    main()\n  File "/usr/share/plinth/actions/users", line 371, in main\n    subcommand_method(arguments)\n  File "/usr/share/plinth/actions/users", line 114, in subcommand_setup\n    configure_ldap_structure()\n  File "/usr/share/plinth/actions/users", line 143, in configure_ldap_structure\n    create_organizational_unit(\'users\')\n  File "/usr/share/plinth/actions/users", line 164, in create_organizational_unit\n    stdout=subprocess.DEVNULL, check=True)\n  File "/usr/lib/python3.6/subprocess.py", line 418, in run\n    output=stdout, stderr=stderr)\nsubprocess.CalledProcessError: Command \'[\'ldapadd\', \'-Q\', \'-Y\', \'EXTERNAL\', \'-H\', \'ldapi:///\']\' returned non-zero exit status 53.\n')
[2017-12-19 14:42:40,170] plinth.setup   INFO     Will try again in 10 seconds
Edited by Joseph Nuthalapati