breuerfelix/instapy-gui

Docker issue with gecko driver

agusalex opened this issue · 3 comments

Getting this error when running instapy-client on docker

`.. .. .. .. .. .. .. .. .. ..
Workspace in use: "/usr/instapy/assets/InstaPy"
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/local/lib/python3.7/subprocess.py", line 775, in init
restore_signals, start_new_session)
File "/usr/local/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/geckodriver': '/usr/local/bin/geckodriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "bot.py", line 126, in
session = InstaPy(**instapy_args)
File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 321, in init
self.logger,
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 114, in set_selenium_local_session
options=firefox_options,
File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in init
self.service.start()
File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 83, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.`

So I added geckdriver to /usr/local/bin/geckodriver and the same happens.
Finally I rename /usr/local/bin/geckodriver and create a dummy "executable" touch geckodriver and the error changes.. so not a path problem.
When I try to execute manually geckodriver I find the culprit:
/usr/local/bin # geckodriver sh: geckodriver: not found
So the problem goes deeper, is something related to this:
unix.stackexchange post
So when I look into the /lib folder on the container the only ld**.so I find is ld-musl-x86_64.so.1.
Quick google search later and that is Alpine linux. Meaning of course I cant run some stuff because this is as bare linux as it gets.

And the I found the Dockerfile in the /usr/instapy folder and indeed the image being used is python:3-alpine.

Thing is there is no repo to submit a fix for the client, the only repo is for the GUI. I find that baffling since great part of work you did here has a lot to do with the client. By the way awesome work.

EDIT: finally found the services folder, maybe make that another repo?
EDIT2: Also find it very weird that instapy attempts to use Gecko when wherever I look this is configured for chrome driver. That wouldn't solve it in my opinion though because chrome driver also fails to execute due to the alpine thing.

hey :)

in the readme i mentioned that the instapy docker client is not working since the update to firefox ... i wasnt able to fix this (even though its not that hard) because i was trying to get instapy running again (cause of the blocks)

right now i am focusing on instapy v2 thats why i stopped programming at this project since if instapy doesnt work, this gui is waste of time :S

still i wont shut down the servers cause its still working currently for some people :)

it seems like you got some skills in docker so my question would be, are you able to fix the dockerfile that it works with the geckodriver again and make a PR ? that would be damn awesome !!

Hi! done! its fixed I hope on #89 . Only downside is quite a lot heavier than Alpine image. I'm a bit of a Docker noob and I couldn't get to fix it for that one so I just changed it to python-slim. 700MB vs 200MB, quite a lot actually.

I was having trouble with instapy-docker that's when I stumbled upon your repo, so far this version of Firefox + Gecko and your framework is working flawlesly. Instapy-docker would crash on me every 3 minutes due to it not finding follow button. So yeah this one works for me still! even though is not V2.

Now that you mention it are you going to open a V2 repo ? would be glad to help.

@agusalex awesome dude ! i will just merge that tonight :) i am really glad that it works for you.

i dont care about the 500 mb ... its a one time download anyways. sometimes getting alpine images to work is a pain in the ass and sometimes after all the missing required packages you end up with the same size anyways :D so for now i am really happy that we at least got a working docker image !

well you can just chat me on discord :) the repo is called jinsta on my account. chat me on discord and i will invite you to the new channel :) need alot of help programming !