new octomode file breaks octomode #33

Open
opened 2023-12-19 15:01:34 +01:00 by ccl · 2 comments

The error that appears is

urllib.error.HTTPError

urllib.error.HTTPError: HTTP Error 401: Unauthorized
Traceback (most recent call last)

File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 2091, in __call__

return self.wsgi_app(environ, start_response)

File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 2076, in wsgi_app

response = self.handle_exception(e)

File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 2073, in wsgi_app

response = self.full_dispatch_request()

File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 1518, in full_dispatch_request

rv = self.handle_user_exception(e)

File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 1516, in full_dispatch_request

rv = self.dispatch_request()

File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 1502, in dispatch_request

return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)

File "/srv/octomode/octomode.py", line 110, in index

create_pad_on_first_run(name, ext)

File "/srv/octomode/octomode.py", line 55, in create_pad_on_first_run

pads = all_pads()

File "/srv/octomode/octomode.py", line 50, in all_pads

response = json.load(urlopen(f"{ APP.config['PAD_API_URL'] }/{ api_call }", data=urlencode(arguments).encode()))

File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen

return opener.open(url, data, timeout)

File "/usr/lib/python3.11/urllib/request.py", line 525, in open

response = meth(req, response)

File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response

response = self.parent.error(

File "/usr/lib/python3.11/urllib/request.py", line 563, in error

return self._call_chain(*args)

File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain

result = func(*args)

File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default

raise HTTPError(req.full_url, code, msg, hdrs, fp)

urllib.error.HTTPError: HTTP Error 401: Unauthorized

The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.

To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object
The error that appears is urllib.error.HTTPError urllib.error.HTTPError: HTTP Error 401: Unauthorized Traceback (most recent call last) File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 2091, in __call__ return self.wsgi_app(environ, start_response) File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 2076, in wsgi_app response = self.handle_exception(e) File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/srv/octomode/.venv/lib/python3.11/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/srv/octomode/octomode.py", line 110, in index create_pad_on_first_run(name, ext) File "/srv/octomode/octomode.py", line 55, in create_pad_on_first_run pads = all_pads() File "/srv/octomode/octomode.py", line 50, in all_pads response = json.load(urlopen(f"{ APP.config['PAD_API_URL'] }/{ api_call }", data=urlencode(arguments).encode())) File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.11/urllib/request.py", line 525, in open response = meth(req, response) File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response response = self.parent.error( File "/usr/lib/python3.11/urllib/request.py", line 563, in error return self._call_chain(*args) File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain result = func(*args) File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 401: Unauthorized The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side. You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection: dump() shows all variables in the frame dump(obj) dumps all that's known about the object
Collaborator

@ccl

urllib.error.HTTPError: HTTP Error 401: Unauthorized

I think that means your API key might be invalid or it somehow can't get the correct permissions for the requests it needs to do.

@ccl > urllib.error.HTTPError: HTTP Error 401: Unauthorized I think that means your API key might be invalid or it somehow can't get the correct permissions for the requests it needs to do.

I fixed the API key but this function is ran when you make a new document or start octomode for the first time?
47e535b9e6/octomode.py (L50)
asks for a list of all pads and that doesn't work anymore because this list is too long.

I fixed the API key but this function is ran when you make a new document or start octomode for the first time? https://git.vvvvvvaria.org/varia/octomode/src/commit/47e535b9e65544b819a4af56bc7563b54b14e8a1/octomode.py#L50 asks for a list of all pads and that doesn't work anymore because this list is too long.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: CC/octomode#33
No description provided.