You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the FireWorks GUI, the following error arises occasionally when trying to select the detailed view for some fireworks.
TypeError: Object of type ObjectId is not JSON serializable
The bug can be fixed but adding default=str to the file fireworks > flack_site > util.py.
Line 38 should changed from dumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder) + "\n", to dumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder, default=str) + "\n",
Version
2.0.3
Which OS?
MacOS
Windows
Linux
Log output
[2024-12-17 11:42:03,896] ERROR in app: Exception on /fw/445/details [GET]
Traceback (most recent call last):
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\fireworks\flask_site\app.py", line 71, in decorated
return f(*args, **kwargs)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\fireworks\flask_site\app.py", line 166, in get_fw_details
return jsonify(fw)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\fireworks\flask_site\util.py", line 38, in jsonify
dumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder, default=str) + "\n",
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\json\__init__.py", line 124, in dumps
return app.json.dumps(obj, **kwargs)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\json\provider.py", line 230, in dumps
return json.dumps(obj, **kwargs)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\json\__init__.py", line 234, in dumps
return cls(
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\json\encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\json\encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "C:\Users\Lab\miniconda3\envs\d3tales_robotics\lib\site-packages\flask\json\provider.py", line 122, in _default
raise TypeError(f"Object of type {type(o).__name__} is not JSON serializable")
TypeError: Object of type ObjectId is not JSON serializable
127.0.0.1 - - [17/Dec/2024 11:42:03] "GET /fw/445/details HTTP/1.1" 500 -
The text was updated successfully, but these errors were encountered:
Code snippet
No response
What happened?
In the FireWorks GUI, the following error arises occasionally when trying to select the detailed view for some fireworks.
The bug can be fixed but adding
default=str
to the filefireworks
>flack_site
>util.py
.Line 38 should changed from
dumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder) + "\n",
todumps(data, indent=indent, separators=separators, cls=MongoJsonEncoder, default=str) + "\n",
Version
2.0.3
Which OS?
Log output
The text was updated successfully, but these errors were encountered: