companionstudio / instagram-token-agent

A service to keep your Instagram Basic Display API token fresh.
MIT License
133 stars 70 forks source link

Deprecation Warning when trying to deploy #4

Closed knynkwl closed 4 years ago

knynkwl commented 4 years ago

DEPRECATION WARNING: Setting `ActiveRecord::Base.configurations` with `[]=` is deprecated. Use `ActiveRecord::Base.configurations=` directly to set the configurations instead. (called from <top (required)> at /app/app.rb:5)
DEPRECATION WARNING: Setting `ActiveRecord::Base.configurations` with `[]=` is deprecated. Use `ActiveRecord::Base.configurations=` directly to set the configurations instead. (called from <class:App> at /app/app.rb:10)
rake aborted!
TypeError: can't convert nil into an exact number
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/calculations.rb:264:in `+'
/app/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/time/calculations.rb:264:in `plus_with_duration'
/app/lib/instagram_token_agent/client.rb:18:in `refresh'
lib/tasks/setup.rake:19:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/cli/exec.rb:28:in `run'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:465:in `exec'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:27:in `dispatch'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/cli.rb:18:in `start'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.6.0/gems/bundler-2.0.2/exe/bundle:22:in `<top (required)>'
/app/vendor/bundle/bin/bundle:104:in `load'
/app/vendor/bundle/bin/bundle:104:in `<main>'
Tasks: TOP => setup
(See full trace by running task with --trace)```
mutsuda commented 4 years ago

Are you sure you put your initial Instagram token value into the STARTING_TOKEN field?

aureliusm commented 4 years ago

@mutsuda I have the same issue and have pasted the correct STARTING_TOKEN I got from FB app using a Instagram tester. Same log as above.

aureliusm commented 4 years ago

@mutsuda I tried again and now it worked. Weird. Thanks for a great package!

benjamin-hull commented 4 years ago

Thanks, @aureliusm - Looks like this is a failure that the agent isn't handling well. The error is caused when trying to work out when the next refresh time should be, based on the expiry of the new token - in your case, looks like there was an error from the API, so there was no expiry to work with.

I've added a note to check this out - but does make sense that trying again fixes the issue.

Thanks again!