Code Monkey home page Code Monkey logo

Comments (21)

bayi avatar bayi commented on June 9, 2024 3

Finally, i think i fixed it and the bot is now running.

The root of the problem was the ancient firefox version in the debian repositories ( it was 68 i think while the newest is 79 )

Geckodriver 0.27 was released 3 days ago and it wasnt compatible with this verison of firefox, solved it by installing manually the newest version of firefox in the container.

Theese are the commands that i ran to solve it:

apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/

I will try to implement theese changes to the Dockerfile itself so it doesnt install the redundant old version, and need to clean up a few things, i will extend my MR soon.

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024 2

Hey Guys, I'm new here... I'm trying to run in my Mac inside an ubuntu container and I'm getting the same issue, even running the "fix" bellow:

apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/

Here is my procedure:

  1. Run my docker compose that is using ubuntu image:
version: "3"

services:
  pythonenv:
    image: ubuntu:latest
    command: /bin/bash
    working_dir: /app
    volumes:
    - .:/app
  1. Cloned Quickstart from: https://github.com/InstaPy/instapy-quickstart.git
  2. Run the install script at: instapy-quickstart/installation/Linux/install.sh
  3. Run the fix:
apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/
  1. Run my: python3 quick.py
  2. Get this error:
  File "quick.py", line 22, in <module>
    session = InstaPy(username=insta_username,
  File "/usr/local/lib/python3.8/dist-packages/instapy/instapy.py", line 312, in __init__
    self.browser, err_msg = set_selenium_local_session(
  File "/usr/local/lib/python3.8/dist-packages/instapy/browser.py", line 120, in set_selenium_local_session
    driver_path = geckodriver_path or get_geckodriver()
  File "/usr/local/lib/python3.8/dist-packages/instapy/browser.py", line 36, in get_geckodriver
    sym_path = gdd.download_and_install()[1]
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 174, in download_and_install
    filename_with_path = self.download(version,
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
    download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
    raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 64bit linux

Thanks you in advance @bayi

Hello guys.
I'm new to docker and programming.
I still having the error:

"RuntimeError: Error, unable to determine correct filename for 64bit linux"

I tried to change the dockerfile as suggested and deploy the container again.
I'm running Openmediavault 5 (Debian)...

Should I do something else?
thanks

Error, unable to determine correct filename for 64bit linux,
InstaPy Version: 0.6.10,
.. .. .. .. .. .. ._. ,
Workspace in use: "/code/InstaPy",
Traceback (most recent call last):,
File "docker_quickstart.py", line 6, in ,
session = InstaPy(username='xxxxx', password='xxxx', headless_browser=True),
File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 323, in init,
self.logger,,
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 120, in set_selenium_local_session,
driver_path = geckodriver_path or get_geckodriver(),
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 36, in get_geckodriver,
sym_path = gdd.download_and_install()[1],
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install,
show_progress_bar=show_progress_bar),
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download,
download_url = self.get_download_url(version, os_name=os_name, bitness=bitness),
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url,
raise RuntimeError(info_message),
RuntimeError: Error, unable to determine correct filename for 64bit linux,

The solution

The current steps to make this repository work again are:

Clone this repository:
git clone https://github.com/InstaPy/instapy-docker.git

Go into the folder:

cd instapy-docker/

Get the correct Dockerfile:

rm -rf Dockerfile
wget https://raw.githubusercontent.com/InstaPy/instapy-docker/54e2d949aa1f43f556774a3f55d0f8c57f4329da/Dockerfile

Get the latest xpath_compile.py, to make liking work again:

rm -rf xpath_compile.py
wget https://raw.githubusercontent.com/timgrossmann/InstaPy/master/instapy/xpath_compile.py

Change the contents of file docker-compose/docker-compose.yml to:

version: '3'
services:
  web:
    build: ../
    image: instapy
    container_name: "${COMPOSE_PROJECT_NAME}_web"
    env_file: .env
    environment:
      - PYTHONUNBUFFERED=0
      - INSTAPY_WORKSPACE=/code/InstaPy
    volumes:
      - ./:/code

Then run:

docker-compose up --build

And everything should work again.

The problem

The problem here is there are 2 pull requests ready to fix theses issues but not yet merged:
#76
#75

from instapy-docker.

realcnbs avatar realcnbs commented on June 9, 2024 1

It is a bug in webdriverdownloader.py here
Looks like mozilla changed format returned by - https://api.github.com/repos/mozilla/geckodriver/releases/latest and now filename list length is 2 not 1

from instapy-docker.

bayi avatar bayi commented on June 9, 2024 1

Until that gets merged you can fix it yourself by editing the Dockerfile and adding this at the end of the RUN command:

    # Disabling geckodriver log file
    && sed -i "s#browser = webdriver.Firefox(#browser = webdriver.Firefox(service_log_path=os.devnull,#g" /usr/local/lib/python3.7/site-packages/instapy/browser.py \
    && sed -i "320s#bitness in name]#bitness in name and name[-3:] != 'asc' ]#g" /usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py
``

Dont forget to append the extra \ on the - currently - last line before adding the new line

from instapy-docker.

bayi avatar bayi commented on June 9, 2024 1

Oh yeah, thats a different beast ... ;)
Im already after that, and trying to fix the next error ... something seems to be really broken now with firefox.

I also put up an MR with this patch, but please ignore it until i further investigate this

from instapy-docker.

bayi avatar bayi commented on June 9, 2024 1

yeah, i just noticed that too while i was editing the dockerfile ;)

Running tests now, will commit soon and update PR

from instapy-docker.

bayi avatar bayi commented on June 9, 2024 1

Fixed, PR updated, see #75

My bot is up and running, can u also please test and tell me if there are any more remaining issues ?

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024 1

Fixed, PR updated, see #75

My bot is up and running, can u also please test and tell me if there are any more remaining issues ?

I will rebuild my bot right now to check if there are any issues.

from instapy-docker.

gabfavaro avatar gabfavaro commented on June 9, 2024 1

@brammittendorff you save my life!!
Thanks!!!!!

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024

Yep same problem here, currently working on a fix.

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024

Until that gets merged you can fix it yourself by editing the Dockerfile and adding this at the end of the RUN command:

    # Disabling geckodriver log file
    && sed -i "s#browser = webdriver.Firefox(#browser = webdriver.Firefox(service_log_path=os.devnull,#g" /usr/local/lib/python3.7/site-packages/instapy/browser.py \
    && sed -i "320s#bitness in name]#bitness in name and name[-3:] != 'asc' ]#g" /usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py
``

Dont forget to append the extra \ on the - currently - last line before adding the new line

Even when you change docker-compose/docker-compose.yml:

version: '3'
services:
  web:
    build: ../
    image: instapy
    container_name: "${COMPOSE_PROJECT_NAME}_web"
    env_file: .env
    environment:
      - PYTHONUNBUFFERED=0
      - INSTAPY_WORKSPACE=/code/InstaPy
    volumes:
      - ./:/code

The result is still:

web_1  | InstaPy Version: 0.6.10
web_1  |  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
web_1  | Workspace in use: "/code/InstaPy"
web_1  | Traceback (most recent call last):
web_1  |   File "docker_quickstart.py", line 35, in <module>
web_1  |     headless_browser=True)
web_1  |   File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 323, in __init__
web_1  |     self.logger,
web_1  |   File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 124, in set_selenium_local_session
web_1  |     options=firefox_options,
web_1  |   File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
web_1  |     keep_alive=True)
web_1  |   File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
web_1  |     self.start_session(capabilities, browser_profile)
web_1  |   File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
web_1  |     response = self.execute(Command.NEW_SESSION, parameters)
web_1  |   File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
web_1  |     self.error_handler.check_response(response)
web_1  |   File "/usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
web_1  |     raise exception_class(message, screen, stacktrace)
web_1  | selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities
web_1  | 
instapy_web exited with code 1

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024

Finally, i think i fixed it and the bot is now running.

The root of the problem was the ancient firefox version in the debian repositories ( it was 68 i think while the newest is 79 )

Geckodriver 0.27 was released 3 days ago and it wasnt compatible with this verison of firefox, solved it by installing manually the newest version of firefox in the container.

Theese are the commands that i ran to solve it:

apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/

I will try to implement theese changes to the Dockerfile itself so it doesnt install the redundant old version, and need to clean up a few things, i will extend my MR soon.

May i suggest using wget instead of curl, because wget is already installed by the Dockerfile

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024

Fixed, PR updated, see #75
My bot is up and running, can u also please test and tell me if there are any more remaining issues ?

I will rebuild my bot right now to check if there are any issues.

Seems to work fine on debian 10, works fine on centos to!

from instapy-docker.

bayi avatar bayi commented on June 9, 2024

im on arch, here it is working too

my pi is running debian 10 too

from instapy-docker.

gabfavaro avatar gabfavaro commented on June 9, 2024

Hello guys.
I'm new to docker and programming.
I still having the error:

"RuntimeError: Error, unable to determine correct filename for 64bit linux"

I tried to change the dockerfile as suggested and deploy the container again.
I'm running Openmediavault 5 (Debian)...

Should I do something else?
thanks

Error, unable to determine correct filename for 64bit linux,
InstaPy Version: 0.6.10,
.. .. .. .. .. .. ._. ,
Workspace in use: "/code/InstaPy",
Traceback (most recent call last):,
File "docker_quickstart.py", line 6, in ,
session = InstaPy(username='xxxxx', password='xxxx', headless_browser=True),
File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 323, in init,
self.logger,,
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 120, in set_selenium_local_session,
driver_path = geckodriver_path or get_geckodriver(),
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 36, in get_geckodriver,
sym_path = gdd.download_and_install()[1],
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install,
show_progress_bar=show_progress_bar),
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download,
download_url = self.get_download_url(version, os_name=os_name, bitness=bitness),
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url,
raise RuntimeError(info_message),
RuntimeError: Error, unable to determine correct filename for 64bit linux,

from instapy-docker.

eduardorj avatar eduardorj commented on June 9, 2024

Hey Guys, I'm new here... I'm trying to run in my Mac inside an ubuntu container and I'm getting the same issue, even running the "fix" bellow:

apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/

Here is my procedure:

  1. Run my docker compose that is using ubuntu image:
version: "3"

services:
  pythonenv:
    image: ubuntu:latest
    command: /bin/bash
    working_dir: /app
    volumes:
    - .:/app

  1. Cloned Quickstart from: https://github.com/InstaPy/instapy-quickstart.git

  2. Run the install script at: instapy-quickstart/installation/Linux/install.sh

  3. Run the fix:

apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/

  1. Run my: python3 quick.py

  2. Get this error:

  File "quick.py", line 22, in <module>
    session = InstaPy(username=insta_username,
  File "/usr/local/lib/python3.8/dist-packages/instapy/instapy.py", line 312, in __init__
    self.browser, err_msg = set_selenium_local_session(
  File "/usr/local/lib/python3.8/dist-packages/instapy/browser.py", line 120, in set_selenium_local_session
    driver_path = geckodriver_path or get_geckodriver()
  File "/usr/local/lib/python3.8/dist-packages/instapy/browser.py", line 36, in get_geckodriver
    sym_path = gdd.download_and_install()[1]
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 174, in download_and_install
    filename_with_path = self.download(version,
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
    download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
    raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 64bit linux

Thanks you in advance @bayi

from instapy-docker.

matterisnanto avatar matterisnanto commented on June 9, 2024

@brammittendorff how to run docker-compose up --build?

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024

@brammittendorff how to run docker-compose up --build?

I think this issue is already fixed so no need to do this anymore, but when you need to you can run it by executing the following commands in the root of the directory where you cloned this repository:

cd docker-compose/
docker-compose up --build

from instapy-docker.

Robin-taylor97 avatar Robin-taylor97 commented on June 9, 2024

Hey Guys, I'm new here... I'm trying to run in my Mac inside an ubuntu container and I'm getting the same issue, even running the "fix" bellow:

apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/

Here is my procedure:

  1. Run my docker compose that is using ubuntu image:
version: "3"

services:
  pythonenv:
    image: ubuntu:latest
    command: /bin/bash
    working_dir: /app
    volumes:
    - .:/app
  1. Cloned Quickstart from: https://github.com/InstaPy/instapy-quickstart.git
  2. Run the install script at: instapy-quickstart/installation/Linux/install.sh
  3. Run the fix:
apt-get update && apt-get install curl bzip2
curl -sL "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64" | tar -xj -C /opt
rm /usr/bin/firefox
ln -s /opt/firefox/firefox /usr/bin/
  1. Run my: python3 quick.py
  2. Get this error:
  File "quick.py", line 22, in <module>
    session = InstaPy(username=insta_username,
  File "/usr/local/lib/python3.8/dist-packages/instapy/instapy.py", line 312, in __init__
    self.browser, err_msg = set_selenium_local_session(
  File "/usr/local/lib/python3.8/dist-packages/instapy/browser.py", line 120, in set_selenium_local_session
    driver_path = geckodriver_path or get_geckodriver()
  File "/usr/local/lib/python3.8/dist-packages/instapy/browser.py", line 36, in get_geckodriver
    sym_path = gdd.download_and_install()[1]
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 174, in download_and_install
    filename_with_path = self.download(version,
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download
    download_url = self.get_download_url(version, os_name=os_name, bitness=bitness)
  File "/usr/local/lib/python3.8/dist-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url
    raise RuntimeError(info_message)
RuntimeError: Error, unable to determine correct filename for 64bit linux

Thanks you in advance @bayi

Hello guys.
I'm new to docker and programming.
I still having the error:
"RuntimeError: Error, unable to determine correct filename for 64bit linux"
I tried to change the dockerfile as suggested and deploy the container again.
I'm running Openmediavault 5 (Debian)...
Should I do something else?
thanks
Error, unable to determine correct filename for 64bit linux,
InstaPy Version: 0.6.10,
.. .. .. .. .. .. ._. ,
Workspace in use: "/code/InstaPy",
Traceback (most recent call last):,
File "docker_quickstart.py", line 6, in ,
session = InstaPy(username='xxxxx', password='xxxx', headless_browser=True),
File "/usr/local/lib/python3.7/site-packages/instapy/instapy.py", line 323, in init,
self.logger,,
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 120, in set_selenium_local_session,
driver_path = geckodriver_path or get_geckodriver(),
File "/usr/local/lib/python3.7/site-packages/instapy/browser.py", line 36, in get_geckodriver,
sym_path = gdd.download_and_install()[1],
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 177, in download_and_install,
show_progress_bar=show_progress_bar),
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 129, in download,
download_url = self.get_download_url(version, os_name=os_name, bitness=bitness),
File "/usr/local/lib/python3.7/site-packages/webdriverdownloader/webdriverdownloader.py", line 324, in get_download_url,
raise RuntimeError(info_message),
RuntimeError: Error, unable to determine correct filename for 64bit linux,

The solution

The current steps to make this repository work again are:

Clone this repository: git clone https://github.com/InstaPy/instapy-docker.git

Go into the folder:

cd instapy-docker/

Get the correct Dockerfile:

rm -rf Dockerfile
wget https://raw.githubusercontent.com/InstaPy/instapy-docker/54e2d949aa1f43f556774a3f55d0f8c57f4329da/Dockerfile

Get the latest xpath_compile.py, to make liking work again:

rm -rf xpath_compile.py
wget https://raw.githubusercontent.com/timgrossmann/InstaPy/master/instapy/xpath_compile.py

Change the contents of file docker-compose/docker-compose.yml to:

version: '3'
services:
  web:
    build: ../
    image: instapy
    container_name: "${COMPOSE_PROJECT_NAME}_web"
    env_file: .env
    environment:
      - PYTHONUNBUFFERED=0
      - INSTAPY_WORKSPACE=/code/InstaPy
    volumes:
      - ./:/code

Then run:

docker-compose up --build

And everything should work again.

The problem

The problem here is there are 2 pull requests ready to fix theses issues but not yet merged: #76 #75

Hello, I am using windows ,this
{rm -rf Dockerfile
wget https://raw.githubusercontent.com/InstaPy/instapy-docker/54e2d949aa1f43f556774a3f55d0f8c57f4329da/Dockerfile}
does not work for me, how can i fix my problem?

from instapy-docker.

Robin-taylor97 avatar Robin-taylor97 commented on June 9, 2024

@brammittendorff I am deploying my Instapy app to Heroku but it gives this error:

RuntimeError: Error, unable to determine correct filename for 64bit linux,

from instapy-docker.

brammittendorff avatar brammittendorff commented on June 9, 2024

@brammittendorff I am deploying my Instapy app to Heroku but it gives this error:

RuntimeError: Error, unable to determine correct filename for 64bit linux,

Hi There Robin, there could be anything wrong with this error. But this project is not maintained for over 1 year now. So I suggest writing something yourself in Selenium / Docker or running it in python on Heroku. https://github.com/InstaPy/InstaPy

from instapy-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.