processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
248 stars 137 forks source link

"Unknown option 'auth_opts' after ejabberd_auth_http install and config" on ejabberd start #263

Closed damirci closed 5 years ago

damirci commented 5 years ago

ejabberd version: 18.09 OS: Windows 10 Installed from: official binary installer.

As the title says and errors details are as below:

Error log:

2018-11-21 17:04:41.485 [error] <0.80.0>@ejabberd_config:validate_opts:1093 Unknown option 'auth_opts' 2018-11-21 17:04:41.486 [error] <0.80.0>@ejabberd_config:start:88 Failed to load configuration file C:/ProgramData/ejabberd/conf/ejabberd.yml 2018-11-21 17:04:41.486 [critical] <0.80.0>@ejabberd_app:start:69 Failed to start ejabberd application: unknown_option

ejabberd.log

2018-11-21 17:04:41.485 [error] <0.80.0>@ejabberd_config:validate_opts:1093 Unknown option 'auth_opts' 2018-11-21 17:04:41.486 [error] <0.80.0>@ejabberd_config:start:88 Failed to load configuration file C:/ProgramData/ejabberd/conf/ejabberd.yml 2018-11-21 17:04:41.486 [critical] <0.80.0>@ejabberd_app:start:69 Failed to start ejabberd application: unknown_option

tomhoefer commented 5 years ago

Is there any progress regarding this issue? Getting the same error using https://github.com/rroemhild/docker-ejabberd and the corresponding configuration:

-e "EJABBERD_CONTRIB_MODULES=ejabberd_auth_http" \
-e "EJABBERD_AUTH_PASSWORD_FORMAT=plain" \
-e "EJABBERD_RESTART_AFTER_MODULE_INSTALL=true" \
-e "EJABBERD_CUSTOM_AUTH_MODULE_OVERRIDE=ejabberd_auth_http" \
damirci commented 5 years ago

did you add the module config to the configuration file?

tomhoefer commented 5 years ago

Thanks - In the meanwhile I could fix the issue thanks to the following workaround https://github.com/processone/ejabberd-contrib/issues/262#issuecomment-439885699

vkelman commented 5 years ago

ejabberd version: 19.02 OS: Windows 10 Installed from: official binary installer.

I'm getting the same "Unknown option 'auth_opts' on ejabberd start after I installed ejabberd_auth_http. What I'm supposed to do now? Is it fixed in latest ejabberd itself but not yet in a binary 19.02?

Thank you

vkelman commented 5 years ago

I don't understand which files to copy where as a workaround. Could somebody explain again?

I suppose I need to copy .beam files located in C:\ProgramData\ejabberd.ejabberd-modules\ejabberd_auth_http\ebin to ejabberd itself, correct? But there is no "ebin" directory in either C:\Program Files\ejabberd-19.02 nor in C:\ProgramData\ejabberd.

badlop commented 5 years ago

Is it fixed in latest ejabberd itself but not yet in a binary 19.02?

It's fixed in the github repository source code. The next ejabberd release (and the binary installers) will include that fix.

I suppose I need to copy .beam files located in C:\ProgramData\ejabberd.ejabberd-modules\ejabberd_auth_http\ebin to ejabberd itself, correct? But there is no "ebin" directory in either C:\Program Files\ejabberd-19.02 nor in C:\ProgramData\ejabberd.

Right, copy the module .beam files to the same directory where ejabberd has the other .beam files. Search for a file called ejabberd.beam, for example. Search well, they may be in some sub-sub-directory. I found them in this path:

C:\Program Files\ejabberd-19.02\lib\ejabberd-19.02\ebin

vkelman commented 5 years ago

Got it, thanks for an immediate response. I'm copying all the files, including ejabberd_auth_http.beam, correct?

Unrelated question: before I copied those .beam files I couldn't start ejabberd even if auth_method was not set to http in C:\ProgramData\ejabberd\conf\ejabberd.yml. I found that commenting out lines in C:\ProgramData\ejabberd.ejabberd-modules\ejabberd_auth_http\conf\ejabberd_auth_http.yml were allowing me to start ejabberd. So, my question there: After I copy auth_method and auth_opts from ejabberd_auth_http.yml to ejabberd.yml, is the first .yml file still used? Are they both used?

Sorry for stupid questions, I'm totally new to Erlang and ejabberd. I'm evaluation a possibility of switching our existing chat application from Openfire to ejabberd to overcome some Openfire scalability and security issues... and it drives me crazy.

badlop commented 5 years ago

I'm copying all the files, including ejabberd_auth_http.beam, correct?

Yes, all the .beam files, and also any .dll or other binary files, if any.

Are they both used?

Both files are read. So, put your options only in one of them. Probably you prefer everything in ejabberd.yml, and have an empty ejabberd_auth_http.yml

tomhoefer commented 5 years ago

I am using a docker image to run ejabberd... Below you will find my docker file to "workaround" the issue

FROM ejabberd/ecs:18.09

# Workaround according to https://github.com/processone/ejabberd-contrib/issues/262#issuecomment-439885699
# Initially adapt yaml configuration regarding auth options
# Download and install ejabberd 18.06, install http auth module and copy the files to 'this' ejabberd´s modules directory
# Check https://github.com/processone/ejabberd-contrib/issues/211#issuecomment-295681585 for additional information
COPY modules/ejabberd_auth_http /home/ejabberd/.ejabberd-modules/ejabberd_auth_http
COPY modules/ejabberd_auth_http/ebin/* /home/ejabberd/lib/ejabberd-18.6.0/ebin/

COPY ejabberd.yml /home/ejabberd/conf/ejabberd.yml