trickme-interface icon indicating copy to clipboard operation
trickme-interface copied to clipboard

Failed to load resource error

Open GeneralPoxter opened this issue 3 years ago • 7 comments

I followed the instructions for setup and trained my own RNN guesser via Qanta. However, after running gunicorn, downloading the qanta sqlite3 db, starting server.py, and loading the rnn, I encountered the following errors on the frontend: Screenshot from 2021-04-20 22-56-56

There are no files in the logs folder for debugging.

GeneralPoxter avatar Apr 23 '21 01:04 GeneralPoxter

Is this a firewall issue? Or perhaps a URL needs to be updated?

ezubaric avatar Apr 23 '21 01:04 ezubaric

Possibly. I'm running this in chrome browser, but even with the "Allow invalid certificates for resources loaded from localhost" flag enabled and all extensions disabled, it is still having trouble with CORS, namely access control. It seems it does not trust write.qanta.org?

I also tried running this in the GNOME Web browser, but that browser would not load "due to access control checks".

GeneralPoxter avatar Apr 23 '21 03:04 GeneralPoxter

It would be helpful if you listed the commands you ran and on which machine you ran them (eg on laptop versus not).

It would seem though that the write.qanta.org path is hard coded here, which is at least one issue (easily fixed though)

https://github.com/Eric-Wallace/trickme-interface/blob/c47fa53efa6365e001bb1bb52279ea65ed8678f8/interface/templates/server.html#L441

EntilZha avatar Apr 23 '21 15:04 EntilZha

I ran the commands exactly as they were described in the README, expect I loaded QANTA through the poetry virtual env from the qanta repo since I didn't want to reinstall torch. I used a desktop PC.

GeneralPoxter avatar Apr 23 '21 15:04 GeneralPoxter

Can you please given the exact you commands (copy / paste) and the output that you got with each command?

ezubaric avatar Apr 23 '21 17:04 ezubaric

In interface, I ran gunicorn --bind 0.0.0.0:7000 web_server:app --workers 4:

[2021-04-23 13:30:03 -0400] [35296] [INFO] Starting gunicorn 20.1.0
[2021-04-23 13:30:03 -0400] [35296] [INFO] Listening at: http://0.0.0.0:7000 (35296)
[2021-04-23 13:30:03 -0400] [35296] [INFO] Using worker: sync
[2021-04-23 13:30:03 -0400] [35302] [INFO] Booting worker with pid: 35302
[2021-04-23 13:30:03 -0400] [35303] [INFO] Booting worker with pid: 35303
[2021-04-23 13:30:03 -0400] [35304] [INFO] Booting worker with pid: 35304
[2021-04-23 13:30:03 -0400] [35305] [INFO] Booting worker with pid: 35305
[2021-04-23 13:30:24 -0400] [35296] [INFO] Handling signal: winch

In non_qanta, I ran python server.py:

 * Serving Flask app "server" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)

In the qanta poetry virtual env, I ran the following python file load.py:

import qanta.guesser.rnn 
RnnGuesserLocal = qanta.guesser.rnn.RnnGuesser.load('/home/poxter/qb/output/guesser/qanta.guesser.rnn.RnnGuesser/0')
RnnGuesserLocal.web_api(port=6000)

python load.py:

/home/poxter/.cache/pypoetry/virtualenvs/qanta-virId68h-py3.9/lib/python3.9/site-packages/torch/nn/modules/rnn.py:60: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.265 and num_layers=1
  warnings.warn("dropout option adds dropout after all but last "
 * Serving Flask app "qanta.guesser.rnn" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://0.0.0.0:6000/ (Press CTRL+C to quit)

The above is all that's in the output before the local host times out due to long response time.

GeneralPoxter avatar Apr 23 '21 17:04 GeneralPoxter

I noticed that commenting out these http to https redirect lines in the interface server template kept it from timing out for me: https://github.com/Eric-Wallace/trickme-interface/blob/master/interface/templates/server.html#L323-L329

keithcallenberg avatar Jun 02 '21 02:06 keithcallenberg