-1

my selenium code works fine if I run directly in local. But when I start Nginx and if code triggers selenium driver then it's not able to open.

DEBUG:selenium.webdriver.remote.remote_connection:POST http://127.0.0.1:45283/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserNam
e": "chrome", "platformName": "any", "goog:chromeOptions": {"prefs": {"download.default_directory": "/home/cloud_sriniakhil/flaskapp/downloads", "downl
oad.prompt_for_download": false, "directory_upgrade": true, "safebrowsing.enabled": true}, "extensions": [], "args": ["--headless"]}}}, "desiredCapabil
ities": {"browserName": "chrome", "version": "", "platform": "ANY", "goog:chromeOptions": {"prefs": {"download.default_directory": "/home/cloud_sriniak
hil/flaskapp/downloads", "download.prompt_for_download": false, "directory_upgrade": true, "safebrowsing.enabled": true}, "extensions": [], "args": ["-
-headless"]}}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:45283
DEBUG:urllib3.connectionpool:http://127.0.0.1:45283 "POST /session HTTP/1.1" 500 357
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request



It shows urllib3.connectionpool:http://127.0.0.1:45283 "POST /session HTTP/1.1" 500 357 but when i run normally in localhost i get status 200. My guess is nginx is not allowing to use that port.

i am deploying my project first time on the cloud and any help would be really helpful Thanks

1 Answers1

0

This error message...

DEBUG:urllib3.connectionpool:http://127.0.0.1:45283 "POST /session HTTP/1.1" 500 357

...implies that the HTTP POST /session HTTP/1.1 returned 500 Internal Server Error.


500 Internal Server Error

As per the documentation 500 Internal Server Error server error response code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. Additionally, this error response is a generic response and this error indicates the server cannot find a better 5xx error code to respond.

A bit more detailed error response like the 500 status code with more details about the request wouldhave helped us to debug the issue and suggest a canonical solution to prevent the error from happening again in the future.


References

You can find a couple of relevant detailed discussions in:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352