Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http 400 when trying to access #200

Open
rpinheiro-home opened this issue Apr 11, 2022 · 20 comments
Open

Http 400 when trying to access #200

rpinheiro-home opened this issue Apr 11, 2022 · 20 comments

Comments

@rpinheiro-home
Copy link

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
Copy link
Author

image

@rpinheiro-home
Copy link
Author

[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
Copy link
Author

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
Copy link

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
pallets/werkzeug#2339

@cced3000
Copy link

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

@espoirMur
Copy link

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

Thanks you..

@Ngounse
Copy link

Ngounse commented May 10, 2022

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
Copy link

Ngounse commented May 10, 2022

please help

@casual-silva
Copy link

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
Copy link

Ngounse commented May 11, 2022

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
Copy link

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
Copy link

Ngounse commented May 11, 2022

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
Copy link

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
Copy link

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
Copy link

Ngounse commented Sep 1, 2022

venv

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

@Ngounse
Copy link

Ngounse commented Sep 1, 2022

can i also see you
pip freeze

@Resalee
Copy link

Resalee commented Sep 1, 2022

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
Copy link

Resalee commented Sep 1, 2022

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

@afc3liuyuan
Copy link

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: #202
you can set the flask version to 2.0.2 and Werkzeug version to 2.0.2 by reinstalling.

@afc3liuyuan
Copy link

Thanks @PandyYang
please see: #202

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants