You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We were recently trying to connect to a remote MongoDB instance (hosted on MongoDB Atlas) and we configured the app with the following config in application.groovy (shows fake credentials)-
When we ran the app using ./gradlew bootRun the app started properly and a few domain instances created properly (which we defined in Bootstrap.groovy). But when we got to see in the MongoDB Atlas (both using their console and mongo shell, we were not finding the collection and any document created.
After 4-5 hours of debugging, we got to know that somehow the Grails is skipping the configuration and connecting to the local instance of MongoDB with test database.
Further investigation leads us to the solution that since the password was having @, it needs to be URL encoded-
After upgrading Grails to 4.0.9 to and GORM to 7.0.8, the silent connection to the database does not work instead the app startup freezes and the app never bootstraps.
The text was updated successfully, but these errors were encountered:
Thanks to @AbhishekTaparia for finding out the issue 👏🏻
Environment
Problem
We were recently trying to connect to a remote MongoDB instance (hosted on MongoDB Atlas) and we configured the app with the following config in
application.groovy
(shows fake credentials)-When we ran the app using
./gradlew bootRun
the app started properly and a few domain instances created properly (which we defined inBootstrap.groovy
). But when we got to see in the MongoDB Atlas (both using their console andmongo shell
, we were not finding the collection and any document created.After 4-5 hours of debugging, we got to know that somehow the Grails is skipping the configuration and connecting to the local instance of MongoDB with
test
database.Further investigation leads us to the solution that since the password was having
@
, it needs to be URL encoded-So when we changed our line as above, the app connected properly to the remote MongoDB host.
Actual Behaviour
The app silently ignores the error and connects to the
test
database in local MongoDB instance.Expected Behaviour
The app startup should fail and correct errors should be shown.
Demo application- https://github.com/AbhishekTaparia/test-grails-mongo-issue
Additional Info 1
After upgrading Grails to
4.0.9
to and GORM to7.0.8
, the silent connection to the database does not work instead the app startup freezes and the app never bootstraps.The text was updated successfully, but these errors were encountered: