-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The action sometimes fails #4
Comments
I find GitHub actions can be a bit hit and miss. Sometimes it just seems to fall over for no clear reason. |
Haha, last night it failed four times in a row for this repo! We talked about a possible work application for cron-based actions, but I'm not sure it's a great idea if you can't handle a fail in the workflow. |
Yeah. We probably should investigate the common cause of failures across our |
Probably not related if the error above is the only error you're getting, but some of my action fails have been that R hasn't installed properly. However, I've just discovered that R comes pre-installed on the macOS GitHub runner as per this spec. So lines 17-18 of the yaml aren't necessary any more. Which should at least speed up the action a little. But on your As you're running the script via |
I found two posts that might be related to the current issue. In short, if we use httr::GET(img_url, httr::write_disk(temp_file, overwrite = TRUE)) Currently testing this build. Update: No, it doesn't work. |
I've just tested this and can confirm R 4.0.2 is available on the |
Hello. @matt-dray thanks for writing your blog post - I found it very helpful. I am experiencing this same issue with an rtweet bot, and I agree the issue is with rtweet or twitter. In my case
However, without the media Could Twitter be blocking the posts with media, because they view it as suspicious / automated activity? At one point my bot got blocked by twitter, which gave an explicit error to that effect. The account seems to be unblocked, but I wonder if Twitter still has some restrictions in place? |
Thanks @mattkerlogue, @rexarski and @scott-saunders. Given the near-identical nature of londonmapbot's tweet contents, I figured that any blocking from Twitter's end would be all-or-nothing, but it looks like the action failures are more-or-less random. I also thought londonmapbot might be more susceptible to blocking when I started posting URLs, but haven't had any issues. I'm not sure of Twitter's algorithm for detecting 'malicious bots', but I guess slight variation in the time taken for the action to run and post (and the fact it fails randomly!) might help to prevent it being flagged. This is worth a read in any case (might be slightly out of date): https://help.twitter.com/en/rules-and-policies/twitter-automation |
Having looked back through the Actions logs it seems that the narrowbotR’s workflow, which uses its custom I’ve checked the Twitter developer portal and I can’t see that I’ve done anything different in the app setup on their side to make this less suspicious to Twitter’s spam filters (if that is what’s happening). Given the documentation you linked to @matt-dray these types of bots definitely seem to be in scope.
The mapbots only post two tweets an hour, so definitely we’ll shy of the rate limits set out in Twitter’s documentation on the I still think it could be an issue with the GitHub Actions runners, as I’m not convinced the have perfect connectivity with the rest of the internet. The R install from r-libs and package installs would periodically fall over on my Google scraping repo without reason. The narrowbotR some how failed to install |
Thanks @mattkerlogue ! I haven't done anything to check the limit on tweets per hour, mostly because covid_data_bot isn't seeing that level of traffic, but that's a good point for the future. For now I think I'm also well under the 300 / 3hr limit. Yeah the github actions connectivity maybe an issue (startup time and package install is sometimes wildly variable for me too), but in my code the bot first uses rtweet to search for tweets and reads in nyt data from github, so it's not so bad that it's causing an error there. I have also experienced the same Here's one thing from the POST documentation:
covid data bot was having issues posting multiple tweets, because of the weird overlapping timing of github actions. Perhaps twitter could have been blocking the post of duplicate tweets? I have mostly fixed this duplicate posting issue since then, so we'll see if it continues. Could rare duplicate posts explain any of your issues? @mattkerlogue @matt-dray Let's say twitter api does throw the 403 error, does anyone know what error rtweet / github actions would show? |
Interesting suggestion @scott-saunders, I've never had issues with Nothing in my code (or I think @matt-dray's) attempts to post multiple tweets in quick succession. However, I don't know if the underlying code of |
Examples of failure (red crosses) on the Actions tab: https://github.com/matt-dray/londonmapbot/actions
Image gets downloaded, but then:
The text was updated successfully, but these errors were encountered: