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

Error with PATCH request through API #20

Closed
haxys opened this issue Mar 2, 2018 · 3 comments
Closed

Error with PATCH request through API #20

haxys opened this issue Mar 2, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@haxys
Copy link
Contributor

haxys commented Mar 2, 2018

2018-03-01 18:13:57,089 - werkzeug - INFO - 192.168.1.61 - - [01/Mar/2018 18:13:57] "PATCH /api/pages HTTP/1.0" 500 -
2018-03-01 18:13:57,440 - app - ERROR - Exception on /api/pages [PATCH]
Traceback (most recent call last):
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask_restless/views.py", line 157, in decorator
    return func(*args, **kw)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/mimerender.py", line 244, in wrapper
    result = target(*args, **kwargs)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask/views.py", line 149, in dispatch_request
    return meth(*args, **kwargs)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask_restless/views.py", line 189, in wrapped
    return func(*args, **kw)
  File "/home/chris/TorSpider/backend/venv/lib/python3.5/site-packages/flask_restless/views.py", line 1499, in patch
    content_is_json = content_type.startswith('application/json')
AttributeError: 'NoneType' object has no attribute 'startswith'
@haxys haxys added the bug Something isn't working label Mar 2, 2018
@haxys haxys added this to the Stable Version 1.0 milestone Mar 2, 2018
@haxys
Copy link
Contributor Author

haxys commented Mar 2, 2018

From the spider:

2018-03-01 19:15:30,460 - INFO - Maryann: Ready to explore!
2018-03-01 19:15:30,470 - DEBUG - Maryann: Running GET Query on endpoint: next
2018-03-01 19:15:30,752 - DEBUG - Maryann: GET Query successful for endpoint: next
2018-03-01 19:15:30,762 - DEBUG - Maryann: Found next url: 7cbqhjnlkivmigxf.onion
2018-03-01 19:15:30,770 - DEBUG - Maryann: Updating onion: 7cbqhjnlkivmigxf.onion data: {"scan_date": "2018-03-01", "last_node": "c9e623b4c69d4b1e"}
2018-03-01 19:15:30,983 - DEBUG - Maryann: Update failed: 7cbqhjnlkivmigxf.onion
2018-03-01 19:15:30,989 - DEBUG - Maryann: Getting head of url: http://7cbqhjnlkivmigxf.onion/

@haxys
Copy link
Contributor Author

haxys commented Mar 2, 2018

I wiped everything and started with a fresh database and fresh installation, both frontend and backend, and can't reproduce this error.

@haxys haxys closed this as completed Mar 2, 2018
@artagel
Copy link
Member

artagel commented Mar 2, 2018

AttributeError: 'NoneType' object has no attribute 'startswith' indicates that you weren't sending any headers or able to see the headers in flask, so it evaluated against headers of "None". Odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants