Skip to content

Traceback: CylcError is not JSON serializable #723

@oliver-sanders

Description

@oliver-sanders

Spotted in the wild:

[E 2025-09-03 07:43:05.285 CylcUIServer] Error communicating with myworkflow
[E 2025-09-03 07:43:05.286 CylcUIServer] The workflow is no longer running at myhost:43029
It has moved to myhost2:43029
Traceback (most recent call last):
File "/path/to/cylc/uiserver/workflows_mgr.py", line 78, in workflow_request
return await client.async_request(
File "/path/to/cylc/flow/network/client.py", line 316, in async_request
self.timeout_handler()
File "/path/to/cylc/flow/network/client.py", line 154, in timeout_handler
raise CylcError(
cylc.flow.exceptions.CylcError: The workflow is no longer running at myhost:43029
It has moved to myhost2:43029
[E 2025-09-03 07:43:05.298 ServerApp] Error: Object of type CylcError is not JSON serializable Traceback (most recent call last):
File "/path/to/graphene_tornado/tornado_graphql_handler.py", line 115, in post
await self.run('post')
File "/path/to/cylc/uiserver/handlers.py", line 364, in run
await TornadoGraphQLHandler.run(self, *args, **kwargs)
File "/path/to/graphene_tornado/tornado_graphql_handler.py", line 136, in run
result, status_code = await self.get_response(data, method, show_graphiql)
File "/path/to/graphene_tornado/tornado_graphql_handler.py", line 235, in get_response
result = self.json_encode(response, pretty=self.pretty or show_graphiql)
File "/path/to/graphene_tornado/tornado_graphql_handler.py", line 319, in json_encode
return json.dumps(d, separators=(',', ':'))
File "/path/to/py", line 234, in dumps
return cls(
File "/path/to/y", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/path/to/y", line 257, in iterencode
return _iterencode(o, 0)
File "/path/to/y", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type CylcError is not JSON serializable
  • The workflow had restarted.
  • The UIS got a comms error.
  • The traceback occurred during reporting of this error.
  • The error would appear to be harmless, but highly confusing for users/admins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions