progapandist / rubotnik

"Bot-end" Ruby framework to quickly build and launch a Facebook Messenger chatbot
MIT License
189 stars 26 forks source link

Unable to start Puma #23

Closed matthewjamesr closed 5 years ago

matthewjamesr commented 5 years ago

This is occurring with a fresh install.

theagiledev@theagiledev-linux:~/projects/orderbot$ heroku local [OKAY] Loaded ENV .env File as KEY=VALUE Format 7:34:59 PM web.1 | [17957] Puma starting in cluster mode... 7:34:59 PM web.1 | [17957] Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas 7:34:59 PM web.1 | [17957] Min threads: 5, max threads: 5 7:34:59 PM web.1 | [17957] Environment: development 7:34:59 PM web.1 | [17957] Process workers: 1 7:34:59 PM web.1 | [17957] * Preloading application 7:34:59 PM web.1 | [17957] ! Unable to load application: Facebook::Messenger::Subscriptions::Error: An unknown error has occurred. 7:34:59 PM web.1 | /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/facebook-messenger-1.1.2/lib/facebook/messenger/subscriptions.rb:74:in raise_errors' 7:34:59 PM web.1 | : 7:34:59 PM web.1 | An unknown error has occurred. 7:34:59 PM web.1 | ( 7:34:59 PM web.1 | Facebook::Messenger::Subscriptions::Error 7:34:59 PM web.1 | ) 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/facebook-messenger-1.1.2/lib/facebook/messenger/subscriptions.rb:36:insubscribe' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/rubotnik-0.2.2/lib/rubotnik.rb:48:in subscribe' 7:34:59 PM web.1 | from /home/theagiledev/projects/orderbot/bot/bot.rb:6:in<top (required)>' 7:34:59 PM web.1 | from config.ru:5:in require_relative' 7:34:59 PM web.1 | from config.ru:5:inblock in

' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/builder.rb:55:in instance_eval' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/builder.rb:55:ininitialize' 7:34:59 PM web.1 | from config.ru:in new' 7:34:59 PM web.1 | from config.ru:in
' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/builder.rb:49:in eval' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/builder.rb:49:innew_from_string' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/rack-2.0.6/lib/rack/builder.rb:40:in parse_file' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/configuration.rb:318:inload_rackup' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/configuration.rb:243:in app' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/runner.rb:145:inload_and_bind' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/cluster.rb:410:in run' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/launcher.rb:184:inrun' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/cli.rb:78:in run' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/bin/puma:10:in<top (required)>' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/bin/puma:23:in load' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/bin/puma:23:in
' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in eval' 7:34:59 PM web.1 | from /home/theagiledev/.rvm/gems/ruby-2.5.1/bin/ruby_executable_hooks:24:in
' [DONE] Killing all processes with signal SIGINT

brandondees commented 5 years ago

Check first to see if this could be related to this issue patched in ruby recently that broke puma: https://www.ruby-lang.org/en/news/2019/03/15/ruby-2-5-5-released/

I don't have any other clues to follow but the "unknown error" seems like it could be that type of issue.

matthewjamesr commented 5 years ago

I got a little further:

/home/theagiledev/.rvm/gems/ruby-2.5.1/gems/facebook-messenger-1.1.2/lib/facebook/messenger/subscriptions.rb:74:in `raise_errors': An active access token must be used to query information about the current user. (Facebook::Messenger::Subscriptions::Error)

I do have a active access token.

lluft commented 5 years ago

@matthewjamesr this is due to an issue with Rubotnic.subscribe the FB API expects the parameter subscribed_fields to be set, wich is not the case. I will create a PR, but for now you can just comment out Rubotnik.subscribe(ENV['ACCESS_TOKEN']) in bot/bot.rb and it will work.