Bug 525303 - ipa-server-install fails with error "Env._bootstrap() already called"
Summary: ipa-server-install fails with error "Env._bootstrap() already called"
Alias: None
Product: freeIPA
Classification: Retired
Component: ipa-server
Version: 2.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Rob Crittenden
QA Contact: Chandrasekar Kannan
Depends On:
Blocks: 431020
TreeView+ depends on / blocked
Reported: 2009-09-23 20:41 UTC by Michael Gregg
Modified: 2015-01-04 23:40 UTC (History)
3 users (show)

Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)
only initialize the API once in the installer, make plugins startable w/o LDAP server (8.29 KB, patch)
2009-09-25 15:11 UTC, Rob Crittenden
no flags Details | Diff

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):

How reproducible:

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

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 ?

  File "/usr/sbin/ipa-server-install", line 716, in main

  File "/usr/lib/python2.4/site-packages/ipalib/plugable.py", line 432, in bootstrap

  File "/usr/lib/python2.4/site-packages/ipalib/config.py", line 443, in _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

Note You need to log in before you can comment on or make changes to this bug.