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

Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing software.amazon.awssdk.http.auth.aws.internal.signer.util.ChecksumUtil$$Lambda$3525/0x00000007c1e167b8.get(Unknown Source) #4634

Closed
oflorez-airgraft opened this issue Oct 25, 2023 · 7 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@oflorez-airgraft
Copy link

Describe the bug

using the command mvn clean install -Dnative -Dquarkus.native.container-build=true -DskipTests -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-17

i got

Error: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: software.amazon.awssdk.crt.checksums.CRC32. This error is reported at image build time because class software.amazon.awssdk.http.auth.aws.internal.signer.checksums.Crc32Checksum is registered for linking at image build time by command line and command line.
Error encountered while parsing software.amazon.awssdk.http.auth.aws.internal.signer.util.ChecksumUtil$$Lambda/0x00000007c1edfd78.get(Unknown Source) 
Parsing context:
   at software.amazon.awssdk.utils.Logger.debug(Logger.java:85)
   at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.findConverter(DefaultAttributeConverterProvider.java:149)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: software.amazon.awssdk.crt.checksums.CRC32C. This error is reported at image build time because class software.amazon.awssdk.http.auth.aws.internal.signer.checksums.Crc32CChecksum is registered for linking at image build time by command line and command line.
Error encountered while parsing software.amazon.awssdk.http.auth.aws.internal.signer.util.ChecksumUtil$$Lambda/0x00000007c1ee4000.get(Unknown Source) 
Parsing context:
   at software.amazon.awssdk.utils.Logger.debug(Logger.java:85)
   at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.findConverter(DefaultAttributeConverterProvider.java:149)
   at root method.(Unknown Source)


com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: Discovered unresolved type during parsing: software.amazon.awssdk.crt.checksums.CRC32. This error is reported at image build time because class software.amazon.awssdk.http.auth.aws.internal.signer.checksums.Crc32Checksum is registered for linking at image build time by command line and command line.
Error encountered while parsing software.amazon.awssdk.http.auth.aws.internal.signer.util.ChecksumUtil$$Lambda/0x00000007c1edfd78.get(Unknown Source) 
Parsing context:
   at software.amazon.awssdk.utils.Logger.debug(Logger.java:85)
   at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.findConverter(DefaultAttributeConverterProvider.java:149)
   at root method.(Unknown Source)

Error: Discovered unresolved type during parsing: software.amazon.awssdk.crt.checksums.CRC32C. This error is reported at image build time because class software.amazon.awssdk.http.auth.aws.internal.signer.checksums.Crc32CChecksum is registered for linking at image build time by command line and command line.
Error encountered while parsing software.amazon.awssdk.http.auth.aws.internal.signer.util.ChecksumUtil$$Lambda/0x00000007c1ee4000.get(Unknown Source) 
Parsing context:
   at software.amazon.awssdk.utils.Logger.debug(Logger.java:85)
   at software.amazon.awssdk.enhanced.dynamodb.DefaultAttributeConverterProvider.findConverter(DefaultAttributeConverterProvider.java:149)
   at root method.(Unknown Source)


	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:815)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:593)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:551)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:538)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:720)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:142)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:97)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods

Expected Behavior

Creation of native executable

Current Behavior

Build is failling, before to upgrade software.amazon.awssdk:bom from 2.20.162 to 2.21.6. was working correctly

Reproduction Steps

upgrade software.amazon.awssdk:bom from 2.20.162 to 2.21.6 and use quarkus to generate native executable

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

2.20.162 and 2.21.6.

JDK version used

17

Operating System and version

ubuntu

@oflorez-airgraft oflorez-airgraft added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 25, 2023
@debora-ito
Copy link
Member

@oflorez-airgraft thank you for the report. We are investigating.

@debora-ito debora-ito self-assigned this Oct 25, 2023
@debora-ito debora-ito added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 25, 2023
@debora-ito
Copy link
Member

debora-ito commented Oct 25, 2023

@oflorez-airgraft can you share a sample code showing how you are using the DynamoDB Enhanced, so we can use to reproduce the error?
Also share your pom.xml.

@oflorez-airgraft
Copy link
Author

yes this is the constructor

 DynamoDBRoleRepository(DynamoDBClientConfigurationProperties properties) {
        this.dynamoDbClient = DynamoDbClient.builder()
                .region(Region.of(properties.region()))
                .credentialsProvider(DefaultCredentialsProvider.create())
                .endpointOverride(URI.create(properties.endpoint()))
                .build();
        DynamoDbEnhancedClient dynamoDbEnhancedClient = DynamoDbEnhancedClient.builder()
                .dynamoDbClient(dynamoDbClient)
                .build();
        String authenticatorTable = properties.authenticatorTable();
        this.roleInfoMappedTable = dynamoDbEnhancedClient.table(authenticatorTable, TableSchema.fromBean(RoleInfoDynamoDB.class));
    }

and my pom

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>*****88</groupId>
    <artifactId>********</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <amazon.awssdk.version>2.20.162</amazon.awssdk.version>
        <assembly-plugin.version>3.1.0</assembly-plugin.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <compiler-plugin.version>3.11.0</compiler-plugin.version>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus-plugin.version>3.5.0</quarkus-plugin.version>
        <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
        <quarkus.platform.version>3.5.0</quarkus.platform.version>
        <surefire-plugin.version>3.2.1</surefire-plugin.version>
        <mapstruct.version>1.5.5.Final</mapstruct.version>
        <javafaker.version>2.0.2</javafaker.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>${amazon.awssdk.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkus.platform</groupId>
                <artifactId>quarkus-amazon-services-bom</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-amazon-lambda-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-openapi</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-cognito-user-pools</artifactId>
        </dependency>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>url-connection-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-dynamodb</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-dynamodb-enhanced</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-ses</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${mapstruct.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- necessary for m2m log4j compatibility with quarkus
         https://quarkus.io/guides/logging#logging-adapters -->
        <dependency>
            <groupId>org.jboss.logmanager</groupId>
            <artifactId>log4j2-jboss-logmanager</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-test-security</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>localstack</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.datafaker</groupId>
            <artifactId>datafaker</artifactId>
            <version>${javafaker.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${surefire-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <native.image.path>
                                            ${project.build.directory}/${project.build.finalName}-runner
                                        </native.image.path>
                                        <java.util.logging.manager>org.jboss.logmanager.LogManager
                                        </java.util.logging.manager>
                                        <maven.home>${maven.home}</maven.home>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <quarkus.native.additional-build-args>--initialize-at-run-time=org.apache.commons.lang3.RandomUtils
                </quarkus.native.additional-build-args>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
        </profile>
    </profiles>
</project>

@scrocquesel
Copy link
Contributor

To give a bit more of context, Quarkus runs native-image with --link-at-build-time. With this argument, the optional aws-crt must be included.
To allow the optional package not to be included, the quarkus extension provide graalvm sdk substitution to remove any reference to crt before the analysis phase. With 2.21, a lot of code change and the way the code has been refactored make things very complicated to do substitution because reference to aws-crt is bloated in many classes with no high level abstraction to cut off.

@scrocquesel
Copy link
Contributor

@oflorez-airgraft Finally had the time to fix this at Quarkus side. You can use the latest bits from Quarkus Amazon Services bom.

@oflorez-airgraft
Copy link
Author

oflorez-airgraft commented Nov 13, 2023

hi @scrocquesel thanks so much for your effort, yes the solution was to use url-connection-client provided by quarkus-amazon-services-bom which is using 2.20.128 and not the latest one.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants