Issue: Executing the JupyterLite example “animal_csv_import.ipynb” causes an OSError: Request for https://localhost/api/taxonomy_term/animal_type failed with status 500: 500 Service unavailable (with message)
The traceback log of “animal_csv_import.ipynb” in JupyterLite reports a failure in /lib/python3.9 (the Pyolite kernel of JupyterLite?), but a few lines below there is a reference to python 3.8 which is my default python installation. Is there a conflict?
File /lib/python3.9/site-packages/pyodide/http.py:139, in FetchResponse.json(self, **kwargs)
133 async def json(self, **kwargs) -> Any:
134 """Return the response body as a Javascript JSON object.
135
136 Any keyword arguments are passed to `json.loads
137 <https://docs.python.org/3.8/library/json.html#json.loads>`_.
138 """
--> 139 self._raise_if_failed()
@Symbioquine I’m one step further now. If I remove the bold part below from the HTTP request, then it works. Do you have an idea what the root cause might be?
I don’t see anything obviously wrong. That’s an interesting clue about removing those headers, but I don’t have a ready hypothesis about why those would be a problem. I just checked and my requests (which are working) also include similar headers to those.
Are you willing to share your NGINX reverse proxy configuration?
Solution: JSON API resp. JupyterLite can be used only, if no user is concurrently logged in in FarmOS.
Hmmm, that’s strange. I just did a bit of testing and I can’t reproduce that behavior. (I tested with multiple separate users and the same user from a separate browser session while re-running the example in JupyterLite which retrieves/creates the animal taxonomy - it worked every time.)