Can't open google chrome with selenium on bitnami

Keywords: Django - AWS - Technical issue - Other

bnsupport ID: 91128509-b11e-a11e-5dea-2808fbadc6ef

bndiagnostic output:

? Resources: Found possible issues

bndiagnostic failure reason: The tool could not find any issue

Description:
Hi everyone!
First of all sorry for my english (is not my native language)
Im developing an app on Django that works perfectly on my local machine.
The app run well into bitnami except when try to open a new window using selenium.
This is the code that launch the error on my server:

browser  = webdriver.Chrome(ChromeDriverManager().install())
browser.maximize_window()

i receive the following error:

====== WebDriver manager ======
Current google-chrome version is 93.0.4577
Get LATEST driver version for 93.0.4577
Driver [/home/bitnami/.wdm/drivers/chromedriver/linux64/93.0.4577.63/chromedriver] found in cache
Internal Server Error: /automatizaOrden
...
...
(unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

If i add to my code

...
chrome_options = Options()
chrome_options.add_argument('--headless')
...
browser  = webdriver.Chrome(ChromeDriverManager().install(),chrome_options=chrome_options)
browser.maximize_window()

i have no errors, but no window opens in navigator.

I tried too to open google-chrome on bitnami, but recive the following error:

bitnami@ip-172-26-??-???:/opt/bitnami/projects/webOpos$google-chrome
[23366:23366:0910/191118.378221:ERROR:browser_main_loop.cc(1409)] Unable to open X display.
bitnami@ip-172-26-11-185:/opt/bitnami/projects/webOpos

Any idea?
Maybe is not possible do that i want? I need to open a window browser because the app wait to user to register in some page and then the app fill automatically some stuffs

Thanks in advance

Hi @an0nio,

It doesn’t seem related to the Bitnami configuration. Chrome is expecting an X server to be running and it can’t find one. I would ask in a dedicated Selenium forum:

https://www.qualitytesting.info/forum/topic/listForTag?tag=selenium

I found the following thread in StackOverflow that might help you:

https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t

Regards,
Michiel

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.