InstaPy with docker doesn't work anymore after update

Created on 19 Feb 2019  路  10Comments  路  Source: timgrossmann/InstaPy

Expected Behavior

The bot finds my logs and use them(to unfollow)

Current Behavior

I deleted the old Instapy folder and cloned Instapy again from GitHub to update the version. Then I replaced the docker_quickstart.py and my "logs" folder with the old ones. Now when I build the docker-container(I always do that as the root user), the bot uses /root/InstaPy as workspace even if the real folder is under /home/user/InstaPy and I build the container also in /home/user/InstaPy. So I do everything the same way as before but InstaPy uses now the completely wrong folder. Even if I set my workspace manuelly in the docker_quickstart.py to the right and existing InstaPy folder, the bot doesn't use my old "logs"-folder and read or write from it to unfollow(Error occurred while generating a user list from the followed pool!
b"[Errno 2] No such file or directory: ".........."). I tried to generate a new "logs" folder with new files and deleted for that my old one, but InstaPy doesn't generate a new one.

So currently, my InstaPy can follow other people but doesn't use in any way the logs folder, so unfollow from the list doesn't work and the followed people are not getting documented. I do everything in the exact same way as before the update.

Possible Solution (optional)

InstaPy configuration

from instapy import InstaPy
from instapy import set_workspace

insta_username = ''
insta_password = ''

set_workspace("/home/user/InstaPy")

bot = InstaPy(username=insta_username, password=insta_password, selenium_local_session=False)
bot.set_selenium_remote_session(selenium_url='http://selenium:4444/wd/hub')
bot.login()
bot.set_relationship_bounds(enabled=True,
potency_ratio=None,
delimit_by_numbers=True,
max_followers=6000,
max_following=1000,
min_followers=30,
min_following=30)
bot.set_user_interact(amount=600, randomize=True, percentage=20, media='Photo')
bot.set_do_like(enabled=True, percentage=100)
bot.set_do_comment(enabled=False, percentage=0)
bot.set_do_follow(enabled=True, percentage=100)
bot.like_by_tags([foo'], amount=600)

bot.follow_by_tags(['foo'],amount=750)

bot.unfollow_users(amount=460, InstapyFollowed=(True, "all"), style="FIFO", unfollow_after=906060, sleep_delay=400)
bot.end()

Most helpful comment

@aneopsy @Elektronenhirn108 The problem as also been discussed in #4096 and a PR (#4112) was created but was closed due to ongoing project of moving Docker config to a new repo next week.

If you want to fix this issue, you could wait the upcoming new repo or directly change your docker-compose.yml file with adding: - INSTAPY_WORKSPACE=/code under - PYTHONUNBUFFERED=0 then restart the web container.

All 10 comments

@Elektronenhirn108 Sorry to hear that, we will make some changes to the docker setup.

@funkypenguin Will set up the new https://github.com/InstaPy/instapy-docker repository and enable users to simply pull the latest container from docker hub.

Sorry for the delay.

It should be nice, I have some issues with Docker and InstaPy workspace, I'm try to fix them

@timgrossmann okay, that sounds great. So I wait for any news here.
If I can support you in any way with testing, feel free to contact me.

A small update with more information here.

Unfollowing is working BUT the mounting doesn't work.
The generated logs are inside my container under my custom set workspace/logs.
But if I delete my current container, these log folder is lost.

The problem is that my real InstaPy folder doesn't read/write from/to the container the logs folder. The syncronization doesn't work. That is the only problem. The log-folder exists and is working properly.
I hope that helps you to find and fix the problem.

I have a solution,

We should use _Docker Volume_ to create a shared directory between containers.
The advantage is that the _Docker Volume_ is not deleted when the container is stopped or deleted. Then with this, we should be able to rebuild a container without loose all logs/followers data and keep all data in one place for all container instances.

@aneopsy @Elektronenhirn108 The problem as also been discussed in #4096 and a PR (#4112) was created but was closed due to ongoing project of moving Docker config to a new repo next week.

If you want to fix this issue, you could wait the upcoming new repo or directly change your docker-compose.yml file with adding: - INSTAPY_WORKSPACE=/code under - PYTHONUNBUFFERED=0 then restart the web container.

@Herrox Would it be possible for you to modify the dockerfile in the new repository in a way that people can mount in their own quickstarts and not rely on the standard one? :blush:

@timgrossmann This change is not related to the Dockerfiler but to docker-compose.yml, which is not part of the new repo :(

@Herrox yeah, it's now one single image.
The docker file in the new repository is loading the default quickstart file into the image, though.
So we still need to add a way to mount the wanted (configured) quickstart file into the container.
@breuerfelix nows more about this, though 馃槃

@timgrossmann Dockerfile is the file that will build the Docker image. Where docker-compose.yml is the file that will start the container, from an image already built. Both file are mandatory, in my point of view :)

Edit: by the way, following micro services best practices architectures, it will be better to separate selenium and instapy as it is now
Edit2: I joined Discord (and still available on Slack too)

Was this page helpful?
0 / 5 - 0 ratings