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

"error": "network5", HTTP Error 400 (Bad Request) #848

Open
pasindu-gamarachchi opened this issue Dec 17, 2018 · 6 comments
Open

"error": "network5", HTTP Error 400 (Bad Request) #848

pasindu-gamarachchi opened this issue Dec 17, 2018 · 6 comments

Comments

@pasindu-gamarachchi
Copy link

I am trying to render the html of a website and keep getting the following error on the browser.

HTTP Error 400 (Bad Request)
Type: ScriptError -> LUA_ERROR
Error happened while executing Lua script
Lua error: [string "function main(splash, args) ..."]:3: network5

{
"description": "Error happened while executing Lua script",
"type": "ScriptError",
"error": 400,
"info": {
"type": "LUA_ERROR",
"line_number": 3,
"message": "Lua error: [string "function main(splash, args)\r..."]:3: network5",
"error": "network5",
"source": "[string "function main(splash, args)\r..."]"
}
}

The lua script I'm running is as follows:

function main(splash, args)
splash.resource_timeout = 10.0
assert(splash:go(args.url))
assert(splash:wait(2.5))
return {
html = splash:html(),
png = splash:png(),
har = splash:har(), } end`

This error seems to occur mainly on this site, and splash renders the html for most other sites.
The following are the versions I'm using :
Splash version: 3.2
Qt 5.9.1, PyQt 5.9, WebKit 602.1, sip 4.19.3, Twisted 16.1.1, Lua 5.2
Python 3.5.2 (default, Nov 23 2017, 16:37:01) [GCC 5.4.0 20160609]

Any help is appreciated.

@Mideen
Copy link

Mideen commented Dec 27, 2018

Could you please mention your input URL here... @pasindu-gamarachchi

@pasindu-gamarachchi
Copy link
Author

@phongtnit
Copy link

phongtnit commented Jan 22, 2019

I had same error with another website, please refer the following image

My env:
MacOS: 10.14.2
Docker: 18.06.1-ce
Splash: 3.2 via docker command: docker run -it -p 8050:8050 scrapinghub/splash --max-timeout 3600

@simonsez
Copy link

And the same error on this site: https://www.csb123.com/deposit-accounts/interest-rates/ - any update here?

@SingleSele
Copy link

This problem is caused by the assert() function in the line 2 of the Lua script, meaning that the HTTP request failed. Sadly, no more information is provided.
I encountered the problem and I found out that my docker container had no network connection. Finally I used sudo docker run –network=host -it -p 8050:8050 --rm scrapinghub/splash. I don't know why it works, but it works.

@SingleSele
Copy link

And this problem only occurs in a few environments. I can set up splash service easily on my own computer with default settings, but i met with this error on my remote virtual machine.

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

5 participants