muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.27k stars 320 forks source link

100% CPU usage if using Twitter bee #335

Closed Phoenix616 closed 3 years ago

Phoenix616 commented 3 years ago

It seems to be using 100% of one core/thread once I enable a Twitter bee even without using any kind of chain which would react on twitter actions (I only use it to send tweets)

muesli commented 3 years ago

Thanks for the heads up. That may be related to Twitter shutting down several API endpoints. Investigating.

pbek commented 3 years ago

@muesli, I was able to post to Twitter, but the beehive process takes 100% CPU (stopping the Twitter Bee fixes that until you turn it back on again)! Were you already able to take a look at the Twitter Hive? Reacting to Twitter likes also didn't seem to work for me, Last Event always says never for me.

pbek commented 3 years ago

@muesli, the only thing that runs infinitely in the Twitter Bee seems to be:

https://github.com/muesli/beehive/blob/f6ac3ac98e38727fdf0255f85ee26ab4298c3c7a/bees/twitterbee/twitterbee.go#L290-L295

pbek commented 3 years ago

Although item seems to be nil a lot (all the time?).

pbek commented 3 years ago

I was able to fix the 100% CPU problem, but reacting to a like still doesn't seem to work for me. At least posting tweets is still working...

https://github.com/muesli/beehive/pull/347

pbek commented 3 years ago

Last commit on https://github.com/ChimeraCoder/anaconda (library that handles the Twitter API) was 2 years ago. 😬 There is also https://github.com/dghubble/go-twitter, which is almost as inactive, but also has it's issue tracker disabled and a lot of open PRs...

pbek commented 3 years ago

The user stream https://userstream.twitter.com/1.1/user.json is retired since more than 2 years.

The replacements seem to be the "Premium Account Activity API" and "Enterprise Account Activity API". 😁 At least posting tweets still seems to work.

muesli commented 3 years ago

Yeah, I guess most people stopped using the Twitter API at that point, myself included. I'm actually one of the anaconda maintainers, but development has pretty much ceased when Twitter shut down most of their API for public use.

pbek commented 3 years ago

Posting still works (and I plan to use it), only the user stream is shut down.

muesli commented 3 years ago

I've just removed the user stream from the Twitter hive, as it's not supported by Twitter anymore. This in turn means the TwitterBee now only supports posting, following & unfollowing other users. There are no more events we can currently support. What a shame.

This also fixes this issue.

pbek commented 3 years ago

Awesome, @muesli! Are you also pushing the changes to Docker-Hub so I can use your container again? 😁

muesli commented 3 years ago

If you use beehive:latest, this will automatically be built every time someone pushes to git master.

pbek commented 3 years ago

image: fribbledom/beehive should get the latest, thank you very much!

georgkrause commented 2 years ago

If thats resolved, please consider updating https://github.com/muesli/beehive/wiki/Twitter