Mongo restore fail..

58 views
Skip to first unread message

Dustin Williams

unread,
Apr 21, 2017, 5:03:44 PM4/21/17
to Errbit
I have a project where I have to ship a docker image of errbit that connects to a mongodb. In this environment we have to have Errbit preconfigured and easily deployed by a consultant.

I have Errbit running in a container and connected to a remote mongodb (in a virtual machine).
I've setup our applications so each has an API key.
I setup the users accounts.
I ran MongoDump to create a archive file of the errbit collection (I did the whole server since it's dedicated instance of mongo).

I then restored the Mongo archive to a different instance of Mongo (#2).
Started up Errbit in the docker and connect it to Mongo #2.
Errbit startups up but I can't login.
When I try to reset the password it tells me email address is not found.
But I can see the data in Mongo #2.

Any ideas on what I'm missing?

Stephen Crosby

unread,
Apr 21, 2017, 5:10:49 PM4/21/17
to err...@googlegroups.com
First thing I would try is to docker run ./bin/rails console and check out the DB connection. At first glance it seems like the behavior you'd get if you're accidentally connecting to an empty DB.

You can check to make sure errbit has the right database connection information like this:
[1] pry(main)> Mongoid.clients
=> {"default"=>{"uri"=>"mongodb://localhost/errbit_development"}}

And a quick sanity check to see if the contents look right:
[2] pry(main)> User.last
=> #<User _id: 58784d03f5ebdf1b14000000, created_at: 2017-01-13 03:44:03 UTC, updated_at: 2017-01-13 03:44:46 UTC, email: "err...@errbit.example.com", github_login: nil, github_oauth_token: nil, google_uid: nil, name: "Errbit Admin", admin: true, per_page: 30, time_zone: "UTC", encrypted_password: "$2a$10$DCNsV5JoMxuSkqhCmE3d0e/av0yT/xko650pLl0tAv9y/6wA5jr4y", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 1, current_sign_in_at: 2017-01-13 03:44:46 UTC, last_sign_in_at: 2017-01-13 03:44:46 UTC, current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", authentication_token: "zAbvMQYEoxUnTLZAyaKz">

--
You received this message because you are subscribed to the Google Groups "Errbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to errbit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dustin Williams

unread,
Apr 22, 2017, 9:04:12 AM4/22/17
to Errbit

Stephen. 

Thank you for the the quick reply. Your response made me see where I was making my mistake. I assumed that since the application started up (it failed when MongoDB wasn't availible) that it was connected to the Errbit collection. A quick update to my docker run command fixed the issue.

docker run -e "MONGO_URL=mongodb://192.168.1.10/errbit" -p 8080:8080 errbit/errbit:latest

I really appreciate the help this was the last outstanding issue on a project from hell... Who would have thought a 8 year old Ruby On Rails app didn't want to run in docker container and would fight me every step.. =P 


To unsubscribe from this group and stop receiving emails from it, send an email to errbit+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages