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 another console stop taxonomy_api container (docker-compose stop taxonomy_api)
Start the api within your control: docker-compose run --rm --use-aliases --service-ports taxonomy_api (the --use-aliases make it available as taxonomy_api in the internal network, so frontend can reach it.)
Put a import pdb;pdb.set_trace() at a point in your code and save (this should make the server reload)
Do you query in the browser… in the console you will have the pdb handle.
I added the pdb statement in import_from_github function. Had tried debugging already so knew this function fails.
Sharing the pdb logs:
INFO:uvicorn.error:Application startup complete.
> /code/editor/entries.py(110)import_from_github()
-> "https://raw.githubusercontent.com/openfoodfacts/openfoodfacts-server"
(Pdb) n
> /code/editor/entries.py(109)import_from_github()
-> base_url = (
(Pdb) n
> /code/editor/entries.py(114)import_from_github()
-> filename = self.taxonomy_name + ".txt"
(Pdb) n
> /code/editor/entries.py(115)import_from_github()
-> base_url += filename
(Pdb) n
> /code/editor/entries.py(116)import_from_github()
-> try:
(Pdb) p base_url
'https://raw.githubusercontent.com/openfoodfacts/openfoodfacts-server/main/taxonomies/improvements.txt'
(Pdb) n
> /code/editor/entries.py(117)import_from_github()
-> with tempfile.TemporaryDirectory(prefix="taxonomy-") as tmpdir:
(Pdb) n
> /code/editor/entries.py(120)import_from_github()
-> filepath = f"{tmpdir}/{filename}"
(Pdb) p filepath
*** NameError: name 'filepath' is not defined
(Pdb) p tmpdir
'/tmp/taxonomy-11yamyfa'
(Pdb) n
> /code/editor/entries.py(123)import_from_github()
-> urllib.request.urlretrieve(base_url, filepath)
(Pdb) n
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:1129)>
> /code/editor/entries.py(123)import_from_github()
-> urllib.request.urlretrieve(base_url, filepath)
(Pdb) n
> /code/editor/entries.py(125)import_from_github()
-> status = await self.parse_taxonomy(filepath) # Parse the taxonomy
(Pdb) p status
*** NameError: name 'status' is not defined
(Pdb) n
> /code/editor/entries.py(131)import_from_github()
-> except Exception as e:
(Pdb) n
> /code/editor/entries.py(132)import_from_github()
-> raise TaxnonomyImportError() from e
(Pdb) p e
URLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))
(Pdb) n
editor.exceptions.TaxnonomyImportError: Unable to fetch the given taxonomy from GitHub
> /code/editor/entries.py(132)import_from_github()
-> raise TaxnonomyImportError() from e
(Pdb) p e
URLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))
(Pdb) n
> /code/editor/entries.py(132)import_from_github()
-> raise TaxnonomyImportError() from e
(Pdb) p e
URLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1129)'))
(Pdb) n
Internal StopIteration: False
> /usr/local/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py(21)__call__()
-> raise e
(Pdb) n
Internal StopIteration
> /usr/local/lib/python3.9/site-packages/starlette/middleware/base.py(71)coro()
-> app_exc = exc
(Pdb) n
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/lib/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/local/lib/python3.9/http/client.py", line 980, in send
self.connect()
File "/usr/local/lib/python3.9/http/client.py", line 1454, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/usr/local/lib/python3.9/ssl.py", line 501, in wrap_socket
return self.sslsocket_class._create(
File "/usr/local/lib/python3.9/ssl.py", line 1041, in _create
self.do_handshake()
File "/usr/local/lib/python3.9/ssl.py", line 1310, in do_handshake
self._sslobj.do_handshake()
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1129)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/code/./editor/entries.py", line 123, in import_from_github
urllib.request.urlretrieve(base_url, filepath)
File "/usr/local/lib/python3.9/urllib/request.py", line 239, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/local/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.9/urllib/request.py", line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/local/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error EOF occurred in violation of protocol (_ssl.c:1129)>
Expected behavior
A node should be created.
Platform (Desktop, Mobile, Hunger Games)
OS: Windows 11
Platform
The text was updated successfully, but these errors were encountered:
What
When creating a node at: http://ui.taxonomy.localhost:8091/startproject
The following error occurs:
Steps to reproduce the behavior:
Thanks to @alexgarel for helping me debug.
He shared the following commands to debug in Slack channel. (For more details, head to issue first described in Slack):
docker-compose up
)docker-compose stop taxonomy_api
)docker-compose run --rm --use-aliases --service-ports taxonomy_api
(the--use-aliases
make it available as taxonomy_api in the internal network, so frontend can reach it.)import pdb;pdb.set_trace()
at a point in your code and save (this should make the server reload)I added the pdb statement in import_from_github function. Had tried debugging already so knew this function fails.
Sharing the pdb logs:
Expected behavior
A node should be created.
Platform (Desktop, Mobile, Hunger Games)
The text was updated successfully, but these errors were encountered: