Skip to content
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

Driver is nil for ephemeral publisher #74

Open
maulin opened this issue Mar 16, 2015 · 1 comment
Open

Driver is nil for ephemeral publisher #74

maulin opened this issue Mar 16, 2015 · 1 comment

Comments

@maulin
Copy link

maulin commented Mar 16, 2015

I get the following error when I try to publish an ephemeral.

 ~/code/crowdtap (main) > SlackNotification.create({:room=>'the-lab', :message => 'test'})
RuntimeError: #<Class:Promiscuous::Backend>#publish delegated to driver.publish, but driver is nil: Promiscuous::Backend
from /opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/backend.rb:54:in `rescue in publish'

This is what the full stack trace looks like

=> [
    [ 0] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/backend.rb:54:in `rescue in publish'",
    [ 1] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/backend.rb:51:in `publish'",
    [ 2] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/operation/base.rb:135:in `block in publish_payloads'",
    [ 3] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/operation/base.rb:127:in `each'",
    [ 4] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/operation/base.rb:127:in `publish_payloads'",
    [ 5] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/operation/ephemeral.rb:13:in `execute_instrumented'",
    [ 6] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/operation/base.rb:31:in `execute'",
    [ 7] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/model/ephemeral.rb:44:in `save_operation'",
    [ 8] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/model/ephemeral.rb:36:in `save'",
    [ 9] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/model/ephemeral.rb:72:in `block in create'",
    [10] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/model/ephemeral.rb:72:in `tap'",
    [11] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/promiscuous-8851d13ed1b9/lib/promiscuous/publisher/model/ephemeral.rb:72:in `create'",
    [12] "(pry):10:in `<main>'",
    [13] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:328:in `eval'",
    [14] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:328:in `evaluate_ruby'",
    [15] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:278:in `re'",
    [16] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:254:in `rep'",
    [17] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:234:in `block (3 levels) in repl'",
    [18] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:232:in `loop'",
    [19] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:232:in `block (2 levels) in repl'",
    [20] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:231:in `catch'",
    [21] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:231:in `block in repl'",
    [22] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:230:in `catch'",
    [23] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_instance.rb:230:in `repl'",
    [24] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:169:in `start'",
    [25] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/pry-nav-0.2.3/lib/pry-nav/pry_ext.rb:17:in `start_with_pry_nav'",
    [26] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'",
    [27] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'",
    [28] "/opt/rubies/2.1.5/lib/ruby/gems/2.1.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'",
    [29] "script/rails:6:in `require'",
    [30] "script/rails:6:in `<main>'"
]

It seems like the connection to rabbit is not being made. But if I publish a regular publisher model first and then publish the ephemeral, it works fine. This is on the kafka branch

@kareemk
Copy link
Member

kareemk commented Mar 17, 2015

I'll get a fix out soon for this in the meantime try Promiscuous.ensure_connected before you publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants