-1

Since I use mongodb-clients 2.6.10 the mongodump doesn't work anymore. With the previous version 3.4.7 everything worked fine. It is a dedicated mongodb database as a service in the CF AppCloud where nothing has been changed. Unfortunately, it is not possible to use version 3.4.7 again. Does anyone have an idea why it doesn't work anymore?

vcap@host:~$ mongodump -u XXX -p XXX -d XXX --authenticationDatabase XXX -h kubernetes-service-node.service.consul:XXX,kubernetes-service-node.service.consul:XXX,kubernetes-service-node.service.consul:XXX    

Result: https://jsfiddle.net/yz1kp68p/

seinol
  • 71
  • 10

2 Answers2

1

Judging from the error, it's probably got nothing to do with the mongodump version. Can you generally connect to the database (i.e. with the mongo shell instead of mongodump)? My guess is that the app either isn't bound (cf bind-service) to the database or hasn't been restaged (cf restage) after being bound - both is necessary to enable firewall access from the app to the database. Also, why can't you use a newer mongodump version anymore? Sounds more like that's what needs to be addressed in the first place.

Sandro Mathys
  • 474
  • 3
  • 7
  • Yes I can connect to the db over a service connector and Studio 3T. The db service is now correctly bound to the app (I found also a problem there before). The db is already bound to the app by pushing, so no restage is necessary anymore. Now I have a new error message: – seinol May 25 '18 at 11:39
  • connected to: kubernetes-service-node.service.consul:51833 assertion: 18 { ok: 0.0, errmsg: "auth failed", code: 18, codeName: "AuthenticationFailed" } – seinol May 25 '18 at 11:40
  • I have checked the credentials several times and I can guarantee that they are correct... – seinol May 25 '18 at 11:53
  • @seinol hm, checking the documentation, mongodump only started to support the SCRAM-SHA-1 authentication mechanism with 3.0, so an older version won't work. As I said before, the issue you need to address is why you can't using a newer version, as 2.6 is terribly old. – Sandro Mathys May 25 '18 at 13:30
  • Ahh yes, sorry I forgot to answer you this. The container where I use mongodump is an Ubuntu trusty (14.04), so out of the package repo is only mongodb-clients 2.6 available. It's extremly hard to install an newer version on trusty, because the package has very much deps and I have to install them over a buildpack (https://github.com/cloudfoundry/apt-buildpack). – seinol May 25 '18 at 13:39
  • I made last year a hotfix... I managed to install a running mongodb-clients package with the repos from zesty, but unfortunately zesty is out of life... I had no success with other hacks (i.e. other versions) until today – seinol May 25 '18 at 13:42
  • @seinol If that's somehow possible with the apt-buildpack, use the repo and packages provided by MongoDB: https://docs.mongodb.com/v3.4/tutorial/install-mongodb-on-ubuntu/ ...or upgrade to xenial or such. Becauce there's no way you can get this working with the 2.6 clients, I'm afraid. – Sandro Mathys May 25 '18 at 13:47
  • Unfortunately, I can isntall packages only via the apt-buildpack, because I don't have enough permissions in the linux container. I tried thousands of variants with the buildpack, but without success. An update to Xenial is also not possible. I'll have to find a completely different solution. Thanks for your help. – seinol May 25 '18 at 13:56
  • @seinol Why do you want to mongodump from within the app container in the first place? In most cases using an ssh tunnel (cf ssh -L) and using mongodump locally would make more sense. – Sandro Mathys May 25 '18 at 14:59
  • The App which I use the mongodump inside is an automated sql dumper app. Actually she is dumping all mysql db's in the cloud and storing the dumps to an s3 storage. So it would be nice when the same app also can dump the nosql db's automatically. – seinol May 28 '18 at 06:25
0

I successfully installed mongo-tools from the Ubuntu artful repository to have a mongodump version that supports SCRAM-SHA-1 authentication mechanism. The dumper app now works without problems. Installing mongodb-clients out of the artful repository did not work in my case, but mongo-tools did it.

seinol
  • 71
  • 10