Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: geckodriver "local variable 'driver' referenced before assignment" #91

Closed
icepaule opened this issue Nov 12, 2023 · 3 comments
Closed
Assignees
Labels
🐛 bug something ain't working

Comments

@icepaule
Copy link

Hello josh,

could you help me with below error messages? Actually the came up with a fresh install:
Thanks a lot for the great tool and your help.

Thx
Marcus

_`2023-11-12:13:21:52,830 INFO geckodriver: assumed torsocks proxy found - tcp://127.0.0.1:9050
2023-11-12:13:21:52,830 INFO geckodriver: configuring proxy settings
2023-11-12:13:21:52,831 INFO geckodriver: starting webdriver
2023-11-12:13:24:07,35 ERROR geckodriver: error: Message: Failed to read marionette port

Traceback (most recent call last):
File "/opt/ransomwatch/geckodrive.py", line 44, in main
driver = webdriver.Firefox(options=options)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/firefox/webdriver.py", line 67, in init
super().init(command_executor=executor, options=options)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 205, in init
self.start_session(capabilities)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 289, in start_session
response = self.execute(Command.NEW_SESSION, caps)["value"]
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py", line 344, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Failed to read marionette port

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/ransomwatch/geckodrive.py", line 78, in main
driver.quit()
UnboundLocalError: local variable 'driver' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/ransomwatch/./ransomwatch.py", line 209, in
scraper()
File "/opt/ransomwatch/./ransomwatch.py", line 136, in scraper
response = geckodrive.main(host['slug'])
File "/opt/ransomwatch/geckodrive.py", line 81, in main
if driver:
UnboundLocalError: local variable 'driver' referenced before assignment
root@intmon2:/opt/ransomwatch#
`_

@joshhighet
Copy link
Owner

hi, thanks for raising it. I'm unable to reproduce this - could you let me know how you installed geckodriver and what OS you're running?

perhaps this ? RedSiege/EyeWitness#604 (comment)

@joshhighet joshhighet self-assigned this Nov 13, 2023
@joshhighet joshhighet added the 🐛 bug something ain't working label Nov 13, 2023
@icepaule
Copy link
Author

Sure, my "history" part below, basically I sneeked your docker config:
wget https://api.github.com/repos/mozilla/geckodriver/releases/latest
tar -xvzf geckodriver-v0.33.0-linux32.tar.gz
mv geckodriver /usr/local/bin

As this was just not the solution, I added:
apt install firefox

But still the same issue.
I'm running on Ubuntu 22.04.3 LTS.

Thx so much for your help.

@icepaule
Copy link
Author

Just fixed it myself. ;-)

  • sudo add-apt-repository ppa:mozillateam/ppa -y
  • sudo apt update
  • sudo apt install firefox

and now it works smoothly. ;-)

Thx for helping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something ain't working
Projects
None yet
Development

No branches or pull requests

2 participants