0

I'm creating a restheart plugin using the plugin skeleton but, after up docker-compose i get Authentication error 'restheart-plugin-skeleton_mongodb-initiate_1' container.

Container log:

MongoDB shell version v4.2.11
connecting to: mongodb://mongodb:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-12-15T18:13:45.056+0000 E  QUERY    [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:353:17
@(connect):2:6
2020-12-15T18:13:45.059+0000 F  -        [main] exception: connect failed
2020-12-15T18:13:45.059+0000 E  -        [main] exiting with code 1
MongoDB shell version v4.2.11
connecting to: mongodb://mongodb:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-12-15T18:13:47.178+0000 E  QUERY    [js] Error: Authentication failed. :
connect@src/mongo/shell/mongo.js:353:17
@(connect):2:6
2020-12-15T18:13:47.182+0000 F  -        [main] exception: connect failed
2020-12-15T18:13:47.182+0000 E  -        [main] exiting with code 1
Ed Barros
  • 3
  • 1

1 Answers1

0

This has just been fixed in last commit

Andrea Di Cesare
  • 1,125
  • 6
  • 11
  • Thank's Andrea Di Cesare, i've applied the patch in my base but the restheart-plugin-skeleton_mongodb-initiate_1 container don't started yet, the log container show this message: 2020-12-16T14:37:18.118+0000 E QUERY [js] Error: couldn't connect to server mongodb:27017, connection attempt failed: SocketException: Error connecting to mongodb:27017 (172.18.0.2:27017) :: caused by :: Connection refused : In another side, the mongo container is ok, i've tested in browser, accessing the url: http://localhost:27017 and mongodb is accessible. – Ed Barros Dec 16 '20 at 14:54
  • this is due to the mongo_initiate container starting before mongodb. it should retry until it makes it and stop...it only used to initiate the replica set (needed for some feature of restheart to work, like change streams and transactions) – Andrea Di Cesare Dec 16 '20 at 17:04