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

GRPC library content type breaks Nexus artifact storage #45685

Closed
tmulle opened this issue Jan 17, 2025 · 12 comments
Closed

GRPC library content type breaks Nexus artifact storage #45685

tmulle opened this issue Jan 17, 2025 · 12 comments
Assignees
Labels
area/grpc gRPC kind/bug Something isn't working

Comments

@tmulle
Copy link
Contributor

tmulle commented Jan 17, 2025

Describe the bug

This isn't directly a Quarkus bug, but the GRPC library it uses in relation to Nexus/Maven.

We use a corporate Nexus proxy of Maven central as well as our internal libraries.
When trying to build with GRPC libraries in Quarkus I got the following error which ultimately caused Nexus to not store the artifact in the repo.

Turning off strict meta/mime-type validation on the Nexus repo fixes it, but it looks like the mimetype of GRPC is incorrect?

I know most people probably don't use a Nexus Proxy and go straight to Maven Central, I just thought I'd bring it up to help those of us that do and save a day of troublshooting like it took me.

org.sonatype.nexus.repository.view.handlers.ExceptionHandler - Invalid content: GET /io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe: org.sonatype.nexus.repository.InvalidContentException: Detected content type [application/x-sharedlib], but expected [application/x-executable, application/x-dosexec, application/x-msdownload]: io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe

Expected behavior

Looks like Nexus thinks the mimetype should be one of: expected [application/x-executable, application/x-dosexec, application/x-msdownload]

Actual behavior

It Detected content type [application/x-sharedlib]

How to Reproduce?

Turn on Validation of mimetype for your repository storage for the Maven Central repo and try to build and you should see an error similiar to:

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.17.7:generate-code (default) on project code-with-quarkus-temporal: Quarkus code generation phase has failed: Failed to bootstrap application in NORMAL mode: Failed to resolve artifact io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1: The following artifacts could not be resolved: io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 (absent): Could not find artifact io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 in nexus-mirror

Output of uname -a or ver

linux and osX

Output of java -version

No response

Quarkus version or git rev

3.17.5

Build tool (ie. output of mvnw --version or gradlew --version)

maven

Additional information

No response

@tmulle tmulle added the kind/bug Something isn't working label Jan 17, 2025
@quarkus-bot quarkus-bot bot added the area/grpc gRPC label Jan 17, 2025
Copy link

quarkus-bot bot commented Jan 17, 2025

/cc @alesj (grpc), @cescoffier (grpc)

@cescoffier
Copy link
Member

Is it related to gRPC or to the artifact resolver?

@cescoffier
Copy link
Member

From the report, it seems that the resolver is not using the right mime type. But the resolution is delegated to Maven/Gradle. Not sure we can do anything

@tmulle
Copy link
Contributor Author

tmulle commented Jan 19, 2025

I'm not sure, Nexus is downloading the file just fine for Maven but when Nexus runs its validation on the mimetype it fails and doesn't put it into its cache and those artifacts are not available.

Changing Nexus to NOT be strict about the mimetype makes it work which I'm fine with.

I wasn't sure how the mimetype gets set on the artifact themselves which I think is what Nexus is looking at. Something in the metadata?

Anyway, not sure how to fix it I just wanted to bring it up in case other Nexus users hit this.

@aloubyansky
Copy link
Member

@tmulle just for testing purposes, would it work if you added io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 as a direct dependency of your project?

@tmulle
Copy link
Contributor Author

tmulle commented Jan 23, 2025

@aloubyansky It doesn't work if I try adding the direct dependency.

Again, the issue isn't the artifact isn't pulled by Maven. It's that Nexus is saying the metadata for that file is incorrect.

Now, I don't know if that's true or not. I don't know how Nexus is determining what the metadata type should be. But the fact it works for other artifacts seems to me that Nexus is doing the correct validation check.

org.sonatype.nexus.repository.view.handlers.ExceptionHandler - Invalid content: GET /io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe: org.sonatype.nexus.repository.InvalidContentException: Detected content type [application/x-sharedlib], but expected [application/x-executable, application/x-dosexec, application/x-msdownload]: io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe

Like I said earlier, turning off the STRICT metadata check in the maven-central repository setting in my Nexus mirror lets the artifact be stored and then my build succeeds.

@aloubyansky
Copy link
Member

I'm trying to clarify which resolver fails to download it: the Quarkus one, the Maven one or both.
When that artifact is a direct dependency, is it getting resolved for mvn compile?

@tmulle
Copy link
Contributor Author

tmulle commented Jan 24, 2025

@aloubyansky Ah ok, then YES when used a direct dependency maven fails to resolve the artifact itself just as before but with slightly different failure messages.

Technically, Maven IS resolving the artifact because it pulling it from Maven central via Nexus it's just that the metadata inside those artifacts is midentified as "so" instead of "exe"?

Here is the output from both direct dependency and without (normal).

Before each run, I did a rm -rf ~/.m2/repository/io/grpc and also deleted the folder on my Nexus server so it would force a repull from Maven central.

Normal Transitive Dependency - Causes Nexus Metadata error

POM

 <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-grpc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

OUTPUT

❯ mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< org.acme:code-with-quarkus-grpc-nexus >----------------
[INFO] Building code-with-quarkus-grpc-nexus 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.pom (1.8 kB at 8.5 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.pom (1.8 kB at 150 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.pom (2.9 kB at 222 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.pom (2.7 kB at 207 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.pom (1.9 kB at 144 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.pom (2.0 kB at 178 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.pom (2.7 kB at 208 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.pom (2.0 kB at 71 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.jar (289 kB at 10.0 MB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.jar (99 kB at 3.9 MB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.jar (295 B at 9.5 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.jar (7.9 kB at 245 kB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.jar (50 kB at 1.1 MB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.jar (642 kB at 13 MB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.jar (5.3 kB at 100 kB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.jar (314 kB at 5.9 MB/s)
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ code-with-quarkus-grpc-nexus ---
[INFO] Deleting /Users/tmulle/Downloads/code-with-quarkus-grpc-nexus/target
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ code-with-quarkus-grpc-nexus ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO]
[INFO] --- quarkus:3.17.8:generate-code (default) @ code-with-quarkus-grpc-nexus ---
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/org/acme/code-with-quarkus-grpc-nexus/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1.pom (1.3 kB at 108 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.036 s
[INFO] Finished at: 2025-01-24T08:14:58-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.17.8:generate-code (default) on project code-with-quarkus-grpc-nexus: Quarkus code generation phase has failed: Failed to bootstrap application in NORMAL mode: Failed to resolve artifact io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1: The following artifacts could not be resolved: io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 (absent): Could not find artifact io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 in nexus-mirror (https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group) -> [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/MojoExecutionException

Direct Dependency - Causes Nexus Metadata error

POM

<dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-grpc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>protoc-gen-grpc-java</artifactId>
            <version>1.65.1</version>
            <classifier>linux-aarch_64</classifier>
            <type>exe</type>
        </dependency>
    </dependencies>

OUTPUT

❯ mvn clean compile
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------< org.acme:code-with-quarkus-grpc-nexus >----------------
[INFO] Building code-with-quarkus-grpc-nexus 1.0.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.pom (1.8 kB at 13 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.pom (1.8 kB at 150 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.pom (2.9 kB at 240 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.pom (2.7 kB at 225 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.pom (1.9 kB at 170 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.pom (2.0 kB at 163 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.pom (2.7 kB at 208 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.pom (2.0 kB at 153 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1.pom
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1.pom (1.3 kB at 108 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-netty/1.65.1/grpc-netty-1.65.1.jar (289 kB at 10.0 MB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.jar
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-util/1.65.1/grpc-util-1.65.1.jar (99 kB at 4.5 MB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-context/1.65.1/grpc-context-1.65.1.jar (295 B at 12 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.jar
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf/1.65.1/grpc-protobuf-1.65.1.jar (5.3 kB at 182 kB/s)
Downloading from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-stub/1.65.1/grpc-stub-1.65.1.jar (50 kB at 1.4 MB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-protobuf-lite/1.65.1/grpc-protobuf-lite-1.65.1.jar (7.9 kB at 207 kB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-core/1.65.1/grpc-core-1.65.1.jar (642 kB at 15 MB/s)
Downloaded from nexus-mirror: https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group/io/grpc/grpc-api/1.65.1/grpc-api-1.65.1.jar (314 kB at 6.8 MB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.229 s
[INFO] Finished at: 2025-01-24T08:31:28-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project code-with-quarkus-grpc-nexus: Could not resolve dependencies for project org.acme:code-with-quarkus-grpc-nexus:jar:1.0.0-SNAPSHOT
[ERROR] dependency: io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 (compile)
[ERROR] 	Could not find artifact io.grpc:protoc-gen-grpc-java:exe:linux-aarch_64:1.65.1 in nexus-mirror (https://nexus.redcypress-labs.duckdns.org/repository/mullehome-group)
[ERROR]
[ERROR] -> [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/DependencyResolutionException

Both methods cause Nexus to fail to store the artifact with this setting turned on on the repository and gives the error.

Checkbox to turn on/off validation of MetaData:

Turning it OFF (Unchecked) everything works fine, ON gives the error.

Image

ERROR

2025-01-24 13:31:28,268+0000 WARN [qtp849849463-1039] admin org.sonatype.nexus.repository.storage.StorageTxImpl - An exception occurred determining the content type of asset io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe in repository maven-central 2025-01-24 13:31:28,270+0000 WARN [qtp849849463-1039] admin org.sonatype.nexus.repository.view.handlers.ExceptionHandler - Invalid content: GET /io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe: org.sonatype.nexus.repository.InvalidContentException: Detected content type [application/x-sharedlib], but expected [application/x-executable, application/x-dosexec, application/x-msdownload]: io/grpc/protoc-gen-grpc-java/1.65.1/protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe

Hope this helps! That's all the info I have.

@aloubyansky
Copy link
Member

@cstamas you may be interested in this one

@cstamas
Copy link
Contributor

cstamas commented Jan 24, 2025

https://github.com/sonatype/nexus-public/blob/main/components/nexus-mime/src/main/resources/builtin-mimetypes.properties#L35

Basically you need override. I was involved in Nx2 and I know how to do it, but in Nx3.... let me check

@cstamas
Copy link
Contributor

cstamas commented Jan 24, 2025

Related class seems same (and comes from Nx2), but Nx3 is full OSGi, so unsure where this change can be done, javadoc may give some help:
https://github.com/sonatype/nexus-public/blob/main/components/nexus-mime/src/main/java/org/sonatype/nexus/mime/internal/NexusMimeTypes.java#L36-L52

@tmulle
Copy link
Contributor Author

tmulle commented Jan 24, 2025

@cstamas Thanks..unfortunately it looks like in 3.x adding new mime types is a pain and not very user friendly based on searching on the net.

The quickest and easiest way to fix this is to just disable the "strict" checking of metadata on the repository in Nexus.

That's what I did and things work fine.

I'll close this with this comment since it seems to be on the Nexus side.

Thanks all for looking into it, I just wanted to get the information out there for anyone else using Nexus 3.x as their mirrors of Maven central.

@tmulle tmulle closed this as completed Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/grpc gRPC kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants