#4793 Traceback if message exists in result and client doesn't send version
Closed: Fixed None Opened 9 years ago by mbasti.

...
    api.Command[cmd](*args, **options)
  File "/root/freeipa/ipalib/frontend.py", line 443, in __call__
    messages.VersionMissing(server_version=API_VERSION))
  File "/root/freeipa/ipalib/messages.py", line 48, in add_message
    result.setdefault('messages', []).append(message.to_dict())
AttributeError: 'tuple' object has no attribute 'append'

Problem is here:

If there is any warning in result, and client did not send version, frontend tries to add message into result, which are returned from server as tuple (json decode list as tuple tuple in rpc.py).

frontend.__call__()

...
        ret = self.run(*args, **options)
        # self.run returns messages in tuple
        if not version_provided and isinstance(ret, dict):
            messages.add_message(
                API_VERSION, ret,
                messages.VersionMissing(server_version=API_VERSION))
...

Can you add more information on how to reproduce this failure?

I reproduced it in DNS tests, with my WIP patch.

master:

  • 9cbbcad Fix warning message on client side

Metadata Update from @mbasti:
- Issue assigned to mbasti
- Issue set to the milestone: FreeIPA 4.2 Backlog

7 years ago

Login to comment on this ticket.

Metadata