dokku / dokku-mongo

a mongo plugin for dokku
MIT License
174 stars 32 forks source link

Impossible to export... #113

Closed sebseb30 closed 5 years ago

sebseb30 commented 5 years ago

Hello, I try to export with command dokku mongo:export dbname > back.dump The file is generated but empty ... What is the problem please ? Thanks

josegonzalez commented 5 years ago

Is the command exiting non-zero?

sebseb30 commented 5 years ago

Thanks for your answer But sorry I don't understand what you mean by non-zero ?

josegonzalez commented 5 years ago

Shell commands will exit with either exit code 0 or some other number. Anything other than zero means there was an error.

If you run dokku mongo:export dbname ; echo $?, what is the output (if any)? echo $? after a command will echo the last exit code.

sebseb30 commented 5 years ago

Thanks for the explain Jose It return 1 as exit code

josegonzalez commented 5 years ago

Can you run the following:

dokku --trace mongo:export dbname

And gist the entire output for me?

sebseb30 commented 5 years ago

Many thanks Jose for your help

josegonzalez commented 5 years ago

What is the output of

docker exec dokku.mongo.bmd bash -c 'mongodump -d bmd -u "bmd" -p "1f12f2c3fa132fe9a5cb23caf70def56" --authenticationDatabase "bmd" --quiet --gzip --archive 
sebseb30 commented 5 years ago

Nothing, it's like waiting for an input string

_

josegonzalez commented 5 years ago

Try:

docker exec dokku.mongo.bmd bash -c 'mongodump -d bmd -u "bmd" -p "1f12f2c3fa132fe9a5cb23caf70def56" --authenticationDatabase "bmd" --gzip --archive 
sebseb30 commented 5 years ago

Same thing it's like waiting an answer I see there is only one quote, so I try to close like this : docker exec dokku.mongo.bmd bash -c 'mongodump -d bmd -u "bmd" -p "1f12f2c3fa132fe9a5cb23caf70def56" --authenticationDatabase "bmd" --gzip --archive' and I have a message : Failed: error connecting to db server: server returned error on SASL authentication step: Authentication failed.

josegonzalez commented 5 years ago

Did you change the root password on that database at some point? Thats the only reason this would fail.

sebseb30 commented 5 years ago

Possible maybe I need for the application ( in my datasource.json with loopback I need password) Kid of db.changeUserPassword("bmd", .... But I am in root user isn't possible to export ?

josegonzalez commented 5 years ago

It's saying the root cannot authenticate, so I'm guessing you changed the root user password and the one we know about is now incorrect.

sebseb30 commented 5 years ago

So do you know how To put same password between mongodb and dokker or other I am a little bit loosing...

Many thanks Jose

josegonzalez commented 5 years ago

Change the root user password back to what it was before. Seems like that was 1f12f2c3fa132fe9a5cb23caf70def56. Do not change the password for future instances.

sebseb30 commented 5 years ago

Thanks a lot Jose ! It's ok now by changing all passwords !

josegonzalez commented 5 years ago

Great!

shsunmoonlee commented 5 years ago

@josegonzalez Hi! I have the similar issue running dokku mongo:import after changing my password for my dokku instance droplet. I get error connecting to db server: server returned error on SASL authentication step

Is there a way to change the password permanently? this password is too long to remember in emergency.