Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongo: different login on php5 and php7 #20

Open
sinacek opened this issue Aug 15, 2019 · 14 comments
Open

Mongo: different login on php5 and php7 #20

sinacek opened this issue Aug 15, 2019 · 14 comments

Comments

@sinacek
Copy link
Contributor

sinacek commented Aug 15, 2019

Hi,
with image dockette/adminer:full I'm not able connect to Mongo, because it returns Database does not support password..

I haven't allowed login without password.

I tried the same issue on version dockette/adminer:full-php5 and it works. I was not able find out how to fix it :/

Main problem is, that wrong connection doesn't throw exception.

I'm not sure if report it here or on the adminer repo.

@f3l1x
Copy link
Member

f3l1x commented Aug 28, 2019

Well, I've verified it in my image but I think it's not problem in there. Do you have any updates?

@sinacek
Copy link
Contributor Author

sinacek commented Aug 28, 2019

Unfortunately not. It still doesn't work with PHP 7.

@f3l1x
Copy link
Member

f3l1x commented Feb 21, 2020

How about now @sinacek ?

@sinacek
Copy link
Contributor Author

sinacek commented Feb 24, 2020

Still doesn't work.
docker run -ti --rm -p 80:80 -e MONGO_AUTH_SOURCE=admin dockette/adminer:full

@f3l1x
Copy link
Member

f3l1x commented Jul 26, 2020

What is MONGO_AUTH_SOURCE? Could you point me to php doc somewhere?

@sinacek
Copy link
Contributor Author

sinacek commented Jul 27, 2020

It's variable for authentication collection in Mongo. see vrana/adminer#358

https://docs.mongodb.com/manual/reference/connection-string/#urioption.authSource

@dream-mo
Copy link

image:dockette/adminer:full add env MONGO_AUTH_SOURCE=admin Still not useful. But use image:dockette/adminer:full-php5 is ok

@f3l1x
Copy link
Member

f3l1x commented Aug 31, 2020

It looks like change in php versions. I don't know where is the problem now. :(

@dream-mo
Copy link

https://github.com/vrana/adminer/blob/master/adminer/drivers/mongo.inc.php#L622

Is there a bug in the logic of the latest adminer code? It's just my guess. It feels weird anyway

$connection->_link = $connection->connect("mongodb://$server", $options);
if ($password != "") {       
	$options["password"] = "";
	try {
		$connection->connect("mongodb://$server", $options);
		return lang('Database does not support password.');                 // why return?
	} catch (Exception $ex) {
		// this is what we want
	}
}
return $connection;

@GaetanNaulin
Copy link

https://github.com/vrana/adminer/blob/master/adminer/drivers/mongo.inc.php#L622

Is there a bug in the logic of the latest adminer code? It's just my guess. It feels weird anyway

$connection->_link = $connection->connect("mongodb://$server", $options);
if ($password != "") {       
	$options["password"] = "";
	try {
		$connection->connect("mongodb://$server", $options);
		return lang('Database does not support password.');                 // why return?
	} catch (Exception $ex) {
		// this is what we want
	}
}
return $connection;

I try to move "return lang..." into catch, and now I'm able to connect to MongoDB. Many thanks !

@dream-mo
Copy link

dream-mo commented Sep 4, 2020

adminer-mongodb is not unstable, let's wait for it to stabilize later.

@SellamiRami
Copy link

Hello all, Do you have some new about adminer-mongodb? In fact, I have an authentication problem when I'm using Adminer 4.7.7. However, when I'm using Adminer 4.8, i succeded to authenticate my self, to add some data. Nevertheless, I'm not able to create a new database or a new Collection.
Thanks in advance for the response.

@f3l1x
Copy link
Member

f3l1x commented May 31, 2021

Hi @SellamiRami. Have you tried to use phar version of Adminer (https://github.com/vrana/adminer/releases/tag/v4.8.1)? We should locate this issue, if it's in adminer itself or in dockette/adminer.

@f3l1x
Copy link
Member

f3l1x commented Aug 11, 2021

Can you please test latest version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants