Closed Bramanga closed 10 years ago
I decided to run the tests and get a failure when using the MONGOHQ_URL, which is what I am using on Heroku.
Failures:
1) Qu::Backend::Mongo connection should use MONGOHQ_URL from heroku
Failure/Error: subject.connection.connection.host_to_try.should == ['host', 10060]
expected: ["host", 10060]
got: nil (using ==)
# ./spec/qu/backend/mongo_spec.rb:22:in `block (3 levels) in <top (required)>'
Finished in 1.58 seconds
36 examples, 1 failure
Failed examples:
rspec ./spec/qu/backend/mongo_spec.rb:17 # Qu::Backend::Mongo connection should use MONGOHQ_URL from heroku
I'd work from here: https://github.com/bkeepers/qu/blob/master/lib/qu/backend/mongo.rb#L24
Check: Is ENV['MONGOHQ_URL']
getting set?
What is @auths
in https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/mongo_client.rb#L272 ? It's in the backtrace. (Rescue the error and spew Qu.backend.connection.connection.auths
to find out)
This is closely related to issue #63 which I discovered two months ago. As I mentioned there the Mongo backend is not of interest to me but the issue has something to do with a change in the client gem.
Can you verify that there is no problem when using 1.8.0 instead of 1.8.6?
I was able to roll the mongo gem back to 1.8.3 and it appears to be working. I get this same error when using 1.8.4 and 1.8.6. I haven't tried 1.8.5 or 1.8.0.
I can confirm that when running the tests, the MONGOHQ_URL is getting set properly and parsed by the connection method. I think that the connection specs might have changed in the mongo ruby driver between versions 1.8.3 and 1.8.4. I will try to run the tests under both of these versions and post the results.
I did notice while digging around in there that after mongo 2, the Connection method will be deprecated for the MongoClient method: http://api.mongodb.org/ruby/current/Mongo/Connection.html. So, I'm thinking that this should probably be updated as well.
My Gemfile (working configuration):
*** LOCAL GEMS ***
actionmailer (3.2.13)
actionpack (3.2.13)
activemodel (3.2.13)
activerecord (3.2.13)
activeresource (3.2.13)
activesupport (3.2.13)
addressable (2.3.4)
angularjs-rails (1.0.6.1)
arel (3.0.2)
aws-s3 (0.6.3)
bcrypt-ruby (3.0.1)
better_errors (0.8.0)
bigdecimal (1.1.0)
binding_of_caller (0.7.1)
bootstrap-sass-rails (2.3.2.0)
brakeman (2.0.0)
bson (1.8.6)
bson_ext (1.8.6)
builder (3.0.4)
bundler (1.3.2)
callsite (0.0.11)
cancan (1.6.10)
capybara (2.1.0)
carrierwave (0.8.0)
chronic (0.9.1)
coderay (1.0.9)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.2)
cucumber (1.3.1)
cucumber-rails (1.3.1)
daemons (1.1.9)
dalli (2.6.3)
database_cleaner (1.0.1)
debug_inspector (0.0.2)
delayed_job (3.0.5)
devise (2.2.4)
diff-lcs (1.2.4)
erubis (2.7.0)
eventmachine (1.0.3)
excon (0.22.1)
execjs (1.4.0)
factory_girl (4.2.0)
factory_girl_rails (4.2.1)
fastercsv (1.5.5)
fog (1.11.1)
formatador (0.2.4)
formtastic (2.2.1)
gherkin (2.12.0)
haml (4.0.3)
haml-rails (0.4)
hashr (0.0.22)
highline (1.6.19)
hike (1.2.2)
hirefire-resource (0.1.1)
i18n (0.6.1)
io-console (0.3)
jasmine-core (1.3.1)
jasmine-rails (0.4.3)
journey (1.0.4)
jquery-datatables-rails (1.11.2)
jquery-fileupload-rails (0.4.1)
jquery-rails (2.2.1)
json (1.8.0, 1.5.5)
kaminari (0.13.0)
launchy (2.3.0)
mail (2.5.4)
meta_request (0.2.5)
method_source (0.8.1)
mime-types (1.23)
mini_magick (3.6.0)
minitest (2.5.1)
mm-carrierwave (0.0.2)
mm-devise (2.0)
mongo (1.8.3)
mongo_mapper (0.12.0)
mongo_mapper_ext (0.2.7)
mongo_sequence (1.0.1)
mongo_session_store-rails3 (4.0.0)
multi_json (1.7.3)
net-scp (1.1.1)
net-ssh (2.6.7)
newrelic_rpm (3.6.2.96)
nokogiri (1.5.9)
orm_adapter (0.4.0)
pdfkit (0.5.2)
plucky (0.5.2)
polyglot (0.3.3)
pry (0.9.12.2)
pry-nav (0.2.3)
pry-rails (0.3.0)
pry-stack_explorer (0.4.9)
qu (0.2.0)
qu-mongo (0.2.0)
rack (1.4.5)
rack-cache (1.2)
rack-contrib (1.1.0)
rack-ssl (1.3.3)
rack-test (0.6.2)
rack-timeout (0.0.4)
rails (3.2.13)
railties (3.2.13)
rake (10.0.4, 0.9.2.2)
rb-readline (0.4.2)
rdoc (3.12.2, 3.9.5)
rest-client (1.6.7)
rmagick (2.13.2)
rspec-core (2.13.1)
rspec-expectations (2.13.0)
rspec-mocks (2.13.1)
rspec-rails (2.13.2)
ruby-hmac (0.4.0)
ruby2ruby (2.0.5)
ruby_parser (3.1.3)
sanitize (2.0.3)
sass (3.2.9)
sass-rails (3.2.6)
sexp_processor (4.2.1)
slim (1.3.9)
slop (3.4.5)
sprockets (2.2.2)
sprockets-rails (0.0.1)
subexec (0.2.3)
temple (0.6.5)
terminal-table (1.4.5)
thin (1.5.1)
thor (0.18.1)
tilt (1.4.1)
tire (0.4.1)
treetop (1.4.12)
tzinfo (0.3.37)
uglifier (2.1.1)
warden (1.2.1)
wicked_pdf (0.9.6)
wkhtmltopdf-binary (0.9.9.1)
xml-simple (1.1.2)
xpath (2.0.0)
yajl-ruby (1.1.0)
A pull request to fix it would be appreciated if you get it working.
This can be closed since the pull above was merged.
I'm not sure why I'm getting this now, but it seems to have just started happening. My app is running on Heroku and my app connects just fine to MongoHQ using this:
MongoMapper.config = { Rails.env => { 'uri' => ENV['MONGOHQ_URL'] } }
. However, whenever I try to create a Qu job (or even check the length), it throws this error:My config/qu.rb looks like this:
I can't seem to figure out what is causing this. It would seem that the db_name is not getting set properly and is probably nil, causing the validation error to fire. But this configuration used to work just fine.
Any help would be appreciated. Thanks.
Update: added a backtrace
Update: better backtrace