0

My script was working fine but suddenly got the chrome driver error. it seems like some file is locked but I couldn't able to find out.

This is the error message that I'm getting:

  d = webdriver.Chrome(r'C:\Users\Rahul\Downloads\chromedriver_win32\chromedriver.exe')
[0306/064432.916:ERROR:process_singleton_win.cc(420)] Lock file can not be created! Error code: 5
[0306/064432.916:ERROR:chrome_browser_main.cc(1424)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new window in the existing process. Aborting now to avoid profile corruption.

Any help would be much appreciated.

vinit
  • 21
  • 4

1 Answers1

0

This error message...

[0306/064432.916:ERROR:process_singleton_win.cc(420)] Lock file can not be created! Error code: 5
[0306/064432.916:ERROR:chrome_browser_main.cc(1424)] Failed to create a ProcessSingleton for your profile directory. This means that running multiple instances would start multiple browser processes rather than opening a new window in the existing process. Aborting now to avoid profile corruption.

...implies that possibly there are some Zombie ChromeDriver instances locking the profile which the current ChromeDriver needs to use. Forcibly stopping Selenium in the middle of an execution tends to leave the zombie processes and associated process locks behind.


Solution

You need to manually browse to the specified profile directory and delete the file named lockfile. If the OS complains that the file is in use, close all instances by killing all of them.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • undetected Selenium. I tried to find out Lockfile in the specified profile directory but I could not find out. Do you know any particular file where I can get it? – vinit Mar 07 '23 at 13:15