my8100 / scrapydweb

Web app for Scrapyd cluster management, Scrapy log analysis & visualization, Auto packaging, Timer tasks, Monitor & Alert, and Mobile UI. DEMO :point_right:
https://github.com/my8100/files
GNU General Public License v3.0
3.16k stars 565 forks source link

Http 400 when trying to access #200

Open rpinheiro-home opened 2 years ago

rpinheiro-home commented 2 years ago

I followed the initial guide step by step and when trying to access the initial URL I get an http code 400 and in the log only a json appears containing: node:1

What am I missing?

It's more a question than an issue Thanks

rpinheiro-home commented 2 years ago

image

rpinheiro-home commented 2 years ago
[2022-04-12 10:40:48,667] DEBUG    in IndexView: view_args of http://XXX.XXX.XXX.XXX:5000/
{
    "node": 1
}
[2022-04-12 10:40:48,668] INFO     in werkzeug: XXX.XXX.XXX.XXX- - [12/Apr/2022 10:40:48] "GET / HTTP/1.1" 400 -
rpinheiro-home commented 2 years ago

I don't know exactly why (because I don`t know flask) but commented this lines and now I can acess.

        # if app.testing:
        # self.logger.debug('view_args of %s\n%s', request.url, self.json_dumps(request.view_args))
        # if request.args:
        #     self.logger.debug('request.args of %s\n%s', request.url, self.json_dumps(request.args))
        # if request.form:
        #     self.logger.debug('request.form from %s\n%s', request.url, self.json_dumps(request.form))
        # if request.json:
        #     self.logger.debug('request.json from %s\n%s', request.url, self.json_dumps(request.json))
        # if request.files:
        #     self.logger.debug('request.files from %s\n\n    %s\n', request.url, request.files)
Pandaaaa906 commented 2 years ago

it's seem that werkzeug 2.1.0 got some break change about request.json you can just specific werkzeug version to 2.0.3 will sovle the case https://github.com/pallets/werkzeug/issues/2339

cced3000 commented 2 years ago

thanks @Pandaaaa906 ,I solved the problem through your suggestion,pip install Werkzeug==2.0.3

espoirMur commented 2 years ago

thanks @Pandaaaa906 ,I solved the problem through your suggestion,pip install Werkzeug==2.0.3

Thanks you..

Ngounse commented 2 years ago

Http 400 when trying to access i got the same problem Screenshot from 2022-05-10 16-21-12

and this what in terminal I get `[2022-05-10 16:23:21,104] INFO in werkzeug: * Running on all addresses (0.0.0.0) WARNING: This is a development server. Do not use it in a production deployment.

Ngounse commented 2 years ago

please help

casual-silva commented 2 years ago

Http 400 when trying to access i got the same problem Screenshot from 2022-05-10 16-21-12

and this what in terminal I get `[2022-05-10 16:23:21,104] INFO in werkzeug: * Running on all addresses (0.0.0.0) WARNING: This is a development server. Do not use it in a production deployment.

Bad Request The browser (or proxy) sent a request that this server could not understand.

我也遇到了同样的问题 我的机器是ubuntu18.04
但是在本地windows 是正常加载的 不知道什么原因

I ran into the same problem with ubuntu18.04 But Windows loads normally locally for unknown reason

Ngounse commented 2 years ago

Http 400 when trying to access i got the same problem Screenshot from 2022-05-10 16-21-12 and this what in terminal I get `[2022-05-10 16:23:21,104] INFO in werkzeug: * Running on all addresses (0.0.0.0) WARNING: This is a development server. Do not use it in a production deployment.

Bad Request The browser (or proxy) sent a request that this server could not understand.

我也遇到了同样的问题 我的机器是ubuntu18.04 但是在本地windows 是正常加载的 不知道什么原因

I ran into the same problem with ubuntu18.04 But Windows loads normally locally for unknown reason Thank you your help

i'm running on zorin os 16 ( ubuntu 20.0.4 base) i been try to fix it but get no where

casual-silva commented 2 years ago

I solved the problem to locate the source code and found it was caused by the Werkzeug version problem As he said, @pandaaaa906 can be solved by lowering Werkzeug

Reinstall >> pip install Werkzeug==2.0.2

Ngounse commented 2 years ago

I solved the problem to locate the source code and found it was caused by the Werkzeug version problem As he said, @Pandaaaa906 can be solved by lowering Werkzeug

Reinstall >> pip install Werkzeug==2.0.2

it's work now @casual-silva thank you a lot

Nirav-Ironlist commented 2 years ago

I also Solve same problem by your suggestion.Thank You

thanks @Pandaaaa906 ,I solved the problem through your suggestion,pip install Werkzeug==2.0.3

minikiller commented 2 years ago

I pip install Werkzeug==2.0.3,but got following error:

Traceback (most recent call last):
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/bin/scrapydweb", line 5, in <module>
    from scrapydweb.run import main
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/scrapydweb/__init__.py", line 9, in <module>
    from flask import Flask, current_app, render_template, url_for
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/__init__.py", line 4, in <module>
    from . import json as json
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/json/__init__.py", line 8, in <module>
    from ..globals import current_app
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/globals.py", line 56, in <module>
    app_ctx: "AppContext" = LocalProxy(  # type: ignore[assignment]
TypeError: __init__() got an unexpected keyword argument 'unbound_message'
Ngounse commented 2 years ago

venv

I saw it complain from flask maybe that the problem here my flask --v Flask==2.1.2

Ngounse commented 2 years ago

can i also see you pip freeze

Resalee commented 2 years ago

I pip install Werkzeug==2.0.3,but got following error:

Traceback (most recent call last):
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/bin/scrapydweb", line 5, in <module>
    from scrapydweb.run import main
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/scrapydweb/__init__.py", line 9, in <module>
    from flask import Flask, current_app, render_template, url_for
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/__init__.py", line 4, in <module>
    from . import json as json
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/json/__init__.py", line 8, in <module>
    from ..globals import current_app
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/globals.py", line 56, in <module>
    app_ctx: "AppContext" = LocalProxy(  # type: ignore[assignment]
TypeError: __init__() got an unexpected keyword argument 'unbound_message'

I have the same problem, did you find out how to fix it?

Resalee commented 2 years ago

@minikiller I tried to use docker images from dockerhub, and it worked, this one => https://hub.docker.com/r/ryanvin/scrapydweb

afc3liuyuan commented 2 years ago

I pip install Werkzeug==2.0.3,but got following error:

Traceback (most recent call last):
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/bin/scrapydweb", line 5, in <module>
    from scrapydweb.run import main
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/scrapydweb/__init__.py", line 9, in <module>
    from flask import Flask, current_app, render_template, url_for
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/__init__.py", line 4, in <module>
    from . import json as json
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/json/__init__.py", line 8, in <module>
    from ..globals import current_app
  File "/Users/sunlingfeng/guolu/study-scrapy/bookscraper/.venv/lib/python3.8/site-packages/flask/globals.py", line 56, in <module>
    app_ctx: "AppContext" = LocalProxy(  # type: ignore[assignment]
TypeError: __init__() got an unexpected keyword argument 'unbound_message'

I have the same problem, did you find out how to fix it?

please see: https://github.com/my8100/scrapydweb/issues/202 you can set the flask version to 2.0.2 and Werkzeug version to 2.0.2 by reinstalling.

afc3liuyuan commented 2 years ago

Thanks @PandyYang please see: https://github.com/my8100/scrapydweb/issues/202

reinstall the flask version to 2.0.2 and Werkzeug version to 2.0.2 can resolve this problem.