Bug 1252133

Summary: replica upgrade failed in starting dirsrv service
Product: Red Hat Enterprise Linux 7 Reporter: Xiyang Dong <xdong>
Component: 389-ds-baseAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED ERRATA QA Contact: Viktor Ashirov <vashirov>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: kbanerje, lkrispen, mbasti, mreynolds, nhosoi, nkinder, nsoman, ovasik, pvoborni, rcritten, rmeggins, tbordaz, xdong
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.4.0-12.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 11:43:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xiyang Dong 2015-08-10 19:10:45 UTC
Description of problem:
ipa replica upgrade failed in starting dirsrv

Version-Release number of selected component (if applicable):
ipa-server-4.1.0-18.el7.x86_64 
ipa-server-4.2.0-3.el7.x86_64
389-ds-base-1.3.3.1-13.el7.x86_64
389-ds-base-1.3.4.0-9.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Upgrade 7.1 master to 7.2
2.Upgrade 7.1 replica to 7.2
3.Upgrade fails on replica

Actual results:
ipa replica upgrade failed
Expected results:
Upgrade successfully

Additional info:
:: [  BEGIN   ] :: Running 'yum -y update 'ipa*' sssd'
.
.
.
2015-08-10T14:26:53Z DEBUG Upgrading IPA:
2015-08-10T14:26:53Z DEBUG   [1/10]: stopping directory server
2015-08-10T14:26:53Z DEBUG Starting external process
2015-08-10T14:26:53Z DEBUG args='/bin/systemctl' 'stop' 'dirsrv'
2015-08-10T14:26:56Z DEBUG Process finished, return code=0
2015-08-10T14:26:56Z DEBUG stdout=
2015-08-10T14:26:56Z DEBUG stderr=
2015-08-10T14:26:56Z DEBUG   duration: 3 seconds
2015-08-10T14:26:56Z DEBUG   [2/10]: saving configuration
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Saving StateFile to '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Saving StateFile to '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG   duration: 0 seconds
2015-08-10T14:26:56Z DEBUG   [3/10]: disabling listeners
2015-08-10T14:26:56Z DEBUG   duration: 0 seconds
2015-08-10T14:26:56Z DEBUG   [4/10]: enabling DS global lock
2015-08-10T14:26:56Z DEBUG   duration: 0 seconds
2015-08-10T14:26:56Z DEBUG   [5/10]: starting directory server
2015-08-10T14:26:56Z DEBUG Starting external process
2015-08-10T14:26:56Z DEBUG args='/bin/systemctl' 'start' 'dirsrv'
2015-08-10T14:26:56Z DEBUG Process finished, return code=1
2015-08-10T14:26:56Z DEBUG stdout=
2015-08-10T14:26:56Z DEBUG stderr=Job for dirsrv failed because the control process exited with error code. See "systemctl status dirsrv" and "journalctl -xe" for details.
2015-08-10T14:26:56Z DEBUG Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 416, in start_creation
    run_step(full_msg, method)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 406, in run_step
    method()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/upgradeinstance.py", line 176, in __start
    services.service(self.service_name).start(self.serverid, ldapi=True)
  File "/usr/lib/python2.7/site-packages/ipaplatform/redhat/services.py", line 163, in start
    instance_name, capture_output=capture_output, wait=wait)
  File "/usr/lib/python2.7/site-packages/ipaplatform/base/services.py", line 298, in start
    capture_output=capture_output)
  File "/usr/lib/python2.7/site-packages/ipapython/ipautil.py", line 373, in run
    raise CalledProcessError(p.returncode, arg_string, stdout)
CalledProcessError: Command ''/bin/systemctl' 'start' 'dirsrv'' returned non-zero exit status 1

2015-08-10T14:26:56Z DEBUG   [error] CalledProcessError: Command ''/bin/systemctl' 'start' 'dirsrv'' returned non-zero exit status 1
2015-08-10T14:26:56Z DEBUG   [cleanup]: stopping directory server
2015-08-10T14:26:56Z DEBUG Starting external process
2015-08-10T14:26:56Z DEBUG args='/bin/systemctl' 'stop' 'dirsrv'
2015-08-10T14:26:56Z DEBUG Process finished, return code=0
2015-08-10T14:26:56Z DEBUG stdout=
2015-08-10T14:26:56Z DEBUG stderr=
2015-08-10T14:26:56Z DEBUG   duration: 0 seconds
2015-08-10T14:26:56Z DEBUG   [cleanup]: restoring configuration
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Saving StateFile to '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Saving StateFile to '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2015-08-10T14:26:56Z DEBUG   duration: 0 seconds
2015-08-10T14:26:56Z ERROR IPA server upgrade failed: Inspect /var/log/ipaupgrade.log and run command ipa-server-upgrade manually.
2015-08-10T14:26:56Z 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_server_upgrade.py", line 48, in run
    server.upgrade()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/server/upgrade.py", line 1563, in upgrade
    data_upgrade.create_instance()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/upgradeinstance.py", line 201, in create_instance
    show_service_name=False)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 416, in start_creation
    run_step(full_msg, method)
  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 406, in run_step
    method()
  File "/usr/lib/python2.7/site-packages/ipaserver/install/upgradeinstance.py", line 176, in __start
    services.service(self.service_name).start(self.serverid, ldapi=True)
  File "/usr/lib/python2.7/site-packages/ipaplatform/redhat/services.py", line 163, in start
    instance_name, capture_output=capture_output, wait=wait)
  File "/usr/lib/python2.7/site-packages/ipaplatform/base/services.py", line 298, in start
    capture_output=capture_output)
  File "/usr/lib/python2.7/site-packages/ipapython/ipautil.py", line 373, in run
    raise CalledProcessError(p.returncode, arg_string, stdout)

2015-08-10T14:26:56Z DEBUG The ipa-server-upgrade command failed, exception: CalledProcessError: Command ''/bin/systemctl' 'start' 'dirsrv'' returned non-zero exit status 1
2015-08-10T14:26:56Z ERROR Unexpected error - see /var/log/ipaupgrade.log for details:
CalledProcessError: Command ''/bin/systemctl' 'start' 'dirsrv'' returned non-zero exit status 1

Comment 7 Petr Vobornik 2015-08-11 13:37:34 UTC
changing component according to comment 6

Comment 8 Noriko Hosoi 2015-08-11 15:46:39 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/48243

Comment 22 Noriko Hosoi 2015-08-18 22:10:53 UTC
Steps to verify with standalone 389-ds-base.

1. install older version of 389-ds-base (newer than 1.3.1)
2. systemctl disable dirsrv@SERVER_ID
   check there is no dirsrv@SERVER_ID in /etc/systemd/system/dirsrv.target.wants.
3. check ns-slapd is up (record PID)
4. set environment variables for debug logging
   export DEBUGPOSTTRANS=/tmp/output
   export DEBUGPOSTSETUP=-ddddd 
5. run upgrade to 389-ds-base-1.3.4.0-12 (e.g., rpm -U 389-ds-base)
6. check /tmp/output and /tmp/output.upgrade that the upgrade had run.
7. check ns-slapd is up and the PID is different from the one from step 3.
8. check the server instance service remains disabled.
   "systemctl status dirsrv@SERVER_ID" does not report enabled.
   There is no dirsrv@SERVER_ID in /etc/systemd/system/dirsrv.target.wants.

If 6, 7, and 8 are satisfied, the fix is verified.

Comment 23 Viktor Ashirov 2015-08-19 08:41:27 UTC
[1] I've installed 389-ds-base-1.3.4.0-8.el7.x86_64
# rpm -q 389-ds-base
389-ds-base-1.3.4.0-8.el7.x86_64

[2] Disabled dirsrv service:
# systemctl disable dirsrv@rhel7ds
Removed symlink /etc/systemd/system/dirsrv.target.wants/dirsrv.
# ls /etc/systemd/system/dirsrv.target.wants/ | wc -l
0

[3] check ns-slapd is up (record PID)
# pgrep ns-slapd
31428

[4] set environment variables for debug logging
# export DEBUGPOSTTRANS=/tmp/output
# export DEBUGPOSTSETUP=-ddddd 

[5] run upgrade to 389-ds-base-1.3.4.0-12 (e.g., rpm -U 389-ds-base)
# rpm -U 389-ds-base*

[6] check /tmp/output and /tmp/output.upgrade that the upgrade had run.

# ls /tmp/output* -la
-rw-r--r--. 1 root root 45583 Aug 19 10:31 /tmp/output
-rw-r--r--. 1 root root 43735 Aug 19 10:31 /tmp/output.upgrade

[7] check ns-slapd is up and the PID is different from the one from step 3.
# pgrep ns-slapd
31660

[8] check the server instance service remains disabled.
# systemctl status dirsrv@rhel7ds
● dirsrv - 389 Directory Server rhel7ds.
   Loaded: loaded (/usr/lib/systemd/system/dirsrv@.service; static; vendor preset: disabled)
   Active: active (running) since Wed 2015-08-19 10:31:58 CEST; 1min 7s ago
  Process: 31659 ExecStart=/usr/sbin/ns-slapd -D /etc/dirsrv/slapd-%i -i /var/run/dirsrv/slapd-%i.pid -w /var/run/dirsrv/slapd-%i.startpid (code=exited, status=0/SUCCESS)
 Main PID: 31660 (ns-slapd)
   CGroup: /system.slice/system-dirsrv.slice/dirsrv
           └─31660 /usr/sbin/ns-slapd -D /etc/dirsrv/slapd-rhel7ds -i /var/run/dirsrv/slapd-rhel7ds.pid -w /var/run/dirsrv/slapd-rhel7ds.startpid

# ls /etc/systemd/system/dirsrv.target.wants/ | wc -l
0

Marking as VERIFIED.

Comment 26 errata-xmlrpc 2015-11-19 11:43:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2351.html