Bug 525303

Summary: ipa-server-install fails with error "Env._bootstrap() already called"
Product: [Retired] freeIPA Reporter: Michael Gregg <mgregg>
Component: ipa-serverAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: Chandrasekar Kannan <ckannan>
Severity: medium Docs Contact:
Priority: low    
Version: 2.0CC: benl, dpal, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: freeipa-2.0.0-1.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 431020    
Attachments:
Description Flags
only initialize the API once in the installer, make plugins startable w/o LDAP server none

Description Michael Gregg 2009-09-23 20:41:25 UTC
Description of problem:
running ipa-server-install fails, reporting a error that Env._bootstrap() already called

Version-Release number of selected component (if applicable):
ipa-server-2.0-4.20090923.el5ipa

How reproducible:
always

Steps to Reproduce:
1. install ipa-server rpm's
2. ipa-server-install -N -U --hostname=iparhel5-vma.dsdev.sjc.redhat.com -r DSDEV.SJC.REDHAT.COM -p pw -P pw -a pw -u root --setup-dns --forwarder 10.14.63.2

Actual results:
done configuring httpd.
Applying LDAP updates
restarting the directory server
restarting the KDC
Unexpected error - see ipaserver-install.log for details:
 Env._bootstrap() already called

From ipaserver-install.log:
Starting Kerberos 5 KDC:                                   [  OK  ]
2009-09-23 13:32:17,570 INFO 
2009-09-23 13:32:17,571 DEBUG Loading StateFile from '/var/lib/ipa/sysrestore/sysrestore.state'
2009-09-23 13:32:17,575 DEBUG Env._bootstrap() already called
  File "/usr/sbin/ipa-server-install", line 775, in ?
    sys.exit(main())

  File "/usr/sbin/ipa-server-install", line 716, in main
    api.bootstrap(in_server=True)

  File "/usr/lib/python2.4/site-packages/ipalib/plugable.py", line 432, in bootstrap
    self.env._bootstrap(**overrides)

  File "/usr/lib/python2.4/site-packages/ipalib/config.py", line 443, in _bootstrap
    self.__doing('_bootstrap')

  File "/usr/lib/python2.4/site-packages/ipalib/config.py", line 408, in __doing
    raise StandardError(

Comment 1 Rob Crittenden 2009-09-24 03:05:30 UTC
This is caused by both Martin and I initializing the ipalib environment (and for different reasons) when doing a DNS install.

I think we can move the initialization earlier if we can:
- make loading the schema in ldap2 non-fatal
- load the schema later (like in connect) if it isn't already set
- ensure that I can still override some things in the env before finalize(). I think that by definition I can, just haven't tried yet

Comment 2 Rob Crittenden 2009-09-24 21:48:34 UTC
I have somewhat of a fix but one thing is killing me.

When the plugin is loaded it attempts to fetch the schema from the LDAP server. Since this is the installer we don't have a server to connect to.

I made the ldap2 plugin handle it but then there is no way to later load the schema because the class gets locked once it is finalized.

I think we need to be able to define a set of class variables that may be modified at runtime. That or _schema is going to need to be a global variable.

Comment 3 Rob Crittenden 2009-09-25 15:11:51 UTC
Created attachment 362684 [details]
only initialize the API once in the installer, make plugins startable w/o LDAP server

Comment 4 Rob Crittenden 2010-02-03 20:14:56 UTC
master: e4877c946f71b2d091d01edfd64768ce7a7a47ee

Comment 5 Michael Gregg 2010-12-09 22:57:58 UTC
Verified to not be happening 12-8-2010