#4744 Directory service remains in stopped mode if instance does not exist in backup
Closed: Fixed None Opened 9 years ago by ksiddiqu.

If instance not found in backup, dirsrv remains in stopped mode. If should bring back dirsrv in running mode.

Manually restarting ipa service brings dirsrv service in running mode.

[root@dhcp207-1 ~]# ipa-restore -p xxxxxxxx -U --data --backend=ipaca --instance=TESTRELM.TEST /var/lib/ipa/backup/ipa-full-2014-11-20-18-19-10/
Preparing restore from /var/lib/ipa/backup/ipa-full-2014-11-20-18-19-10/ on dhcp207-1.testrelm.test
Each master will individually need to be re-initialized or
re-created from this one. The replication agreements on
masters running IPA 3.1 or earlier will need to be manually
re-enabled. See the man page for details.
Disabling all replication.
Stopping Directory Server
389-ds instance TESTRELM.TEST does not exist
[root@dhcp207-1 ~]#

[root@dhcp207-1 ~]# systemctl status dirsrv.target
dirsrv.target - 389 Directory Server
   Loaded: loaded (/usr/lib/systemd/system/dirsrv.target; disabled)
   Active: inactive (dead)

[root@dhcp207-1 ~]#

2014-11-20T12:53:47Z INFO Each master will individually need to be re-initialized or
2014-11-20T12:53:47Z INFO re-created from this one. The replication agreements on
2014-11-20T12:53:47Z INFO masters running IPA 3.1 or earlier will need to be manually
2014-11-20T12:53:47Z INFO re-enabled. See the man page for details.
2014-11-20T12:53:47Z INFO Disabling all replication.
2014-11-20T12:53:47Z DEBUG flushing ldapi://%2fvar%2frun%2fslapd-TESTRELM-TEST.socket from SchemaCache
2014-11-20T12:53:47Z DEBUG retrieving schema for SchemaCache url=ldapi://%2fvar%2frun%2fslapd-TESTRELM-TEST.socket conn=<ldap.ldapobject.SimpleLDAPObject instance at 0x1befbd8>
2014-11-20T12:53:48Z DEBUG Starting external process
2014-11-20T12:53:48Z DEBUG args='tar' '-xzf' '/var/lib/ipa/backup/ipa-full-2014-11-20-18-19-10/ipa-full.tar' '.'
2014-11-20T12:53:48Z DEBUG Process finished, return code=0
2014-11-20T12:53:48Z DEBUG stdout=
2014-11-20T12:53:48Z DEBUG stderr=
2014-11-20T12:53:48Z INFO Stopping Directory Server
2014-11-20T12:53:48Z DEBUG Starting external process
2014-11-20T12:53:48Z DEBUG args='/bin/systemctl' 'stop' 'dirsrv@TESTRELM-TEST.service'
2014-11-20T12:53:50Z DEBUG Process finished, return code=0
2014-11-20T12:53:51Z DEBUG   File "/usr/lib/python2.7/site-packages/ipapython/admintool.py", line 171, in execute
    return_value = self.run()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/ipa_restore.py", line 301, in run
    raise admintool.ScriptError('389-ds instance %s does not exist' % instance)

2014-11-20T12:53:51Z DEBUG The ipa-restore command failed, exception: ScriptError: 389-ds instance TESTRELM.TEST does not exist
2014-11-20T12:53:51Z ERROR 389-ds instance TESTRELM.TEST does not exist

One related with backend, so updating this tkt

if invalid/non-existent backend provided, we saw following
-- ldif2db failed while restoration and kinit not working after that

[root@dhcp207-1 ~]# ipa-restore -p xxxxxxxx -U --data --backend=userroot --instance=TESTRELM-TEST /var/lib/ipa/backup/ipa-full-2014-11-20-19-05-16/
Preparing restore from /var/lib/ipa/backup/ipa-full-2014-11-20-19-05-16/ on dhcp207-1.testrelm.test
Each master will individually need to be re-initialized or
re-created from this one. The replication agreements on
masters running IPA 3.1 or earlier will need to be manually
re-enabled. See the man page for details.
Disabling all replication.
Stopping Directory Server
Restoring from userroot in TESTRELM-TEST
ldif2db failed: 
Starting Directory Server
The ipa-restore command was successful
[root@dhcp207-1 ~]# kdestroy -A
[root@dhcp207-1 ~]# sudo -u apache kdestroy
[root@dhcp207-1 ~]# echo xxxxxxxx|kinit admin
kinit: Generic error (see e-text) while getting initial credentials
[root@dhcp207-1 ~]#

[root@dhcp207-1 backup]# tail -n 40 /var/log/iparestore.log 
2014-11-20T13:40:24Z DEBUG Process finished, return code=233
2014-11-20T13:40:24Z DEBUG stdout=importing data ...
[20/Nov/2014:19:10:15 +051800] - /etc/dirsrv/slapd-TESTRELM-TEST/dse.ldif: nsslapd-maxdescriptors: nsslapd-maxdescriptors: invalid value "8192", maximum file descriptors must range from 1 to 4096 (the current process limit).  Server will use a setting of 4096.
[20/Nov/2014:19:10:15 +051800] - Config Warning: - nsslapd-maxdescriptors: invalid value "8192", maximum file descriptors must range from 1 to 4096 (the current process limit).  Server will use a setting of 4096.
[20/Nov/2014:19:10:15 +051800] - I'm resizing my cache now...cache was 1677721 and is now 1342176
[20/Nov/2014:19:10:15 +051800] ldbm_usn_init - backend: changelog (global mode)
[20/Nov/2014:19:10:15 +051800] ldbm_usn_init - backend: userRoot (global mode)
[20/Nov/2014:19:10:15 +051800] ldbm_usn_init - backend: ipaca (global mode)
[20/Nov/2014:19:10:15 +051800] - All database threads now stopped
[20/Nov/2014:19:10:15 +051800] - I'm resizing my cache now...cache was 1677721 and is now 1342176
[20/Nov/2014:19:10:15 +051800] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database
[20/Nov/2014:19:10:15 +051800] - check_and_set_import_cache: pagesize: 4096, pages: 254301, procpages: 63068
[20/Nov/2014:19:10:15 +051800] - WARNING: After allocating import cache 406880KB, the available memory is 610324KB, which is less than the soft limit 1048576KB. You may want to decrease the import cache size and rerun import.
[20/Nov/2014:19:10:15 +051800] - Import allocates 406880KB import cache.
[20/Nov/2014:19:10:15 +051800] - import userRoot: Beginning import job...
[20/Nov/2014:19:10:15 +051800] - import userRoot: Index buffering enabled with bucket size 38
[20/Nov/2014:19:10:15 +051800] - import userRoot: Could not open LDIF file "/tmp/tmp1tB6L3ipa/ipa/TESTRELM-TEST-userroot.ldif", errno 2 (No such file or directory)
[20/Nov/2014:19:10:15 +051800] - import userRoot: Thread monitoring returned: -23

[20/Nov/2014:19:10:15 +051800] - import userRoot: Aborting all Import threads...
[20/Nov/2014:19:10:24 +051800] - import userRoot: Import threads aborted.
[20/Nov/2014:19:10:24 +051800] - import userRoot: Closing files...
/var/lib/dirsrv/slapd-TESTRELM-TEST/db/userRoot: No such file or directory
[20/Nov/2014:19:10:24 +051800] - All database threads now stopped
[20/Nov/2014:19:10:24 +051800] - import userRoot: Import failed.

2014-11-20T13:40:24Z DEBUG stderr=
2014-11-20T13:40:24Z CRITICAL ldif2db failed: 
2014-11-20T13:40:24Z INFO Starting Directory Server
2014-11-20T13:40:24Z DEBUG Starting external process
2014-11-20T13:40:24Z DEBUG args='/bin/systemctl' 'start' 'dirsrv@TESTRELM-TEST.service'
2014-11-20T13:40:24Z DEBUG Process finished, return code=0
2014-11-20T13:40:24Z DEBUG Starting external process
2014-11-20T13:40:24Z DEBUG args='/bin/systemctl' 'is-active' 'dirsrv@TESTRELM-TEST.service'
2014-11-20T13:40:24Z DEBUG Process finished, return code=0
2014-11-20T13:40:24Z DEBUG stdout=active

2014-11-20T13:40:24Z DEBUG stderr=
2014-11-20T13:40:24Z DEBUG wait_for_open_ports: localhost [389] timeout 300
2014-11-20T13:40:26Z INFO The ipa-restore command was successful
[root@dhcp207-1 backup]#

Ticket is required by downstream release.

master:

  • 7b0149f Improve validation of --instance and --backend options in ipa-restore

ipa-4-1:

  • f92d0ef Improve validation of --instance and --backend options in ipa-restore

Metadata Update from @ksiddiqu:
- Issue assigned to jcholast
- Issue set to the milestone: FreeIPA 4.1.3

7 years ago

Login to comment on this ticket.

Metadata