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

Unable to connect to jboss-cli on OpenShift #210

Open
jmesnil opened this issue Sep 20, 2024 · 1 comment
Open

Unable to connect to jboss-cli on OpenShift #210

jmesnil opened this issue Sep 20, 2024 · 1 comment

Comments

@jmesnil
Copy link
Contributor

jmesnil commented Sep 20, 2024

I'm unable to connect locally to the jboss-cli when the image is deployed on OpenShift.

sh-5.1$ whoami 
1006870000
sh-5.1$ $JBOSS_HOME/bin/jboss-cli.sh -c

Authenticating against security realm: ManagementRealm
Username: 
Failed to connect to the controller: Unable to authenticate against controller at localhost:9990: Authentication failed: all available authentication mechanisms failed:
   JBOSS-LOCAL-USER: javax.security.sasl.SaslException: JBOSS-LOCAL-USER: Server rejected authentication
   DIGEST-MD5: javax.security.sasl.SaslException: ELY05053: Callback handler failed for unknown reason [Caused by javax.security.sasl.SaslException: No username supplied.]

As I am connecting locally from a terminal, I should be identified as the special $local user and I don't need to have created an admin user.

This does not work on OpenShift (tested on 4.16.4).

However, doing the same thing from docker or Kubernetes works as expected.

The issue might related to some specific user permission as OpenShift does not identify the user as jboss but as 1006870000

With docker

$ docker run -p 8080:8080 quay.io/wildfly/wildfly
$  docker exec -it cranky_chaum /bin/bash
bash-5.1$ whoami
jboss
bash-5.1$ $JBOSS_HOME/bin/jboss-cli.sh -c
[standalone@localhost:9990 /]

With Kubernetes

$ kubectl create deployment wildlfy-app --image=quay.io/wildfly/wildfly
$ kubectl exec wildlfy-app-845cdb557f-ddjgr --stdin --tty -- /bin/bash
bash-5.1$ whoami
jboss
bash-5.1$ $JBOSS_HOME/bin/jboss-cli.sh -c
[standalone@localhost:9990 /]
@jmesnil
Copy link
Contributor Author

jmesnil commented Sep 20, 2024

The jboss user is created in the Docker image with

RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /opt/jboss -s /sbin/nologin -c "JBoss user" jboss && \
    chmod 755 /opt/jboss

As a comparison, the quay.io/wildfly/wildlfy-runtime is using the 185 UID to create its jboss user (at https://github.com/wildfly/wildfly-cekit-modules/blob/59426a5dff4a116dc901c3b187c41fb44bd85fcb/jboss/container/user/configure.sh#L8)

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

1 participant