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

Web API is not working #11

Open
PiciAkk opened this issue Sep 8, 2021 · 2 comments
Open

Web API is not working #11

PiciAkk opened this issue Sep 8, 2021 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PiciAkk
Copy link
Collaborator

PiciAkk commented Sep 8, 2021

Flask web server is not working

Error:

[2021-09-08 15:46:41,025] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/app.py", line 2070, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/app.py", line 1515, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/app.py", line 1513, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/app.py", line 1499, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "maskdetector.py", line 28, in webAPI
    return jsonify(maskStatus)
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/json/__init__.py", line 348, in jsonify
    f"{dumps(data, indent=indent, separators=separators)}\n",
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/json/__init__.py", line 129, in dumps
    rv = _json.dumps(obj, **kwargs)
  File "/usr/lib/python3.8/json/__init__.py", line 234, in dumps
    return cls(
  File "/usr/lib/python3.8/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/home/piciakk/.local/lib/python3.8/site-packages/flask/json/__init__.py", line 56, in default
    return super().default(o)
  File "/usr/lib/python3.8/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '

Steps to reproduce

  • Download the latest version of the application
  • Install all the dependencies from the requirements.txt
  • Start the app
  • Try to use the web API
  • Enjoy the error message
@PiciAkk PiciAkk added the bug Something isn't working label Sep 8, 2021
@PiciAkk
Copy link
Collaborator Author

PiciAkk commented Sep 8, 2021

@davidfegyver I found the cause of the bug. It's in the commit 8681e0e5ac3da9f72b0b20b6bfe44058e2fbddd7 (named More verbose web API). You are trying to pass a zip value to the JSON API

@PiciAkk
Copy link
Collaborator Author

PiciAkk commented Sep 8, 2021

I commented out the buggy lines, but the issue is not fixed yet.

Spoiler warning I'm submitting commits without Pull Requests 😎

@PiciAkk PiciAkk added enhancement New feature or request help wanted Extra attention is needed and removed enhancement New feature or request labels Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant