quickstart.py working as normal for first 80 posts (number varies). Then randomly crashing.
[9/70]
Image from: b'honeybadgerr007'
Number of Followers: 177
Link: b'https://www.instagram.com/p/Batlsnjh-8m/?tagged=ui'
Description: b'Unique Creations - #ui #ux #logo #logos #logodesinger #logodesign #creative #creatives #creativity #designer #graphics #graphicdesigner #graphicdesign #web #webdesign #website #userinterface #userexperiencedesign #userexperience #art #illustration #unique #logomaker #freelance #freelancer #behance'
--> Image Liked!
--> Not commented
--> Now following
[10/70]
Image from: b'rocketz.folio'
Number of Followers: 373
Link: b'https://www.instagram.com/p/BatlpcbgsoD/?tagged=ui'
Description: b'Yummygum Website by @yummygum\n.\nFollow us @rocketz.folio\n.\n.\n#ui #uidesign #uitrends #uiux #uiuxdesign #uiuxdesigns #uiuxinspiration #userinterface #userinterfacedesign #interface #interfacedesign #appdesign #appinterface #webdesign #digitaldesign #designinspiration #graphicdesign'
--> Image Liked!
--> Not commented
Traceback (most recent call last):
File "quickstart.py", line 15, in <module>
session.like_by_tags(['#ux', '#ui', '#digitalagency', '#londoncreatives', '#londoncreative', '#leedscreative', '#manchestercreatives', '#nottinghamcreatives', '#liverpoolcreative'], amount=70, media=None)
File "/var/www/example/instapy/instapy.py", line 543, in like_by_tags
followed += follow_user(self.browser, self.follow_restrict, self.username, user_name)
File "/var/www/example/instapy/unfollow_util.py", line 207, in follow_user
follow_button.click()
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webelement.py", line 72, in click
self._execute(Command.CLICK_ELEMENT)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webelement.py", line 461, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
(Session info: chrome=62.0.3202.62)
(Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.4.0-97-generic x86_64)
from instapy import InstaPy
insta_username = 'xxx'
insta_password = 'xxx'
# if you want to run this script on a server,
# simply add nogui=True to the InstaPy() constructor
session = InstaPy(username=insta_username, password=insta_password, nogui=True)
session.login()
session.set_do_follow(enabled=True, percentage=100, times=1)
session.set_upper_follower_count(limit = 600)
session.set_lower_follower_count(limit = 100)
session.like_by_tags(['#ux', '#ui', '#digitalagency', '#londoncreatives', '#londoncreative', '#leedscreative', '#manchestercreatives', '#nottinghamcreatives', '#liverpoolcreative'], amount=70, media=None)
session.end()
I just sent the #824 PR to fix the #734 bug, and I think it will fix this bug too, can you test it ?
The script has issues. We are experiencing full server CPU up to 200% after a few hours of running.
I have also experienced memory leaks. If you do not reboot the server on a daily (or more regular) basis then this bot will become unusable.
@rossbulat pls report a new issue with detailed information, without it we can’t do much.
@rossbulat Yes, the problem is that if there is some kind of error, it won't close the XVFB and Chrome instances and just start them again next time.
This can be fixed by using something called atexit
as the handler we can call the end method which will then close all the descriptors.
@rossbulat to prevent restarting it manually you can simply use a try catch and reboot the system in the except part of it
@converge @timgrossmann That's encouraging, thank you or identifying the issue in this thread.
Is an atexit implementation in the works for the project? Unfortunately we are not yet well-versed enough in Python to implement this fix ourselves.
@rossbulat Who is "we"? 😉
Well, this shouldn't be too much work. I'll check if I can submit a PR for that later today or sometime tomorrow... Can't promise anything tough...
@timgrossmann Ok, that sounds great.
We are a small development team on a side project, playing with this bot. In any case, thanks for the repo!
@timgrossmann After running this for a few hours the system leaked again. I have found something in my syslog that happened around time of the leak:
Oct 27 15:53:56 insta-py kernel: [19930.033766] Out of memory: Kill process 8219 (chrome) score 460 or sacrifice child
Oct 27 15:53:56 insta-py kernel: [19930.033909] Killed process 8219 (chrome) total-vm:1245752kB, anon-rss:68100kB, file-rss:0kB, shmem-rss:93084kB
Oct 27 15:53:56 insta-py kernel: [19930.060878] oom_reaper: reaped process 8219 (chrome), now anon-rss:0kB, file-rss:0kB, shmem-rss:92952kB
Oct 27 15:54:33 insta-py rsyslogd: [origin software="rsyslogd" swVersion="8.16.0" x-pid="510" x-info="http://www.rsyslog.com"] start
Oct 27 15:54:33 insta-py rsyslogd: rsyslogd's groupid changed to 108
Oct 27 15:54:33 insta-py rsyslogd: rsyslogd's userid changed to 104
Oct 27 15:54:33 insta-py rsyslogd-2039: Could not open output pipe '/dev/xconsole':: No such file or directory [v8.16.0 try http://www.rsyslog.com/$
Oct 27 15:54:33 insta-py rsyslogd-2007: action 'action 11' suspended, next retry is Fri Oct 27 15:55:03 2017 [v8.16.0 try http://www.rsyslog.com/e/$
Oct 27 15:54:33 insta-py kernel: [ 0.000000] random: get_random_bytes called from start_kernel+0x42/0x4e1 with crng_init=0
Oct 27 15:54:33 insta-py kernel: [ 0.000000] Linux version 4.13.0-16-generic (buildd@lcy01-02) (gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu2)) #19-U$
Oct 27 15:54:33 insta-py kernel: [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-16-generic root=UUID=589cfa8c-6360-47a2-b6e8-b470bf68$
Oct 27 15:54:33 insta-py kernel: [ 0.000000] KERNEL supported cpus:
Oct 27 15:54:33 insta-py kernel: [ 0.000000] Intel GenuineIntel
Oct 27 15:54:33 insta-py kernel: [ 0.000000] AMD AuthenticAMD
Oct 27 15:54:33 insta-py kernel: [ 0.000000] Centaur CentaurHauls
Oct 27 15:54:33 insta-py kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Oct 27 15:54:33 insta-py kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Oct 27 15:54:33 insta-py kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
@rossbulat what's your server setup ?
@converge
Ubuntu 17.10 x64
CPU: 1 vCore
RAM: 1024 MB
Storage: 25 GB SSD
Random crash here too on Windows with this change...
`File "Z:EntwicklungInstapyinstapyinstapy.py", line 624, in like_by_tags
self.browser, comments)
File "Z:EntwicklungInstapyinstapycomment_util.py", line 25, in comment_image
comment_input[0].send_keys("b")
File "C:Python36libsite-packagesseleniumwebdriverremotewebelement.py", line 352, in send_keys
'value': keys_to_typing(value)})
File "C:Python36libsite-packagesseleniumwebdriverremotewebelement.py", line 501, in _execute
return self._parent.execute(command, params)
File "C:Python36libsite-packagesseleniumwebdriverremotewebdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "C:Python36libsite-packagesseleniumwebdriverremoteerrorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot focus element
(Session info: chrome=61.0.3163.100)
(Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows NT 10.0.14393 x86_64)
`
Yes seems like a issue this bot is not stable im just getting issues every day
hey @rossbulat , take a look at my review at #826.
I wanna try your InstaPy configuration, what options are you using ?
@converge Sure, this is my configuration. I'm fetching the credentials from another file so we can source-control the bot config.
from instapy import InstaPy
import json
with open("credentials.json") as json_data:
d = json.load(json_data)
insta_username = d["username"]
insta_password = d["password"]
session = InstaPy(username=insta_username, password=insta_password, nogui=True)
session.login()
session.set_upper_follower_count(limit=2000)
session.set_do_follow(enabled=True, percentage=20, times=2)
session.set_dont_include(['account1', 'rossbulat', 'account3', 'account4', 'account5'])
session.like_by_tags(['travelblogger', 'travelling', 'instatravel'], amount=100)
session.unfollow_users(amount=150, onlyInstapyFollowed = True, onlyInstapyMethod = 'FIFO' )
session.end()
anyone know how to make cron work i cant get it to auto start ?
@wizarduk Please use the search in the issues and/or look into the readme. This has been asked ~17 times before
@converge Hmm.. I think this PR is more related to the general memory leak problem... Therefore the rather "high" bounty.
Therefore we should keep this open until there is some actual fix for the memory leak
@timgrossmann no problem, let's do it.
@converge Good solution, but I'm not confident that this will fix the problem with the performance...
Hey Tim, since the performance issue I catched was related to multiple open
instances of xvfb and chrome, I do believe that it will fix the performance
issue as well. Let’s try it for some more weeks ? The bounty will just be
paied on 13 jan, we have time to “stop it” if we find something more
related to the issue.
Em qua, 27 de dez de 2017 às 13:24, Tim Großmann notifications@github.com
escreveu:
@converge https://github.com/converge Good solution, but I'm not
confident that this will fix the problem with the performance...—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/timgrossmann/InstaPy/issues/821#issuecomment-354129013,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AALg_4VbxC3y4UTDCdwylDt6fvq94b2sks5tEmEagaJpZM4QHkRb
.