Error: can not serialize 'set' object
Looks like last revision (9b2a6e66) introduced a bug when using the search API with the remote proxy:
swh-search-1 | 2024-02-16T18:07:20.197169684Z can not serialize 'set' object
swh-search-1 | 2024-02-16T18:07:20.197189593Z Traceback (most recent call last):
swh-search-1 | 2024-02-16T18:07:20.197194922Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/flask/app.py", line 870, in full_dispatch_request
swh-search-1 | 2024-02-16T18:07:20.197199335Z rv = self.dispatch_request()
swh-search-1 | 2024-02-16T18:07:20.197202985Z ^^^^^^^^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197206555Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/flask/app.py", line 855, in dispatch_request
swh-search-1 | 2024-02-16T18:07:20.197210664Z return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
swh-search-1 | 2024-02-16T18:07:20.197214840Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197234433Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/swh/core/api/negotiation.py", line 153, in newf
swh-search-1 | 2024-02-16T18:07:20.197239141Z return f.negotiator(*args, **kwargs)
swh-search-1 | 2024-02-16T18:07:20.197242882Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197246566Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/swh/core/api/negotiation.py", line 90, in __call__
swh-search-1 | 2024-02-16T18:07:20.197250628Z return formatter(result)
swh-search-1 | 2024-02-16T18:07:20.197253946Z ^^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197257569Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/swh/core/api/negotiation.py", line 63, in __call__
swh-search-1 | 2024-02-16T18:07:20.197261700Z self.render(obj), content_type=self.response_mimetype
swh-search-1 | 2024-02-16T18:07:20.197265680Z ^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197269526Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/swh/core/api/__init__.py", line 85, in render
swh-search-1 | 2024-02-16T18:07:20.197273635Z return msgpack_dumps(obj, extra_encoders=self.extra_encoders)
swh-search-1 | 2024-02-16T18:07:20.197277453Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197281210Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/swh/core/api/serializers.py", line 274, in msgpack_dumps
swh-search-1 | 2024-02-16T18:07:20.197285304Z return msgpack.packb(
swh-search-1 | 2024-02-16T18:07:20.197288906Z ^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197292473Z File "/srv/softwareheritage/venv/lib/python3.11/site-packages/msgpack/__init__.py", line 36, in packb
swh-search-1 | 2024-02-16T18:07:20.197296598Z return Packer(**kwargs).pack(o)
swh-search-1 | 2024-02-16T18:07:20.197300372Z ^^^^^^^^^^^^^^^^^^^^^^^^
swh-search-1 | 2024-02-16T18:07:20.197304128Z File "msgpack/_packer.pyx", line 294, in msgpack._cmsgpack.Packer.pack
swh-search-1 | 2024-02-16T18:07:20.197308117Z File "msgpack/_packer.pyx", line 300, in msgpack._cmsgpack.Packer.pack
swh-search-1 | 2024-02-16T18:07:20.197312072Z File "msgpack/_packer.pyx", line 297, in msgpack._cmsgpack.Packer.pack
swh-search-1 | 2024-02-16T18:07:20.197315917Z File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
swh-search-1 | 2024-02-16T18:07:20.197320993Z File "msgpack/_packer.pyx", line 291, in msgpack._cmsgpack.Packer._pack
swh-search-1 | 2024-02-16T18:07:20.197325034Z TypeError: can not serialize 'set' object
Seems the implementation of the in-memory backed do take care of converting the visit_types result as a list, but not the elasticsearch one.