grindcrank / twitter_ebooks

Better twitterbots for all your friends~alive and polling
MIT License
12 stars 6 forks source link

"since_id parameter is invalid" error #9

Closed Ridnarhtim closed 5 years ago

Ridnarhtim commented 5 years ago

Hello,

I am getting a twitter "since_id parameter is invalid" error every 70 seconds, details below.

The bots seem to work fine so it's not a huge deal, but it is cluttering up my logs... I had the bot running with Mispy's code before the API change, I don't know if that's relevant; I uninstalled the ebooks and twitter gems before installing twitter_ebooks_poll.

Many thanks for this working version, my bot is alive again!

Error output:
  984690096 rufus-scheduler intercepted an error:
  984690096   job:
  984690096     Rufus::Scheduler::EveryJob "70s" {}
  984690096   error:
  984690096     984690096
  984690096     Twitter::Error::BadRequest
  984690096     since_id parameter is invalid.
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/response/raise_error.rb:13:in `on_complete'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:9:in `block in call'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:57:in `on_complete'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/response.rb:8:in `call'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/request/url_encoded.rb:15:in `call'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/request/multipart.rb:14:in `call'
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/request/multipart_with_file.rb:21:in `call'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/rack_builder.rb:139:in `build_response'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:377:in `run_request'
  984690096       /var/lib/gems/2.3.0/gems/faraday-0.9.2/lib/faraday/connection.rb:140:in `get'
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/request.rb:33:in `perform'
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/utils.rb:50:in `perform_request'
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/utils.rb:95:in `perform_request_with_objects'
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/utils.rb:80:in `perform_get_with_objects'
  984690096       /var/lib/gems/2.3.0/gems/twitter-5.17.0/lib/twitter/rest/timelines.rb:113:in `home_timeline'
  984690096       /var/lib/gems/2.3.0/gems/twitter_ebooks_poll-3.2.1/lib/twitter_ebooks/bot.rb:378:in `block in start'
  984690096       /var/lib/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler/jobs.rb:210:in `do_call'
  984690096       /var/lib/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler/jobs.rb:254:in `trigger_now'
  984690096       /var/lib/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler/jobs.rb:296:in `block (3 levels) in start_work_thread'
  984690096       /var/lib/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler/jobs.rb:299:in `block (2 levels) in start_work_thread'
  984690096       /var/lib/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler/jobs.rb:285:in `loop'
  984690096       /var/lib/gems/2.3.0/gems/rufus-scheduler-3.4.2/lib/rufus/scheduler/jobs.rb:285:in `block in start_work_thread'
grindcrank commented 5 years ago

Hi,

in the error (after "error:"), is it always the same number (984690096). If yes, then there is a problem with your tweet with that number. I will look into catching that exception.

Ridnarhtim commented 5 years ago

Hello,

I think I found the cause of the error I'm seeing. I have multiple bots and one of them doesn't reply to tweets (only sends out pictures). So it's never read any kind of tweets, or built/loaded a model, or used a consumer key. It's just a very basic "every x minutes tweet out a picture" bot. So that's probably the issue.

Ridnarhtim commented 5 years ago

(Sorry about the confusion with the deleted comment)

I noticed the persistence file had a 0 tweet id in it for the bot in question. I deleted the file and restarted the bot, and it seems happy now.

grindcrank commented 5 years ago

Finally got to take a look into the issues. I am going to close this then.