On 07/20/2015 01:32 PM, Martin Basti wrote:
> On 20/07/15 13:21, Oleg Fayans wrote:
>> Hi Martin,
>>
>> [Mon Jul 20 06:41:09.540097 2015] [wsgi:error] [pid 15186] ipa: ERROR:
>> non-public: ValueError: non-generic 'InvalidDomainLevelError' needs
>> format=None; got format=Gettext('Domain Level cannot be lowered.',
>> domain='ipa', localedir=None)
>> [Mon Jul 20 06:41:09.540118 2015] [wsgi:error] [pid 15186] Traceback
>> (most recent call last):
>> [Mon Jul 20 06:41:09.540121 2015] [wsgi:error] [pid 15186]   File
>> "/usr/lib/python2.7/site-packages/ipaserver/rpcserver.py", line 347,
>> in wsgi_execute
>> [Mon Jul 20 06:41:09.540122 2015] [wsgi:error] [pid 15186] result =
>> self.Command[name](*args, **options)
>> [Mon Jul 20 06:41:09.540124 2015] [wsgi:error] [pid 15186]   File
>> "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 443, in
>> __call__
>> [Mon Jul 20 06:41:09.540125 2015] [wsgi:error] [pid 15186]     ret =
>> self.run(*args, **options)
>> [Mon Jul 20 06:41:09.540127 2015] [wsgi:error] [pid 15186]   File
>> "/usr/lib/python2.7/site-packages/ipalib/frontend.py", line 760, in run
>> [Mon Jul 20 06:41:09.540128 2015] [wsgi:error] [pid 15186] return
>> self.execute(*args, **options)
>> [Mon Jul 20 06:41:09.540129 2015] [wsgi:error] [pid 15186]   File
>> "/usr/lib/python2.7/site-packages/ipalib/plugins/domainlevel.py", line
>> 123, in execute
>> [Mon Jul 20 06:41:09.540131 2015] [wsgi:error] [pid 15186] raise
>> errors.InvalidDomainLevelError(message)
>> [Mon Jul 20 06:41:09.540132 2015] [wsgi:error] [pid 15186]   File
>> "/usr/lib/python2.7/site-packages/ipalib/errors.py", line 248, in
>> __init__
>> [Mon Jul 20 06:41:09.540133 2015] [wsgi:error] [pid 15186]
>> messages.process_message_arguments(self, format, message, **kw)
>> [Mon Jul 20 06:41:09.540135 2015] [wsgi:error] [pid 15186]   File
>> "/usr/lib/python2.7/site-packages/ipalib/messages.py", line 52, in
>> process_message_arguments
>> [Mon Jul 20 06:41:09.540136 2015] [wsgi:error] [pid 15186] name, format)
>>
> Can you please file this as a bug?
> We need fix it in 4.3
> 
> Thank you.
>>
>> On 07/20/2015 01:04 PM, Martin Basti wrote:
>>> On 20/07/15 12:47, Oleg Fayans wrote:
>>>> Hi everybody,
>>>>
>>>> I keep receiving the same non-specific error message during attepts
>>>> to set domain level to 0:
>>>> $ ipa domainlevel-set 0
>>>> ipa: ERROR: an internal error has occurred
>>>>
>>>> This error does not get recorded in the directory server errors log.
>>>> Real-time observations on the access log show that only the
>>>> following lines get added:
>>>>
>>>> [20/Jul/2015:06:45:07 -0400] conn=151 op=0 BIND dn="" method=sasl
>>>> version=3 mech=GSSAPI
>>>> [20/Jul/2015:06:45:07 -0400] conn=2 op=984 RESULT err=0 tag=101
>>>> nentries=1 etime=0
>>>> [20/Jul/2015:06:45:07 -0400] conn=151 op=0 RESULT err=14 tag=97
>>>> nentries=0 etime=0, SASL bind in progress
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=1 BIND dn="" method=sasl
>>>> version=3 mech=GSSAPI
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=2 BIND dn="" method=sasl
>>>> version=3 mech=GSSAPI
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=3 SRCH
>>>> base="cn=ipaconfig,cn=etc,dc=pesen,dc=net" scope=0
>>>> filter="(objectClass=*)" attrs=ALL
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=2 RESULT err=0 tag=97
>>>> nentries=0 etime=0 dn="uid=admin,cn=users,cn=accounts,dc=pesen,dc=net"
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=3 RESULT err=0 tag=101
>>>> nentries=1 etime=0
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=4 SRCH base="cn=Domain
>>>> Level,cn=ipa,cn=etc,dc=pesen,dc=net" scope=0
>>>> filter="(objectClass=*)" attrs=ALL
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=4 RESULT err=0 tag=101
>>>> nentries=1 etime=0
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=1 RESULT err=14 tag=97
>>>> nentries=0 etime=0, SASL bind in progress
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=5 UNBIND
>>>> [20/Jul/2015:06:45:08 -0400] conn=151 op=5 fd=102 closed - U1
>>>>
>>>> According to Ludwig, decreasing of the domain level is not
>>>> supported, so we should provide some meaningfull error message in
>>>> this case
>>>>
>>>> P. S.
>>>> $ rpm -q freeipa-server
>>>> freeipa-server-4.2.90.201507171036GITf1f3ef4-0.fc22.x86_64
>>>> The packages were built on Friday from the upstream master.
>>>>
>>> Can you paste apache error log here please?
>>>
>>
> 
> 

This is just an incorrect initialization of the InvalidDomainLevelError.

Pushed to master: 37b1af9a7cea72f41ac468ab80259f39b0a7b3db
From 711f4cc96215e9aeb9b5896ce70f71e64e422a6c Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Mon, 20 Jul 2015 13:49:41 +0200
Subject: [PATCH] domainlevel: Fix incorrect initializations of
 InvalidDomainLevelError exceptions

---
 ipalib/plugins/domainlevel.py | 4 ++--
 ipalib/plugins/topology.py    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ipalib/plugins/domainlevel.py b/ipalib/plugins/domainlevel.py
index 64e383006722fb2f32f5300d627b18b6daf051d4..838a518e7727ede34958add47c0c24845d6e3f07 100644
--- a/ipalib/plugins/domainlevel.py
+++ b/ipalib/plugins/domainlevel.py
@@ -120,7 +120,7 @@ class domainlevel_set(Command):
         # Domain level cannot be lowered
         if int(desired_value) < int(current_value):
             message = _("Domain Level cannot be lowered.")
-            raise errors.InvalidDomainLevelError(message)
+            raise errors.InvalidDomainLevelError(reason=message)
 
         # Check if every master supports the desired level
         for master in get_master_entries(ldap, self.api):
@@ -130,7 +130,7 @@ class domainlevel_set(Command):
                 message = _("Domain Level cannot be raised to {0}, server {1} "
                             "does not support it."
                             .format(desired_value, master['cn'][0]))
-                raise errors.InvalidDomainLevelError(message)
+                raise errors.InvalidDomainLevelError(reason=message)
 
         current_entry.single_value['ipaDomainLevel'] = desired_value
         ldap.update_entry(current_entry)
diff --git a/ipalib/plugins/topology.py b/ipalib/plugins/topology.py
index de5ceb97583c9a40b4fe3783ec0fa40e6c325d0f..2723ce1213df2c94fd1445cfe7595d35806028d9 100644
--- a/ipalib/plugins/topology.py
+++ b/ipalib/plugins/topology.py
@@ -31,8 +31,8 @@ def validate_domain_level(api):
     current = int(api.Command.domainlevel_get()['result'])
     if current < MINIMUM_DOMAIN_LEVEL:
         raise errors.InvalidDomainLevelError(
-            _('Topology management requires minimum domain level {0} '
-              .format(MINIMUM_DOMAIN_LEVEL))
+            reason=_('Topology management requires minimum domain level {0} '
+                   .format(MINIMUM_DOMAIN_LEVEL))
         )
 
 
-- 
2.1.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to