I have been using replit to run a python selenium based project of mine, however after creating a new replit, adding in chromium/chrome driver in the nix files manually, I have run into several instances of this error.
“cannot create temp dir for user data dir”
Changing the name of the replit would often fix the issue until the error would pop up again. The issue with this temporary fix is just that, it is temporary. I have a Hacker plan which allows the replit to stay on 24/7 but I would have to manually check daily to make sure the driver is actually being opened. I frequently get this error which makes me have to rename the replit in order for it to work after rebooting. I looked online and some people suggested it has something to do with your TEMP folder. I couldn’t find anything on how to handle this error within Replit, so I am posting it here in hopes anyone is able to help.
Traceback (most recent call last):
File “main.py”, line 814, in main
File “main.py”, line 746, in runRewards
driver = getDriver()
File “main.py”, line 513, in getDriver
driver = webdriver.Chrome(options=chrome_options)
File “/home/runner/test/venv/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py”, line 69, in init
File “/home/runner/test/venv/lib/python3.8/site-packages/selenium/webdriver/chromium/webdriver.py”, line 92, in init
File “/home/runner/test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py”, line 270, in init
File “/home/runner/test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py”, line 363, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File “/home/runner/test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py”, line 428, in execute
File “/home/runner/test/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py”, line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot create temp dir for user data dir
Thank you for reading.