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

[Bug]: GUI Bug and Fix #540

Open
1 of 3 tasks
rduke199 opened this issue Dec 17, 2024 · 0 comments
Open
1 of 3 tasks

[Bug]: GUI Bug and Fix #540

rduke199 opened this issue Dec 17, 2024 · 0 comments
Labels

Comments

@rduke199
Copy link

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.

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 -
@rduke199 rduke199 added the bug label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant