Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot marshal None unless allow_none is enabled #22

Closed
Bost opened this issue May 1, 2023 · 4 comments
Closed

cannot marshal None unless allow_none is enabled #22

Bost opened this issue May 1, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@Bost
Copy link

Bost commented May 1, 2023

$ pwclient list -w Licht
Traceback (most recent call last):
  File "/gnu/store/8z3z6p6rl6i8z7s96m18a251rfkdz4il-pwclient-2.6.0/bin/.pwclient-real", line 10, in <module>
    sys.exit(main())
  File "/gnu/store/8z3z6p6rl6i8z7s96m18a251rfkdz4il-pwclient-2.6.0/lib/python3.10/site-packages/pwclient/shell.py", line 140, in main
    patches.action_list(
  File "/gnu/store/8z3z6p6rl6i8z7s96m18a251rfkdz4il-pwclient-2.6.0/lib/python3.10/site-packages/pwclient/patches.py", line 91, in action_list
    patches = api.patch_list(**filters)
  File "/gnu/store/8z3z6p6rl6i8z7s96m18a251rfkdz4il-pwclient-2.6.0/lib/python3.10/site-packages/pwclient/api.py", line 300, in patch_list
    patches += self._client.patch_list(filters)
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/xmlrpc/client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/xmlrpc/client.py", line 1182, in single_request
    return self.parse_response(resp)
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/xmlrpc/client.py", line 1354, in parse_response
    return u.close()
  File "/gnu/store/dy3xh053ahkhrp2jamggq8cpsyvp8mg0-python-3.10.7/lib/python3.10/xmlrpc/client.py", line 668, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'TypeError'>:cannot marshal None unless allow_none is enabled">
$ cat ~/.pwclientrc
# Sample .pwclientrc file for the guix-patches project,
# running on patches.guix-patches.cbaines.net.
#
# Just append this file to your existing ~/.pwclientrc
# If you do not already have a ~/.pwclientrc, then copy this file to
# ~/.pwclientrc, and uncomment the following two lines:
# [options]
# default=guix-patches

[guix-patches]
url = https://patches.guix-patches.cbaines.net/xmlrpc/

[options]
default=guix-patches
@stephenfin
Copy link
Member

This is actually a bug in the server: we shouldn't be returning None values as they're apparently not valid per the XMLRPC spec. However, that code is frozen so setting this config option is probably the correct thing to do.

Personally, I would recommend switching to the REST backend. It's the way forward. You can do this by setting backend = rest for the given project and updating the url value to point the REST API endpoint (likely $host/api).

@stephenfin stephenfin added the enhancement New feature or request label May 2, 2023
@Bost
Copy link
Author

Bost commented May 3, 2023

Thx. But there's still a bit of work to do:

<bost> cbaines: this works:
<bost> [guix-patches]
<bost> backend = rest
<bost> url = https://patches.guix-patches.cbaines.net/api
<bost>
<cbaines> that's good :)
<bost> cbaines: please change the content of the pwclientrc (see bottom of https://patches.guix-patches.cbaines.net/project/guix-patches/)
<bost> cbaines: yeah, but there's bit of work for you, too :)
<cbaines> bost, it looks like that is hardcoded to use the xmlrpc API https://github.com/getpatchwork/patchwork/blob/668371ea0e848ab4c475306fcc259000d9dbf17c/patchwork/templates/patchwork/pwclientrc

See https://logs.guix.gnu.org/guix/2023-05-03.log#110410

@stephenfin
Copy link
Member

Yeah, that's a good change for a future Patchwork release. The rest backend for pwclient is still beta'ish. It's probably mature enough to switch things over now though.

@stephenfin
Copy link
Member

Opened an RFE to track this work as getpatchwork/patchwork#528

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants