lit icon indicating copy to clipboard operation
lit copied to clipboard

400 error: Path is not safe

Open andrewschreiber opened this issue 6 years ago • 8 comments

I get this error after running the demo command python -m lit_nlp.examples.quickstart_sst_demo --port=5432. I am able to complete training, but when I open up localhost:5432 I see this:

image

Here is where the error is triggered (defined later in the file too): https://github.com/PAIR-code/lit/blob/437df8d5907efe6c1ebb10ef2a161d2749aa3522/lit_nlp/lib/wsgi_app.py#L136

andrewschreiber avatar Sep 14 '20 21:09 andrewschreiber

image

andrewschreiber avatar Sep 14 '20 21:09 andrewschreiber

Thanks for reaching out. From what directory are you running the python command to launch the demo? It may be due to not running the demo from a parent directory of where the demo was installed.

jameswex avatar Sep 14 '20 23:09 jameswex

I was running from the root project directory (~/git/lit in my case) after pip install lit-nlp.

I wound up building from source, and the tool is now working. Will try the parent directory approach if I go back to using the PyPI package.

andrewschreiber avatar Sep 14 '20 23:09 andrewschreiber

Thanks. The pip package is new and its possible we will need to update the PathIsSafe code to account for where the code would live when pip-installed.

jameswex avatar Sep 15 '20 12:09 jameswex

I encountered the same error when I tried to run my own demo. Copying the 'lit_nlp' folder into the folder from where I want to run demo.py worked for me.

YokoHono avatar Oct 12 '20 15:10 YokoHono

# Ubuntu 18.04

cd /usr/local/lib/python3.7/dist-packages

codingpy avatar Oct 17 '20 11:10 codingpy

Thanks. The pip package is new and its possible we will need to update the PathIsSafe code to account for where the code would live when pip-installed.

This sounds good, I think users will expect to be able to pip install and write a script to spin up the server from within a project.

lagph avatar Oct 27 '20 15:10 lagph

Will be fixed by #149

jameswex avatar Nov 16 '20 16:11 jameswex