php-mongo / admin

PHPMongoAdmin provides full MongoDB management capabilities. Coded in PHP using Laravel as a RESTful API gateway with Vue JS for the front-end. PHP MongoDB Admin leverages ideas from tried & tested applications like PhpMyAdmin and RockMongo. Built for PHP 7.2+
GNU General Public License v3.0
9 stars 3 forks source link

Failed to parse MongoDB URI: 'mongodb+srv://x.x.x.x:27017' #9

Closed omyhub closed 3 years ago

omyhub commented 3 years ago

[2021-03-25 09:28:31] local.ERROR: Failed to parse MongoDB URI: 'mongodb+srv://x.x.x.x:27017'. Invalid service name in URI. {" exception":"[object] (MongoDB\Driver\Exception\InvalidArgumentException(code: 0): Failed to parse MongoDB URI: 'mongodb+srv://x.x.x.x:27017'. Invalid service name in URI. at /data/www/mongodbadmin/vendor/mongodb/mongodb/src/Client.php:116) [stacktrace]

relatived file: ./app/Helpers/MongoHelper.php ./app/Http/Classes/MongoConnection.php

version: admin-1.0.1-alpha-2.5

omyhub commented 3 years ago

i guess that it can't parse '+svr'

gilbert-rehling commented 3 years ago

Hi, thanks for the input.

From memory, we are adding the +srv in depending on selected settings.

The url is built up within the code, therefore adding it manually will fail to parse.. I will make a note of this to wrap the process in a test to check the input a bit more thoroughly..

I will be back onto the project full time after Easter and will also complete the remaining sections

Thank You, Gilbert Rehling

On Thu, Mar 25, 2021 at 7:41 PM omyhub @.***> wrote:

i guess that it can't parse '+svr'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/php-mongo/admin/issues/9#issuecomment-806506640, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATRDMT5NJSVFYCYWTRLYL3TFMANNANCNFSM4ZY7SO7A .

gilbert-rehling commented 3 years ago

This problem has been partially resolved with the latest push in early Sept. Options for creating MongoDb Cloud server configurations have now been added and the URI builder has been optimised to handle Atlas Cloud styled URI:
mongodb+srv://username:password@cluster-id.mongodb.net/database-name?retryWrites=true&w=majority

gilbert-rehling commented 3 years ago

ToDo: add another Server Configuration param to enforce the use of 'mongodb+srv" for non Atlas Cloud servers.

gilbert-rehling commented 3 years ago

Pending some more testing for non Atlas Cloud server using 'mongodb+srv, this issue will soon be closed

gilbert-rehling commented 3 years ago

This ability in the application has now been completed and verified. Welcome to MongoDb Atlas!!!