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

CTL_ON_CREATE register admin error stopping init in 23.10 #110

Closed
jmartin45-chwy opened this issue Feb 12, 2024 · 3 comments
Closed

CTL_ON_CREATE register admin error stopping init in 23.10 #110

jmartin45-chwy opened this issue Feb 12, 2024 · 3 comments
Milestone

Comments

@jmartin45-chwy
Copy link

We are trying to upgrade to 23.10 and we have the following in our terraform:

          env {
            # This will register the admin user if it does not already exist.
            name  = "CTL_ON_CREATE"
            value = "register admin ${local.ejabberd_admin_domain} ${local.ejabberd_admin_password}"
          }

Under 23.10 we are now getting an error and the container is not starting up, because the admin account already exists.

Is there a way to turn off this feature? If not is there a way to conditionally register a user if they don't already exist using CTL_ON_CREATE functionality?

:> ejabberdctl register admin {domain} {password}
Error: conflict: User admin@{domain} already registered
:> FAILURE in command 'register admin {domain} {password}' !!! Stopping ejabberd...
[os_mon] memory supervisor port (memsup): Erlang has closed
@prefiks
Copy link
Member

prefiks commented Feb 13, 2024

Indeed this is something new added in 23.10, but i see that we should also allow previous behaviour.

So to fix that in commit c0acc7a i added ability to ignore failing commands, and this can be triggered by adding "!" as first argument in this variable (so using "! register admin ${local.ejabberd_admin_domain} ${local.ejabberd_admin_password}" will execute that command, but will not exit if that commands fails).

@prefiks prefiks closed this as completed Feb 13, 2024
@prefiks
Copy link
Member

prefiks commented Feb 13, 2024

I also added this to ejabberd repository as commit processone/ejabberd@67a6776.

@jmartin45-chwy
Copy link
Author

Thanks!

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

No branches or pull requests

3 participants