Bug 53480 - univention.admin.uexceptions.wrongObjectType: ... is not recognized as dns/host_record
univention.admin.uexceptions.wrongObjectType: ... is not recognized as dns/ho...
Status: RESOLVED DUPLICATE of bug 50385
Product: UCS
Classification: Unclassified
Component: UMC - DNS
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-06-21 10:08 CEST by Christian Castens
Modified: 2023-11-14 11:21 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.286
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2022012921000104, 2022012921000097, 2022010221001485, 2021061821000243, 2021061821000252, 2021101521000035, 2021111521000641, 2022110721000903, 2022110721000896, 2023051021000096, 2023040721000086, 2023021021000583, 2022092021000286, 2022091621000105
Bug group (optional): Error handling, External feedback
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Christian Castens univentionstaff 2021-06-21 10:10:17 CEST
Version: 5.0-0 errata14

Error:
Interner Server-Fehler in "udm/query (dns/dns)".
Request: udm/query (dns/dns)

  File "%PY3%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY3%/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 595, in _thread
    superordinate = mod.get(superordinate)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 730, in get
    UDM_Error(exc).reraise()
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 365, in reraise
    six.reraise(self.__class__, self, self.exc_info[2])
  File "%PY3%/six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 718, in get
    obj = self.module.object(None, ldap_connection, None, ldap_dn, superordinate, attributes=attributes)
  File "%PY3%/univention/admin/handlers/dns/host_record.py", line 156, in __init__
    univention.admin.handlers.simpleLdap.__init__(self, co, lo, position, dn, superordinate, attributes=attributes)
  File "%PY3%/univention/admin/handlers/__init__.py", line 225, in __init__
    raise univention.admin.uexceptions.wrongObjectType('%s is not recognized as %s.' % (self.dn, self.module))
univention.management.console.modules.udm.udm_ldap.UDM_Error: Der Objekttyp dieses Objekts unterscheided sich von dem angegebenen Objekttyp.
relativeDomainName=@,zoneName=*******,cn=dns,dc=******,dc=lan is not recognized as dns/host_record.

Role: domaincontroller_master
Comment 2 Maximilian Janßen univentionstaff 2021-11-24 12:07:28 CET
Reported again:
Version: 5.0-0 errata127
Comment 3 Mika Westphal univentionstaff 2022-11-11 10:17:17 CET
Version: 5.0-2 errata476

Remark: add host name but can't delete it

Error:
Internal server error during "udm/remove (dns/dns)".
Request: udm/remove (dns/dns)

Traceback (most recent call last):
  File "%PY3%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY3%/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 475, in _thread
    module.remove(ldap_dn, options.get('cleanup', False), options.get('recursive', False))
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 599, in remove
    obj = self.module.object(None, ldap_connection, ldap_position, dn=ldap_dn, superordinate=superordinate)
  File "%PY3%/univention/admin/handlers/dns/host_record.py", line 159, in __init__
    univention.admin.handlers.simpleLdap.__init__(self, co, lo, position, dn, superordinate, attributes=attributes)
  File "%PY3%/univention/admin/handlers/__init__.py", line 227, in __init__
    raise univention.admin.uexceptions.wrongObjectType('%s is not recognized as %s.' % (self.dn, self.module))
univention.admin.uexceptions.wrongObjectType: relativeDomainName=@,zoneName=*******.**.**,cn=dns,dc=******,dc=**,dc=** is not recognized as dns/host_record.

Role: domaincontroller_master
Comment 4 Mika Westphal univentionstaff 2022-11-11 10:21:08 CET
 Version: 5.0-2 errata476

Remark: accidentally add the same domain name and can't delete

Error:
Internal server error during "udm/query (dns/dns)".
Request: udm/query (dns/dns)

Traceback (most recent call last):
  File "%PY3%/notifier/threads.py", line 80, in _run
    result = self._function()
  File "%PY3%/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 597, in _thread
    _superordinate, mod = self.get_obj_module(request.flavor, superordinate)
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 230, in get_obj_module
    return get_obj_module(flavor, ldap_dn, self.get_ldap_connection()[0])
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 1222, in get_obj_module
    return module.get(ldap_dn, attributes=attr), module
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 731, in get
    UDM_Error(exc).reraise()
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 366, in reraise
    six.reraise(self.__class__, self, self.exc_info[2])
  File "%PY3%/six.py", line 692, in reraise
    raise value.with_traceback(tb)
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 719, in get
    obj = self.module.object(None, ldap_connection, None, ldap_dn, superordinate, attributes=attributes)
  File "%PY3%/univention/admin/handlers/dns/host_record.py", line 159, in __init__
    univention.admin.handlers.simpleLdap.__init__(self, co, lo, position, dn, superordinate, attributes=attributes)
  File "%PY3%/univention/admin/handlers/__init__.py", line 227, in __init__
    raise univention.admin.uexceptions.wrongObjectType('%s is not recognized as %s.' % (self.dn, self.module))
univention.management.console.modules.udm.udm_ldap.UDM_Error: The object type of this object differs from the specified object type.
relativeDomainName=@,zoneName=******,cn=dns,dc=******,dc=**,dc=** is not recognized as dns/host_record.

Role: domaincontroller_master
Comment 5 Maximilian Janßen univentionstaff 2023-07-03 18:17:49 CEST
latest: 5.0-3 errata638
Remark: adding @ host record for domain causes the zone for the domain to get created a second time with error messages in the UI.
Comment 6 Maximilian Janßen univentionstaff 2023-07-06 15:41:58 CEST
2023041121000121 5.0-3 errata622
Comment 7 Mika Westphal univentionstaff 2023-08-08 14:25:44 CEST
Internal server error during "udm/remove (dns/dns)".
Request: udm/remove (dns/dns)

Traceback (most recent call last):
  File "%PY3%/univention/management/console/modules/decorators.py", line 254, in _run
    result = self._function(*args, **kwargs)  # type: Union[BaseException, _T]
  File "%PY3%/univention/management/console/modules/udm/__init__.py", line 466, in remove
    module.remove(ldap_dn, options.get('cleanup', False), options.get('recursive', False))
  File "%PY3%/univention/management/console/modules/udm/udm_ldap.py", line 594, in remove
    obj = self.module.object(None, ldap_connection, ldap_position, dn=ldap_dn, superordinate=superordinate)
  File "%PY3%/univention/admin/handlers/dns/txt_record.py", line 114, in __init__
    univention.admin.handlers.simpleLdap.__init__(self, co, lo, position, dn, superordinate, attributes=attributes)
  File "%PY3%/univention/admin/handlers/__init__.py", line 230, in __init__
    raise univention.admin.uexceptions.wrongObjectType('%s is not recognized as %s.' % (self.dn, self.module))
univention.admin.uexceptions.wrongObjectType: The object type of this object differs from the specified object type: relativeDomainName=***,zoneName=***,cn=***,dc=***,dc=***,dc=*** is not recognized as dns/txt_record.
Comment 8 Mika Westphal univentionstaff 2023-08-08 14:26:36 CEST
(In reply to Mika Westphal from comment #7)
2023080821000041
2023080821000031
Comment 9 Jan Kraljic 2023-11-14 08:18:25 CET
In UCS 5.0-5 errata875 the problem still presist. 

Is there any workaround?
Comment 10 Jan Kraljic 2023-11-14 08:38:52 CET
(In reply to Jan Kraljic from comment #9)
> In UCS 5.0-5 errata875 the problem still presist. 
> 
> Is there any workaround?

ldapdelete -x -D "cn=admin,$(ucr get ldap/base)" -y /etc/ldap.secret \ "relativeDomainName=@,zoneName=domain.org,cn=dns,dc=domain,dc=org"
Comment 11 Florian Best univentionstaff 2023-11-14 11:00:09 CET
(In reply to Jan Kraljic from comment #10)
> (In reply to Jan Kraljic from comment #9)
> > In UCS 5.0-5 errata875 the problem still presist. 
> > 
> > Is there any workaround?
> 
> ldapdelete -x -D "cn=admin,$(ucr get ldap/base)" -y /etc/ldap.secret \
> "relativeDomainName=@,zoneName=domain.org,cn=dns,dc=domain,dc=org"

can you give us an LDIF of the object, so we can analyze what's wrong with it.
Comment 12 Philipp Hahn univentionstaff 2023-11-14 11:21:03 CET
```console
# zone=$(udm dns/forward_zone list | sed -ne 's/DN: //p;T;q')
# udm dns/host_record create --superordinate "$zone" --set name=@
# univention-ldapsearch -xLLLs base -b relativeDomainName=@,zoneName=phahn50.qa,cn=dns,dc=phahn50,dc=qa
dn: relativeDomainName=@,zoneName=phahn50.qa,cn=dns,dc=phahn50,dc=qa
zoneName: phahn50.qa
relativeDomainName: @
dNSTTL: 10800
objectClass: univentionObject
objectClass: dNSZone
objectClass: top
univentionObjectType: dns/host_record

# umc-command --pretty-print --password univention --username Administrator udm/query --flavor dns/dns --option superordinate="relativeDomainName=@,$zone" --option objectProperty=None 
Response: COMMAND
  ---
  ARGUMENTS: udm/query
  MIMETYPE : application/json
  STATUS   : 591
  OPTIONS  : { 'objectProperty': 'None',
  'superordinate': 'relativeDomainName=@,zoneName=phahn50.qa,cn=dns,dc=phahn50,dc=qa'}
  MESSAGE  : Interner Server-Fehler in "udm/query (dns/dns)".
  RESULT   : { 'location': 'https://dc20.phahn50.qa/univention/command/udm',
  'message': 'Interner Server-Fehler in "udm/query (dns/dns)".',
  'status': 591,
  'traceback': 'Interner Server-Fehler in "udm/query (dns/dns)".\n'
               'Request: udm/query (dns/dns)\n'
               '\n'
               'Traceback (most recent call last):\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", '
               'line 259, in _run\n'
               '    result = self._function(*args, **kwargs)  # type: '
               'Union[BaseException, _T]\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/udm/__init__.py", '
               'line 586, in query\n'
               '    _superordinate, mod = self.get_obj_module(request.flavor, '
               'superordinate)\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/udm/__init__.py", '
               'line 227, in get_obj_module\n'
               '    return get_obj_module(flavor, ldap_dn, '
               'self.get_ldap_connection()[0])\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/udm/udm_ldap.py", '
               'line 1211, in get_obj_module\n'
               '    return module.get(ldap_dn, attributes=attr), module\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/udm/udm_ldap.py", '
               'line 725, in get\n'
               '    UDM_Error(exc).reraise()\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/udm/udm_ldap.py", '
               'line 364, in reraise\n'
               '    six.reraise(self.__class__, self, self.exc_info[2])\n'
               '  File "/usr/lib/python3/dist-packages/six.py", line 692, in '
               'reraise\n'
               '    raise value.with_traceback(tb)\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/management/console/modules/udm/udm_ldap.py", '
               'line 714, in get\n'
               '    obj = self.module.object(None, ldap_connection, None, '
               'ldap_dn, superordinate, attributes=attributes)\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/admin/handlers/dns/host_record.py", '
               'line 158, in __init__\n'
               '    univention.admin.handlers.simpleLdap.__init__(self, co, '
               'lo, position, dn, superordinate, attributes=attributes)\n'
               '  File '
               '"/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", '
               'line 230, in __init__\n'
               "    raise univention.admin.uexceptions.wrongObjectType('%s is "
               "not recognized as %s.' % (self.dn, self.module))\n"
               'univention.management.console.modules.udm.udm_ldap.UDM_Error: '
               'Der Objekttyp dieses Objekts unterscheided sich von dem '
               'angegebenen Objekttyp: '
               'relativeDomainName=@,zoneName=phahn50.qa,cn=dns,dc=phahn50,dc=qa '
               'is not recognized as dns/host_record.'}

```

*** This bug has been marked as a duplicate of bug 50385 ***