Bug 634189 - ipa host-mod --setattr and --addattr returns internal Error
Summary: ipa host-mod --setattr and --addattr returns internal Error
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: freeIPA
Classification: Retired
Component: ipa-admintools
Version: 2.0
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rob Crittenden
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-15 13:12 UTC by Jenny Severance
Modified: 2015-01-04 23:43 UTC (History)
3 users (show)

Fixed In Version: freeipa-2.0.0-1.fc15
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-28 09:36:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Jenny Severance 2010-09-15 13:12:25 UTC
Description of problem:
Negative test, ipa host-mod --setattr on fqdn returned ambiguous error message.

Version-Release number of selected component (if applicable):

ipa-server-1.91-0.2010080617git830910d.fc12.i686
ipa-admintools-1.91-0.2010080617git830910d.fc12.i686


How reproducible:
always

Steps to Reproduce:
1. add a new host
2. attempt to set the host's fqdn
   # ipa host-mod --setattr fdqn=mynewfqdn
3.
  
Actual results:
ipa: ERROR: an internal error has occurred

Expected results:
ipa: ERROR: no modifications to be performed
 
Additional info:

The expected results are based on results of attempting to add and set ipa defined schema attributes.  It is probably preferable to return a message saying it is not allowed - rather than no modification performed.

Comment 1 Rob Crittenden 2010-09-15 13:52:54 UTC
Ticket https://fedorahosted.org/freeipa/ticket/230

Comment 2 Jenny Severance 2010-09-15 18:12:09 UTC
Traceback for all scenarios producing internal errors with setattr and addaddr

1.
################################################################################
[Wed Sep 15 14:05:48 2010] [error] ipa: INFO: Created connection context.ldap2
[Wed Sep 15 14:05:48 2010] [error] ipa: DEBUG: raw: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'fqdn=newfqdn',), all=False, raw=False)
[Wed Sep 15 14:05:48 2010] [error] ipa: INFO: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'fqdn=newfqdn',), all=False, raw=False)
[Wed Sep 15 14:05:48 2010] [error] ipa: ERROR: non-public: KeyError: 'fqdn'
[Wed Sep 15 14:05:48 2010] [error] Traceback (most recent call last):
[Wed Sep 15 14:05:48 2010] [error]   File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 206, in wsgi_execute
[Wed Sep 15 14:05:48 2010] [error]     result = self.Command[name](*args, **options)
[Wed Sep 15 14:05:48 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 401, in __call__
[Wed Sep 15 14:05:48 2010] [error]     ret = self.run(*args, **options)
[Wed Sep 15 14:05:48 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 669, in run
[Wed Sep 15 14:05:48 2010] [error]     return self.execute(*args, **options)
[Wed Sep 15 14:05:48 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 441, in execute
[Wed Sep 15 14:05:48 2010] [error]     if type(entry_attrs[attr]) in (tuple,list):
[Wed Sep 15 14:05:48 2010] [error] KeyError: 'fqdn'
[Wed Sep 15 14:05:48 2010] [error] ipa: INFO: response: InternalError: an internal error has occurred
[Wed Sep 15 14:05:48 2010] [error] ipa: INFO: Destroyed connection context.ldap2
################################################################################

2.
################################################################################
[Wed Sep 15 14:05:56 2010] [error] ipa: INFO: Created connection context.ldap2
[Wed Sep 15 14:05:56 2010] [error] ipa: DEBUG: raw: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'krbPrincipalName=host/NIGHTCRAWLER.bos.redhat.com.COM',), all=False, raw=False)
[Wed Sep 15 14:05:56 2010] [error] ipa: INFO: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'krbPrincipalName=host/NIGHTCRAWLER.bos.redhat.com.COM',), all=False, raw=False)
[Wed Sep 15 14:05:56 2010] [error] ipa: ERROR: non-public: KeyError: 'krbprincipalname'
[Wed Sep 15 14:05:56 2010] [error] Traceback (most recent call last):
[Wed Sep 15 14:05:56 2010] [error]   File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 206, in wsgi_execute
[Wed Sep 15 14:05:56 2010] [error]     result = self.Command[name](*args, **options)
[Wed Sep 15 14:05:56 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 401, in __call__
[Wed Sep 15 14:05:56 2010] [error]     ret = self.run(*args, **options)
[Wed Sep 15 14:05:56 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 669, in run
[Wed Sep 15 14:05:56 2010] [error]     return self.execute(*args, **options)
[Wed Sep 15 14:05:56 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 441, in execute
[Wed Sep 15 14:05:56 2010] [error]     if type(entry_attrs[attr]) in (tuple,list):
[Wed Sep 15 14:05:56 2010] [error] KeyError: 'krbprincipalname'
[Wed Sep 15 14:05:56 2010] [error] ipa: INFO: response: InternalError: an internal error has occurred
[Wed Sep 15 14:05:56 2010] [error] ipa: INFO: Destroyed connection context.ldap2
################################################################################

3.
################################################################################
[Wed Sep 15 14:06:04 2010] [error] ipa: INFO: Created connection context.ldap2
[Wed Sep 15 14:06:04 2010] [error] ipa: DEBUG: raw: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'nsHostLocation=jupiter',), all=False, raw=False)
[Wed Sep 15 14:06:04 2010] [error] ipa: INFO: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'nsHostLocation=jupiter',), all=False, raw=False)
[Wed Sep 15 14:06:04 2010] [error] ipa: ERROR: non-public: KeyError: 'nshostlocation'
[Wed Sep 15 14:06:04 2010] [error] Traceback (most recent call last):
[Wed Sep 15 14:06:04 2010] [error]   File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 206, in wsgi_execute
[Wed Sep 15 14:06:04 2010] [error]     result = self.Command[name](*args, **options)
[Wed Sep 15 14:06:04 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 401, in __call__
[Wed Sep 15 14:06:04 2010] [error]     ret = self.run(*args, **options)
[Wed Sep 15 14:06:04 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 669, in run
[Wed Sep 15 14:06:04 2010] [error]     return self.execute(*args, **options)
[Wed Sep 15 14:06:04 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 441, in execute
[Wed Sep 15 14:06:04 2010] [error]     if type(entry_attrs[attr]) in (tuple,list):
[Wed Sep 15 14:06:04 2010] [error] KeyError: 'nshostlocation'
[Wed Sep 15 14:06:04 2010] [error] ipa: INFO: response: InternalError: an internal error has occurred
[Wed Sep 15 14:06:04 2010] [error] ipa: INFO: Destroyed connection context.ldap2
################################################################################

4.
################################################################################
[Wed Sep 15 14:06:07 2010] [error] ipa: INFO: Created connection context.ldap2
[Wed Sep 15 14:06:07 2010] [error] ipa: DEBUG: raw: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'l=moonside',), all=False, raw=False)
[Wed Sep 15 14:06:07 2010] [error] ipa: INFO: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'l=moonside',), all=False, raw=False)
[Wed Sep 15 14:06:07 2010] [error] ipa: ERROR: non-public: KeyError: 'l'
[Wed Sep 15 14:06:07 2010] [error] Traceback (most recent call last):
[Wed Sep 15 14:06:07 2010] [error]   File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 206, in wsgi_execute
[Wed Sep 15 14:06:07 2010] [error]     result = self.Command[name](*args, **options)
[Wed Sep 15 14:06:07 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 401, in __call__
[Wed Sep 15 14:06:07 2010] [error]     ret = self.run(*args, **options)
[Wed Sep 15 14:06:07 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 669, in run
[Wed Sep 15 14:06:07 2010] [error]     return self.execute(*args, **options)
[Wed Sep 15 14:06:07 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 441, in execute
[Wed Sep 15 14:06:07 2010] [error]     if type(entry_attrs[attr]) in (tuple,list):
[Wed Sep 15 14:06:07 2010] [error] KeyError: 'l'
[Wed Sep 15 14:06:07 2010] [error] ipa: INFO: response: InternalError: an internal error has occurred
[Wed Sep 15 14:06:07 2010] [error] ipa: INFO: Destroyed connection context.ldap2
################################################################################

5. 
################################################################################
[Wed Sep 15 14:06:11 2010] [error] ipa: INFO: Created connection context.ldap2
[Wed Sep 15 14:06:11 2010] [error] ipa: DEBUG: raw: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'nsOsVersion=RHEL5',), all=False, raw=False)
[Wed Sep 15 14:06:11 2010] [error] ipa: INFO: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'nsOsVersion=RHEL5',), all=False, raw=False)
[Wed Sep 15 14:06:11 2010] [error] ipa: ERROR: non-public: KeyError: 'nsosversion'
[Wed Sep 15 14:06:11 2010] [error] Traceback (most recent call last):
[Wed Sep 15 14:06:11 2010] [error]   File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 206, in wsgi_execute
[Wed Sep 15 14:06:11 2010] [error]     result = self.Command[name](*args, **options)
[Wed Sep 15 14:06:11 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 401, in __call__
[Wed Sep 15 14:06:11 2010] [error]     ret = self.run(*args, **options)
[Wed Sep 15 14:06:11 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 669, in run
[Wed Sep 15 14:06:11 2010] [error]     return self.execute(*args, **options)
[Wed Sep 15 14:06:11 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 441, in execute
[Wed Sep 15 14:06:11 2010] [error]     if type(entry_attrs[attr]) in (tuple,list):
[Wed Sep 15 14:06:11 2010] [error] KeyError: 'nsosversion'
[Wed Sep 15 14:06:11 2010] [error] ipa: INFO: response: InternalError: an internal error has occurred
[Wed Sep 15 14:06:11 2010] [error] ipa: INFO: Destroyed connection context.ldap2
################################################################################

6.
################################################################################
[Wed Sep 15 14:06:23 2010] [error] ipa: INFO: Created connection context.ldap2
[Wed Sep 15 14:06:23 2010] [error] ipa: DEBUG: raw: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'description=newer',), all=False, raw=False)
[Wed Sep 15 14:06:23 2010] [error] ipa: INFO: host_mod(u'nightcrawler.bos.redhat.com', addattr=(u'description=newer',), all=False, raw=False)
[Wed Sep 15 14:06:23 2010] [error] ipa: ERROR: non-public: KeyError: 'description'
[Wed Sep 15 14:06:23 2010] [error] Traceback (most recent call last):
[Wed Sep 15 14:06:23 2010] [error]   File "/usr/lib/python2.6/site-packages/ipaserver/rpcserver.py", line 206, in wsgi_execute
[Wed Sep 15 14:06:23 2010] [error]     result = self.Command[name](*args, **options)
[Wed Sep 15 14:06:23 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 401, in __call__
[Wed Sep 15 14:06:23 2010] [error]     ret = self.run(*args, **options)
[Wed Sep 15 14:06:23 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/frontend.py", line 669, in run
[Wed Sep 15 14:06:23 2010] [error]     return self.execute(*args, **options)
[Wed Sep 15 14:06:23 2010] [error]   File "/usr/lib/python2.6/site-packages/ipalib/plugins/baseldap.py", line 441, in execute
[Wed Sep 15 14:06:23 2010] [error]     if type(entry_attrs[attr]) in (tuple,list):
[Wed Sep 15 14:06:23 2010] [error] KeyError: 'description'
[Wed Sep 15 14:06:23 2010] [error] ipa: INFO: response: InternalError: an internal error has occurred
[Wed Sep 15 14:06:23 2010] [error] ipa: INFO: Destroyed connection context.ldap2
################################################################################

Comment 3 Rob Crittenden 2010-09-29 19:06:31 UTC
I can't reproduce this. Note that this isn't an LDAP error but a python one, complaining that the attribute we're trying to update isn't available.

I can produce a similar error when trying to use set/addattr on a non-existent hostname.

Can you still produce this error message and does the host nightcrawler.bos.redhat.com exist in IPA?

Comment 4 Jenny Severance 2010-09-29 19:27:49 UTC
Hi Rob:

current version installed ipa-server-1.91-0.2010092500git65b455e.fc12.i686

This looks good:
[root@dhcp-100-3-186 ipa-group-cli]# ipa host-mod --setattr fqdn=mynewfqdn nightcrawler.bos.redhat.com
ipa: ERROR: Operation not allowed on RDN:


This looks good:
[root@dhcp-100-3-186 ipa-group-cli]# ipa host-mod --setattr fqdn=mynewfqdn badhost.bos.redhat.com
ipa: ERROR: badhost.bos.redhat.com: host not found


This not so good ...
[root@dhcp-100-3-186 ipa-group-cli]# ipa host-mod --addattr fqdn=mynewfqdn badhost.bos.redhat.com
ipa: ERROR: an internal error has occurred

This should error ....
[root@dhcp-100-3-186 ipa-group-cli]# ipa host-mod --addattr fqdn=mynewfqdn nightcrawler.bos.redhat.com
-------------------------------------------
Modified host "nightcrawler.bos.redhat.com"
-------------------------------------------
  Host name: nightcrawler.bos.redhat.com, mynewfqdn
  Principal name: host/nightcrawler.bos.redhat.com@TESTRELM

Comment 5 Rob Crittenden 2010-09-29 19:52:54 UTC
This is what I'm seeing as well.

If you look in the Apache error log you'll see an error about attr_list for the last failure.

I don't think a host can have more than on FQDN. This really should return the equivalent of 'Operation not allowed on RDN' though in a nicer way.

Comment 6 Dmitri Pal 2010-12-10 22:47:48 UTC
master: dff2ff830073c638582c3708cec422c47994f36a


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