keycloak / keycloak

Open Source Identity and Access Management For Modern Applications and Services
https://www.keycloak.org
Apache License 2.0
21.33k stars 6.49k forks source link

Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.14.2:pnpm (pnpm-install) on project keycloak-js-adapter-jar #26523

Closed TopherJan closed 5 months ago

TopherJan commented 6 months ago

Before reporting an issue

Area

core

Describe the bug

I tried building from source using the instructions in https://github.com/keycloak/keycloak/blob/21.1.2/docs/building.md. However, I encounter an error during build:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:42 min
[INFO] Finished at: 2024-01-26T07:07:31Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.14.2:pnpm (pnpm-install) on project keycloak-js-adapter-jar: Failed to run task: 'pnpm install --prefer-offline --frozen-lockfile --ignore-scripts' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :keycloak-js-adapter-jar

Version

main

Expected behavior

Success

Actual behavior

Failure

How to Reproduce?

Run the ./mvnw clean install

Anything else?

[INFO] --- frontend-maven-plugin:1.14.2:install-node-and-pnpm (default) @ keycloak-js-adapter-jar ---
[WARNING] Unable to determine current node version: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
[INFO] Installing node version v18.18.2
[INFO] Unpacking /root/.m2/repository/com/github/eirslett/node/18.18.2/node-18.18.2-linux-x64.tar.gz into /projects/temp/keycloak/node/tmp
[INFO] Copying node binary from /projects/temp/keycloak/node/tmp/node-v18.18.2-linux-x64/bin/node to /projects/temp/keycloak/node/node
[INFO] Installed node locally.
[INFO] PNPM 8.10.0 is already installed.
[INFO] Existing pnpm executable found, skipping linking.
[INFO]
[INFO] --- frontend-maven-plugin:1.14.2:pnpm (pnpm-install) @ keycloak-js-adapter-jar ---
[INFO] Running 'pnpm install --prefer-offline --frozen-lockfile --ignore-scripts' in /projects/temp/keycloak/js/libs/keycloak-js
[INFO] /projects/temp/keycloak/node/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /projects/temp/keycloak/node/node)
[INFO] /projects/temp/keycloak/node/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /projects/temp/keycloak/node/node)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Keycloak 999.0.0-SNAPSHOT:
[INFO]
[INFO] Keycloak BOM Parent ................................ SUCCESS [  1.115 s]
[INFO] Keycloak BOM for adapters .......................... SUCCESS [  0.018 s]
[INFO] Keycloak BOM for server extensions ................. SUCCESS [  0.026 s]
[INFO] Keycloak BOM utilities for the quickstarts ......... SUCCESS [  0.021 s]
[INFO] Keycloak ........................................... SUCCESS [  0.036 s]
[INFO] Keycloak Common .................................... SUCCESS [ 10.480 s]
[INFO] Keycloak Core ...................................... SUCCESS [  7.336 s]
[INFO] Keycloak Server SPI ................................ SUCCESS [  4.702 s]
[INFO] Keycloak Server Private SPI ........................ SUCCESS [  6.873 s]
[INFO] Keycloak Crypto Parent ............................. SUCCESS [  0.038 s]
[INFO] Keycloak Crypto Default ............................ SUCCESS [  8.319 s]
[INFO] Keycloak SAML Core Public API ...................... SUCCESS [  1.461 s]
[INFO] Keycloak SAML Core ................................. SUCCESS [  7.862 s]
[INFO] Keycloak Model Parent .............................. SUCCESS [  0.025 s]
[INFO] Keycloak Database Support .......................... SUCCESS [  0.758 s]
[INFO] Keycloak Database Support - Private classes ........ SUCCESS [  2.824 s]
[INFO] Keycloak REST Services ............................. SUCCESS [ 28.680 s]
[INFO] Keycloak Crypto FIPS 140-2 Integration ............. SUCCESS [  9.800 s]
[INFO] Keycloak Crypto Wildfly Elytron Integration ........ SUCCESS [  6.679 s]
[INFO] Keycloak JavaScript Adapter (JAR) .................. FAILURE [  2.530 s]
[INFO] Keycloak JavaScript Parent ......................... SKIPPED
[INFO] Keycloak Admin UI .................................. SKIPPED
[INFO] Keycloak Account UI ................................ SKIPPED
[INFO] Keycloak Themes .................................... SKIPPED
[INFO] Keycloak Dependencies Parent ....................... SKIPPED
[INFO] Keycloak Dependencies Server Min ................... SKIPPED
[INFO] Keycloak Model JPA ................................. SKIPPED
[INFO] Keycloak Kerberos Federation ....................... SKIPPED
[INFO] Keycloak LDAP UserStoreProvider .................... SKIPPED
[INFO] Keycloak Database Support - REST services .......... SKIPPED
[INFO] Keycloak Model Infinispan .......................... SKIPPED
[INFO] Keycloak SSSD Federation ........................... SKIPPED
[INFO] Keycloak Authz: Parent ............................. SKIPPED
[INFO] Keycloak AuthZ: Policy Provider Parent ............. SKIPPED
[INFO] Keycloak AuthZ: Common Policy Providers ............ SKIPPED
[INFO] Keycloak Dependencies Server All ................... SKIPPED
[INFO] Keycloak Quarkus Parent ............................ SKIPPED
[INFO] Keycloak Configuration API ......................... SKIPPED
[INFO] Keycloak Administration UI ......................... SKIPPED
[INFO] Admin UI REST extensions ........................... SKIPPED
[INFO] Keycloak Quarkus Server Extension .................. SKIPPED
[INFO] Keycloak Quarkus Server Deployment ................. SKIPPED
[INFO] Keycloak Docs Parent ............................... SKIPPED
[INFO] Keycloak Guides Maven Plugin ....................... SKIPPED
[INFO] Keycloak Guides .................................... SKIPPED
[INFO] Keycloak Federation ................................ SKIPPED
[INFO] Keycloak Util Embedded LDAP ........................ SKIPPED
[INFO] Keycloak Util Parent ............................... SKIPPED
[INFO] Keycloak Integration ............................... SKIPPED
[INFO] Keycloak Admin REST Client JavaEE .................. SKIPPED
[INFO] Keycloak Admin REST Client ......................... SKIPPED
[INFO] Keycloak Client Registration API ................... SKIPPED
[INFO] Keycloak Client CLI ................................ SKIPPED
[INFO] Keycloak Client Registration CLI ................... SKIPPED
[INFO] Keycloak Admin CLI ................................. SKIPPED
[INFO] Keycloak Client CLI Distribution ................... SKIPPED
[INFO] Keycloak Adapter SPI ............................... SKIPPED
[INFO] Keycloak Tomcat Adapter SPI ........................ SKIPPED
[INFO] Keycloak Undertow Integration SPI .................. SKIPPED
[INFO] Keycloak Servlet Integration ....................... SKIPPED
[INFO] Keycloak Jakarta Servlet Integration ............... SKIPPED
[INFO] Common JBoss/Wildfly Core Classes .................. SKIPPED
[INFO] Keycloak Jetty Adapter SPI ......................... SKIPPED
[INFO] Keycloak Client Adapter SPI Modules ................ SKIPPED
[INFO] Keycloak SAML Client Adapter Public API ............ SKIPPED
[INFO] Keycloak SAML Client Adapter Core .................. SKIPPED
[INFO] Keycloak SAML Client Adapter Core Jakarta .......... SKIPPED
[INFO] Keycloak Jetty Core SAML Integration ............... SKIPPED
[INFO] Keycloak Jetty 9.4.x SAML Integration .............. SKIPPED
[INFO] Keycloak SAML Jetty Integration .................... SKIPPED
[INFO] Keycloak Undertow SAML Adapter ..................... SKIPPED
[INFO] Keycloak SAML Tomcat Integration ................... SKIPPED
[INFO] Keycloak Tomcat Core SAML Integration .............. SKIPPED
[INFO] Keycloak Tomcat SAML Integration ................... SKIPPED
[INFO] Keycloak Authz: Client API ......................... SKIPPED
[INFO] Keycloak Authz: Policy Enforcer .................... SKIPPED
[INFO] Keycloak Adapter Core .............................. SKIPPED
[INFO] Keycloak WildFly Elytron SAML Adapter .............. SKIPPED
[INFO] Keycloak Wildfly SAML Adapter Subsystem ............ SKIPPED
[INFO] Keycloak WildFly Elytron Jakarta SAML Adapter ...... SKIPPED
[INFO] Keycloak Wildfly Jakarta SAML Adapter Subsystem .... SKIPPED
[INFO] Keycloak SAML Wildfly Integration .................. SKIPPED
[INFO] Keycloak SAML Servlet Filter ....................... SKIPPED
[INFO] Keycloak SAML Jakarta Servlet Filter ............... SKIPPED
[INFO] Keycloak SAML Client Adapter Modules ............... SKIPPED
[INFO] Keycloak Installed Application ..................... SKIPPED
[INFO] Keycloak JAX-RS OAuth Client ....................... SKIPPED
[INFO] Keycloak Jetty Core Integration .................... SKIPPED
[INFO] Keycloak Jetty 9.4.x Integration ................... SKIPPED
[INFO] Keycloak Jetty Integration ......................... SKIPPED
[INFO] Keycloak Servlet Filter Adapter Integration ........ SKIPPED
[INFO] Keycloak Servlet Filter Adapter Integration ........ SKIPPED
[INFO] Keycloak Tomcat Integration ........................ SKIPPED
[INFO] Keycloak Tomcat Core Integration ................... SKIPPED
[INFO] Keycloak Tomcat Integration ........................ SKIPPED
[INFO] Keycloak Undertow Integration ...................... SKIPPED
[INFO] spring-boot-container-bundle ....................... SKIPPED
[INFO] Keycloak Spring Security Integration ............... SKIPPED
[INFO] Keycloak Spring Boot Adapter Core .................. SKIPPED
[INFO] Keycloak Spring Boot 2 Integration ................. SKIPPED
[INFO] Keycloak Wildfly Elytron OIDC Adapter .............. SKIPPED
[INFO] Keycloak Wildfly Adapter Subsystem ................. SKIPPED
[INFO] Keycloak WildFly Integration ....................... SKIPPED
[INFO] Keycloak OIDC Client Adapter Modules ............... SKIPPED
[INFO] Keycloak Adapters .................................. SKIPPED
[INFO] Keycloak Misc ...................................... SKIPPED
[INFO] Keycloak :: Spring :: Boot ......................... SKIPPED
[INFO] Keycloak :: Spring :: Boot :: Default ::  Starter .. SKIPPED
[INFO] keycloak-test-helper ............................... SKIPPED
[INFO] Keycloak JavaScript Admin Client ................... SKIPPED
[INFO] Keycloak JavaScript Adapter ........................ SKIPPED
[INFO] Keycloak Quarkus Server App ........................ SKIPPED
[INFO] Keycloak Quarkus Server Distribution ............... SKIPPED
[INFO] Keycloak Quarkus Test Parent ....................... SKIPPED
[INFO] Keycloak Quarkus Server JUnit 5 Internal Test Framework SKIPPED
[INFO] Keycloak Quarkus Server Integration tests .......... SKIPPED
[INFO] Keycloak TestSuite ................................. SKIPPED
[INFO] DB Allocator Plugin ................................ SKIPPED
[INFO] Keycloak Arquillian Integration TestSuite .......... SKIPPED
[INFO] Test apps .......................................... SKIPPED
[INFO] Test apps distribution ............................. SKIPPED
[INFO] Keycloak Authz Tests: Hello World Example .......... SKIPPED
[INFO] Keycloak Authz: Servlet Authorization Test ......... SKIPPED
[INFO] Keycloak Authz: Simple Servlet App with Policy Enforcer SKIPPED
[INFO] integration-arquillian-test-apps-servlets .......... SKIPPED
[INFO] integration-arquillian-test-apps-servlets-jakarta .. SKIPPED
[INFO] Keycloak Test App Profile JEE ...................... SKIPPED
[INFO] integration-arquillian-test-apps-cors-parent ....... SKIPPED
[INFO] Angular Product Portal JS .......................... SKIPPED
[INFO] JAX-RS Database Service Using OAuth Bearer Tokens .. SKIPPED
[INFO] spring-boot-adapter-app ............................ SKIPPED
[INFO] Fuse Test Applications ............................. SKIPPED
[INFO] Customer Portal - Secured in Karaf/Fuse ............ SKIPPED
[INFO] CXF JAXRS Example - Secured in Karaf/Fuse .......... SKIPPED
[INFO] CXF JAXRS Example - Secured in Karaf/Fuse 7 on Undertow SKIPPED
[INFO] CXF JAXWS Example - Secured in Karaf/Fuse .......... SKIPPED
[INFO] CXF JAXWS Example - Secured in Karaf/Fuse 7 on Undertow SKIPPED
[INFO] Product Portal - Secured in Karaf/Fuse ............. SKIPPED
[INFO] Product Portal - Secured in Karaf/Fuse 7 on Undertow SKIPPED
[INFO] Camel endpoint example - Secured in Karaf/Fuse ..... SKIPPED
[INFO] Camel endpoint example - Secured in Karaf/Fuse 7.0 on Undertow SKIPPED
[INFO] Keycloak Fuse Example - Features ................... SKIPPED
[INFO] Keycloak Examples - External Config ................ SKIPPED
[INFO] Servers ............................................ SKIPPED
[INFO] Testsuite Adapter SPI .............................. SKIPPED
[INFO] Adapter Undertow SPI (JakartaEE) ................... SKIPPED
[INFO] Undertow OIDC Adapter (JakartaEE) .................. SKIPPED
[INFO] Undertow SAML Adapter (JakartaEE) .................. SKIPPED
[INFO] Auth Server ........................................ SKIPPED
[INFO] Auth Server Services ............................... SKIPPED
[INFO] Auth Server Services - Testsuite Providers Deployment SKIPPED
[INFO] Auth Server Services - Testsuite Providers ......... SKIPPED
[INFO] Keycloak TestSuite Utils ........................... SKIPPED
[INFO] Test Util .......................................... SKIPPED
[INFO] Auth Server - Undertow ............................. SKIPPED
[INFO] Auth Server - Quarkus .............................. SKIPPED
[INFO] App Server ......................................... SKIPPED
[INFO] App Server - SPI ................................... SKIPPED
[INFO] App Server - JBoss ................................. SKIPPED
[INFO] App Server - Wildfly ............................... SKIPPED
[INFO] App Server - Karaf ................................. SKIPPED
[INFO] App Server - Tomcat ................................ SKIPPED
[INFO] App Server - Undertow .............................. SKIPPED
[INFO] App Server - Jetty Parent .......................... SKIPPED
[INFO] Keycloak Arquillian Integration TestSuite - Cache Server SKIPPED
[INFO] Keycloak Arquillian Integration TestSuite - Cache Server - Infinispan SKIPPED
[INFO] Keycloak Arquillian Integration TestSuite - Cache Server - Legacy SKIPPED
[INFO] Tests .............................................. SKIPPED
[INFO] Base TestSuite ..................................... SKIPPED
[INFO] Other Tests Modules ................................ SKIPPED
[INFO] Tests for logical storage layer .................... SKIPPED
[INFO] Keycloak Examples .................................. SKIPPED
[INFO] Keycloak Examples - Admin Client ................... SKIPPED
[INFO] Provider Examples .................................. SKIPPED
[INFO] REST Example ....................................... SKIPPED
[INFO] Domain Extension Example ........................... SKIPPED
[INFO] Authenticator Example .............................. SKIPPED
[INFO] JS Console ......................................... SKIPPED
[INFO] Keycloak Examples - Kerberos Credential Delegation . SKIPPED
[INFO] Themes Examples .................................... SKIPPED
[INFO] SAML Examples ...................................... SKIPPED
[INFO] Keycloak SAML Adapter as a Servlet Filter .......... SKIPPED
[INFO] LDAP Demo Application .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:42 min
[INFO] Finished at: 2024-01-26T07:07:31Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.14.2:pnpm (pnpm-install) on project keycloak-js-adapter-jar: Failed to run task: 'pnpm install --prefer-offline --frozen-lockfile --ignore-scripts' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :keycloak-js-adapter-jar
lexcao commented 6 months ago

Hi @TopherJan Could you please try this steps to see if there are any errors since the logs from maven shows nothing

$ cd js/
$ pnpm install --prefer-offline --frozen-lockfile --ignore-scripts
jonkoops commented 6 months ago

We'll need a more detailed report than this to get to the bottom of the issue, try running the command using -e -X to get more information.

wanderzirkus commented 5 months ago

Hi, I faced a similar issue (https://keycloak.discourse.group/t/missing-vite-package-json-in-node-modules-during-building-keycloak/24503), but i am not sure if it has the same rootcause.

I just cloned main branch (nightly from 15.02.2024) and executed the build as described here: https://github.com/keycloak/keycloak/blob/main/docs/building.md

Long story short (see the post referenced above for details): In my case leaving the node_modules files in place during maven-clean-plugin execution in the "js/pom.xml" fixed the build. I figured out, that the node_modules directory wasnt clean up properly and .pnpm probably got confused because directories were still in place, but not their contents - and thus couldn't find a package.json it needed to proceed.

Maybe your build is fixed by removing "js/node_modules" entirely and run the build with this modification in the js/pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-clean-plugin</artifactId>
    <configuration>
        <followSymLinks>false</followSymLinks>
        <filesets>
            <fileset>
                <directory>${basedir}</directory>
                <includes>
                    <include>**/.wireit/**</include>
                    <!-- <include>**/node_modules/**</include> -->
                </includes>
            </fileset>
            <!-- include all non-maven projects here as well -->
            <fileset>
                <directory>apps/keycloak-server</directory>
                <includes>
                    <include>server/**</include>
                </includes>
            </fileset>
        </filesets>
    </configuration>
</plugin>

To any authority involved in making decisions about the codebase: Should I make a PR with the outcommented line deleted?

jonkoops commented 5 months ago

No need to make a PR, we're aware of this issue (see #27269). Closing this one as it's not actionable.

menasbeshay commented 4 months ago

@jonkoops @TopherJan I faced same issue, simply delete keycloak/js/node_modules and try to rebuild again this works for me but i face the same issue again with all js apps (Keycloak Admin UI, Keycloak Account UI) and if i fixed them by running: pnpm install --prefer-offline --frozen-lockfile --ignore-scripts

i faced the same error again

[INFO] Reactor Summary for Keycloak 999.0.0-SNAPSHOT: [INFO] [INFO] Keycloak ........................................... SUCCESS [ 0.907 s] [INFO] Keycloak Common .................................... SUCCESS [ 3.594 s] [INFO] Keycloak Core ...................................... SUCCESS [ 2.511 s] [INFO] Keycloak Server SPI ................................ SUCCESS [ 2.152 s] [INFO] Keycloak Server Private SPI ........................ SUCCESS [ 2.369 s] [INFO] Keycloak Crypto Parent ............................. SUCCESS [ 0.015 s] [INFO] Keycloak Crypto Default ............................ SUCCESS [ 0.500 s] [INFO] Keycloak SAML Core Public API ...................... SUCCESS [ 1.280 s] [INFO] Keycloak SAML Core ................................. SUCCESS [ 1.615 s] [INFO] Keycloak Model Parent .............................. SUCCESS [ 0.008 s] [INFO] Keycloak Database Support .......................... SUCCESS [ 0.289 s] [INFO] Keycloak Database Support - Private classes ........ SUCCESS [ 0.822 s] [INFO] Keycloak REST Services ............................. SUCCESS [ 8.732 s] [INFO] Keycloak Crypto FIPS 140-2 Integration ............. SUCCESS [ 0.736 s] [INFO] Keycloak JavaScript Adapter (JAR) .................. FAILURE [ 7.441 s] [INFO] Keycloak JavaScript Parent ......................... SKIPPED [INFO] Keycloak Admin UI .................................. SKIPPED [INFO] Keycloak Account UI ................................ SKIPPED [INFO] Keycloak Themes .................................... SKIPPED [INFO] Keycloak Model JPA ................................. SKIPPED [INFO] Keycloak Kerberos Federation ....................... SKIPPED [INFO] Keycloak LDAP UserStoreProvider .................... SKIPPED [INFO] Keycloak Database Support - REST services .......... SKIPPED [INFO] Keycloak Model Infinispan .......................... SKIPPED [INFO] Keycloak SSSD Federation ........................... SKIPPED [INFO] Keycloak Authz: Parent ............................. SKIPPED [INFO] Keycloak AuthZ: Policy Provider Parent ............. SKIPPED [INFO] Keycloak AuthZ: Common Policy Providers ............ SKIPPED [INFO] Keycloak Quarkus Parent ............................ SKIPPED [INFO] Keycloak Configuration API ......................... SKIPPED [INFO] Keycloak Administration UI ......................... SKIPPED [INFO] Admin UI REST extensions ........................... SKIPPED [INFO] Keycloak Quarkus Server Extension .................. SKIPPED [INFO] Keycloak Quarkus Server Deployment ................. SKIPPED [INFO] Keycloak Integration ............................... SKIPPED [INFO] Keycloak Client CLI ................................ SKIPPED [INFO] Keycloak Client Registration CLI ................... SKIPPED [INFO] Keycloak Admin CLI ................................. SKIPPED [INFO] Keycloak Client CLI Distribution ................... SKIPPED [INFO] Keycloak Quarkus Server App ........................ SKIPPED [INFO] Keycloak Quarkus Server Distribution ............... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE

also after successful build for any js project , the next project fails and all .ts files inside /js folder are deleted i have each time to continue build , remove node_modules under /js and/or restore all .ts files under /js

hope this info helps