keycloak / keycloak-quickstarts

Apache License 2.0
1.99k stars 986 forks source link

Issue when deploying app-profile-jee-vanilla with Wildfly #352

Closed Toma5OD closed 2 years ago

Toma5OD commented 2 years ago

Describe the bug

I have try to deploy app-profile-jee-vanilla on wildfly as described in the [Build and Deploy the Quickstart (https://github.com/keycloak/keycloak-quickstarts/tree/main/app-profile-jee-vanilla) documentation and I am facing the following mvn error when trying to deploy the quickstart:

'Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:deploy : Failed to execute goal deploy: {"WFLYCTL0062: Composite operation failed and was rolled back.'

More detailed screenshot of the errors in question from the Quickstart shell and the Wildfly Shell can be found [Screenshots of the errors] (https://drive.google.com/drive/folders/1-UikwADzidf0BVPBSl8zNntAsQsfIfub?usp=sharing)

The screenshots should be viewable for all Redhat emails.

Full copy of detailed error shown below also.

[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:deploy (default-cli) on project keycloak-app-profile-jee-vanilla: Failed to execute goal deploy: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"vanilla.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory. [ERROR] Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory. [ERROR] Caused by: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory."}}}} [ERROR] -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:deploy (default-cli) on project keycloak-app-profile-jee-vanilla: Failed to execute goal deploy: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"vanilla.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory. Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory. Caused by: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory."}}}} at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to execute goal deploy: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"vanilla.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory. Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory. Caused by: java.lang.IllegalStateException: The required mechanism 'BASIC' is not available in mechanisms [KEYCLOAK] from the HttpAuthenticationFactory."}}}} at org.wildfly.plugin.deployment.AbstractDeployment.execute (AbstractDeployment.java:152) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293) at org.apache.maven.cli.MavenCli.main (MavenCli.java:196) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [ERROR]

Any help would be appreciated.

Version

Running on docker as shown in 'https://github.com/keycloak/keycloak-quickstarts/blob/main/docs/getting-started.md#keycloak'

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Follow steps shown in Documentation.

Anything else?

No response

MauWein commented 2 years ago

Hey, how did you solve this?

Toma5OD commented 2 years ago

Hey I overcame this issue using the below steps.

Keycloak Version: Keycloak 19.0.1 (running on Podman) Wildfly Version: 23.0.2

When I ran Wildlfly I installed the adapter-install.cli and I then I installed the adapter-elytron-install.cli also. I then reloaded Wildfly and built the Quickstart succesfully.

I don't know why both adapters were required but without both installed the Quickstart would not build succesfully.

Hope this helps.

MauWein commented 2 years ago

Hey, still having some issues but don't know why. Feeling really lost over there. I am not able to install adapter-install-cli. Always getting this message: image But the Installation of the adapter-elytron-install.cli worked. When I try do deploy the vanilla thing I get this error: image

Any Idea how to install adapter-install.cli or/and get the deployment running?

Toma5OD commented 2 years ago

Hey, Apologies for the delayed response.

I went through the app-authz-jee-vanilla quickstart just now to make sure it was functioning correctly with Keycloak 19.0.2. I can confirm that it is working correctly.

Version: Keycloak 19.0.2 from build with Quarkus (although from Docker or Podman would also be fine) Version: Wildfly 23.0.2

I would recommend using the above version of Wildfly as other versions could have unforeseen issues.

When beginning the adapters I would recommend not starting Wildlfy until you've moved the bin, docs and module adapter files into your Wildfly folder.

If Wildfly is already started when you move the adapter files into its folders you will need to stop and start Wildfly before installing the adapters. Reloading it might also work but I would recommend stopping it totally and re running with ./bin/standalone.sh.

Not doing the above can cause the install of the adapter to fail yet if you retry it after doing the above it will also fail due to 'duplicate resource' although the adapter has not been installed correctly.

I would recommend starting with a fresh version of Wildfly 23.0.2 and trying the above. It should install correctly.

I found that I needed both adapters installed when using Wildfly 23.0.2. Install the legacy adapter first then reload then install the elytron adapter reload and you should be good to go.

After doing the above and following the steps in the Quickstart I had no issues with the build itself. With only the Elytron adapter installed I had issues with the build.

I hope this is clear and helps you.

Feeling lost is understandable it takes a little bit of getting used to.