Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

unable to run with emqx_auth_mongo env variables #81

Closed
chipec84 opened this issue Oct 23, 2018 · 4 comments
Closed

unable to run with emqx_auth_mongo env variables #81

chipec84 opened this issue Oct 23, 2018 · 4 comments
Assignees

Comments

@chipec84
Copy link

Hello,

I am unable to run emqx-docker-v3.0-beta.3:latest with environement variables using the auth_mongo plugin.

Everything works perfectly fine when I configure the plugin through the DASHBOARD.

run command:

docker run --rm -ti --name emqx
-p 1883:1883 -p 8083:8083 -p 18083:18083
-e EMQX_ALLOW_ANONYMOUS=false
-e EMQ_LOADED_PLUGINS=”emqx_auth_mongo”
-e EMQX_AUTH__MONGO__SERVER=”192.168.1.3:27017”
-e EMQX_AUTH__MONGO__LOGIN=”xxx”
-e EMQX_AUTH__MONGO__PASSWORD=”xxx”
-e EMQX_AUTH__MONGO__AUTH_SOURCE=”xxx”
-e EMQX_AUTH__MONGO__DATABASE=”xxx”
-e EMQX_AUTH__MONGO__AUTH_QUERY__PASSWORD_HASH=plain
emqx-docker-v3.0-beta.3:latest

error log:

run_erl[678]: Erlang closed the connection.
20:27:56.767 [error] /opt/emqx/data/configs/app.2018.10.23.20.27.52.conf: Error converting value on line #2078 to latin1

EMQ version

emqx-docker-v3.0-beta.3:latest

Docker version

17.05.0

Work around

AUTH_MONGO configuration works with EMQX DASHBOARD, but every time the container is restarted, the whole configuration needs to be done again.

Thank you.

@eluchsinger
Copy link

Aren't you overriding all the default plugins when you set EMQ_LOADED_PLUGINS=”emqx_auth_mongo” ? And you have a typo in that. It should be EMQX_LOADED_PLUGINS.

@Rory-Z
Copy link
Contributor

Rory-Z commented Mar 27, 2019

@chipec84 Sorry to reply to you so late, you can try our latest version and specify the environment variable "EMQX_LOADED_PLUGINS=emqx_auth_mongo"

@chipec84
Copy link
Author

chipec84 commented May 9, 2019

just pulled emqx:latest and ran the following:

docker run --rm -ti --name emqx
-p 1993:1883 -p 2993:8083 -p 18083:18083
-e EMQX_ALLOW_ANONYMOUS=false
-e EMQX_LOADED_PLUGINS=”emqx_auth_mongo”
-e EMQX_AUTH__MONGO__SERVER=”192.168.1.3:27017”
-e EMQX_AUTH__MONGO__LOGIN=”xxx”
-e EMQX_AUTH__MONGO__PASSWORD=”xxx”
-e EMQX_AUTH__MONGO__AUTH_SOURCE=”xxx”
-e EMQX_AUTH__MONGO__DATABASE=”xxx”
-e EMQX_AUTH__MONGO__AUTH_QUERY__PASSWORD_HASH=plain
emqx/emqx:latest

I get the following error with no other logs:
run_erl[680]: Erlang closed the connection

Docker version: 17.05.0

@chipec84
Copy link
Author

Found the issue:
ENV variables should be passed without quotes.
It is very misleading because the quotes don’t appear in the logs, therefore thinking all is ok.
Maybe it should be written somewhere in the documentation?

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

No branches or pull requests

3 participants