Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Can we run a workflow with chromiumdriver.exe in python tool on the server?

knozawa
11 - Bolide

Hello,

 

Would it be possible to run a workflow that contains python tool with chromiumdriver.exe on Alteryx server?

The workflow is to scrape website using selenium by opening and scroll down a chrome browser.

It runs fine on designer, but it gives me an error message when I tried to run the workflow on server.

 

SessionNotCreatedException: Message: session not created from disconnected: Unable to receive message from renderer (Session info: chrome=92.0.4515.107)

7 REPLIES 7
RishiK
Alteryx
Alteryx

@knozawa does the Alteryx Server machine have the chromium driver installed? I assume you downloaded it from 

 
My colleague @DavidM wrote an interesting article related to this a while back, could you test out this workflow to see if it works?

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Python-Code-Tool-Web-Scraping-Dynamic-...
knozawa
11 - Bolide

@RishiK 

 

Thank you for replying.  Yes, I installed the chromium driver at the same file path on the server machine.

 

This is how I am defining the path for the exe location:

options = webdriver.ChromeOptions();
options.add_argument("--no-sandbox")
options.add_argument("start-maximized");
wd = webdriver.Chrome(options=options,executable_path="C:/Temp/chromedriver.exe")
wd.get(webpage)

 

I actually followed the article to implement this.  The article was awesome.  It worked on the desktop, but not on the Alteryx server through browser.

RishiK
Alteryx
Alteryx

@knozawa to rule this out, do you know if this works fine on the Designer that is installed on the Server machine itself?

knozawa
11 - Bolide

@RishiK 

 

Yes. The workflow ran successfully on the designer on the server machine.  So, I'm not sure why I still get the error when I try to run the workflow through the browser.

 

Sincerely,

knozawa

RishiK
Alteryx
Alteryx

@knozawa it seems that the Chrome Driver is not able to kick off a new browser. Im wondering whether its the way you have defined the web driver and how its running on the Server.

wd = webdriver.Chrome(options=options,executable_path="C:/Temp/chromedriver.exe"

Could you try to convert the path into a UNC format, so we don't refer to the "C" drive, but the UNC version.

Here's a bit more info on this:

https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/Workflow-Dependencies/ta-p/49696

It might also be a firewall/virus scan issue that's blocking this.

knozawa
11 - Bolide

@RishiK 

Thank you for your suggestions!

 

I cleaned up the disk space on the server machine. I also updated the location of the exe file to use the network drive instead of C drive. After that, the workflow successfully ran on the browser. I'm not sure why C drive did not work because I thought C:/Temp is the UNC format, but the network drive worked.

 

Sincerely,

knozawa

Jafar
7 - Meteor

I have created a process where Alteryx download CSV file from a website using Selenium, Chrome libraries.
However, when I execute it on designer its working fine but when I deploy it on server I am getting an error.
Server is not able to read path of Chromium.
I tried on local path as well as on share drive.
I need to understand how to add path on Workflow dependencies directly.
Since my path is mentioned in pyhton script.

Refer code snippet: 

 

from ayx import Alteryx
from ayx import Package
!pip install selenium
!pip install webdriver_manager
!pip install tqdm
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait

from selenium import webdriver
from selenium.webdriver.support.select import Select
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

# driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
# driver = webdriver.Chrome("C:/Program Files/Alteryx/bin/Plugins/chromedriver.exe")
driver = webdriver.Chrome("A:/chromedriver_win32/chromedriver.exe")
driver.get("https://publicdata.adx.ae/_layouts/15/ReportServer/RSViewerPageadxpublic.aspx?rv:RelativeReportUrl=/...")

WebDriverWait(driver,30);

time.sleep(5)

 

 

Error log 

 

WebDriverException Traceback (most recent call last) <ipython-input-2-8a12728b3852> in <module> 16 # driver = webdriver.Chrome("C:/Program Files/Alteryx/bin/Plugins/chromedriver.exe") 17 driver = webdriver.Chrome("A:/chromedriver_win32/chromedriver.exe") ---> 18 driver.get("https://publicdata.adx.ae/_layouts/15/ReportServer/RSViewerPageadxpublic.aspx?rv:RelativeReportUrl=/...") 19 20 WebDriverWait(driver,30); c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\selenium\webdriver\remote\webdriver.py in get(self, url) 453 Loads a web page in the current browser session. 454 """ --> 455 self.execute(Command.GET, {"url": url}) 456 457 @property c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\selenium\webdriver\remote\webdriver.py in execute(self, driver_command, params) 442 response = self.command_executor.execute(driver_command, params) 443 if response: --> 444 self.error_handler.check_response(response) 445 response["value"] = self._unwrap_value(response.get("value", None)) 446 return response c:\program files\alteryx\bin\miniconda3\envs\designerbasetools_venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py in check_response(self, response) 247 alert_text = value["alert"].get("text") 248 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here --> 249 raise exception_class(message, screen, stacktrace) WebDriverException: Message: unknown error: net::ERR_CONNECTION_TIMED_OUT (Session info: chrome=100.0.4896.60) Stacktrace: Backtrace: Ordinal0 [0x00E37413+2389011] Ordinal0 [0x00DC9F61+1941345] Ordinal0 [0x00CBC658+837208] Ordinal0 [0x00CB8F28+823080] Ordinal0 [0x00CAE27D+778877] Ordinal0 [0x00CAEE3D+781885] Ordinal0 [0x00CAE48A+779402] Ordinal0 [0x00CADA86+776838] Ordinal0 [0x00CAC995+772501] Ordinal0 [0x00CACE6D+773741] Ordinal0 [0x00CBDE5A+843354] Ordinal0 [0x00D149BD+1198525] Ordinal0 [0x00D0414C+1130828] Ordinal0 [0x00D14302+1196802] Ordinal0 [0x00D03F66+1130342] Ordinal0 [0x00CDE546+976198] Ordinal0 [0x00CDF456+980054] GetHandleVerifier [0x00FE9632+1727522] GetHandleVerifier [0x0109BA4D+2457661] GetHandleVerifier [0x00ECEB81+569713] GetHandleVerifier [0x00ECDD76+566118] Ordinal0 [0x00DD0B2B+1968939] Ordinal0 [0x00DD5988+1989000] Ordinal0 [0x00DD5A75+1989237] Ordinal0 [0x00DDECB1+2026673] BaseThreadInitThunk [0x75CC6709+25] RtlGetFullPathName_UEx [0x779F7D1D+173] RtlGetFullPathName_UEx [0x779F7CEB+123] (ToolId: 1)