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

Quarkus maven plugin 3.12.1 artifact upload broken, Authentication failure in Azure Devops - 401, reason phrase: Unauthorized (401) #41713

Open
mkljajic91 opened this issue Jul 5, 2024 · 2 comments
Labels
area/maven env/windows Impacts Windows machines kind/bug Something isn't working

Comments

@mkljajic91
Copy link

mkljajic91 commented Jul 5, 2024

Describe the bug

I have azure devops pipline with maven goal deploy to upload artifact to https://myaddress.com, but upload to feed fails. I'm getting an error with status code: 401, reason phrase: Unauthorized (401)
Caused by: org.apache.http.client.HttpResponseException: status code: 401, reason phrase: Unauthorized (401)

To verify my personal access token and settings.xml configuration I tried deploy from build agent and my computer with mvn org.apache.maven.plugins:maven-deploy-plugin:2.4:deploy-file_________ command and it work.

So, i continue debuging on my computer with mvn deploy -X in project with few workaround from task: #33115 but without success.

Logos that may be useful

[DEBUG] Using transporter HttpTransporter from ClassRealm[extension>io.quarkus.platform:quarkus-maven-plugin:3.12.1, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@3d4eac69] with priority 5.0 for https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1 with username=TEST, password=***
Downloading from BLABLA: https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1/com/nnn/quarkus/quarkus-rrr/1.0.0-SNAPSHOT/maven-metadata.xml
[DEBUG] [org.apache.http.client.protocol.RequestAddCookies] (main) CookieSpec selected: default
[DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] (main) Connection request: [route: {s}->https://myaddress:443][total available: 0; route allocated: 0 of 50; total allocated: 0 of 100]
[DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] (main) Connection leased: [id: 0][route: {s}->https://myaddress:443][total available: 0; route allocated: 1 of 50; total allocated: 1 of 100]
[DEBUG] [org.apache.http.impl.execchain.MainClientExec] (main) Opening connection {s}->https://myaddress:443
[DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] (main) Connecting to myaddress/XXX.XX.XX.XX:443
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) Connecting socket to myaddress/XXX.XX.XX.XX:443 with timeout 10000
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) Enabled protocols: [TLSv1.3, TLSv1.2]
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_
AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_D
HE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS
_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECD
HE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_12
8_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) Starting handshake
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) Secure session established
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) negotiated protocol: TLSv1.3
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) negotiated cipher suite: TLS_AES_128_GCM_SHA256
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) peer principal: CN=.myaddress
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) peer alternative names: [
.myaddress]
[DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] (main) issuer principal: CN=XX, O=XXXXXXXX, C=XX
[DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] (main) Connection established XXX.XX.XX.XX:XXXX<->XXX.XX.XX.XX:443
[DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] (main) http-outgoing-0: set socket timeout to 1800000
[DEBUG] [org.apache.http.impl.execchain.MainClientExec] (main) Executing request GET /TEST/ProjectName/_packaging/BLABLA/maven/v1/com/nnn/quarkus/quarkus-rrr/1.0.0-SNAPSHOT/maven-metadata.xml HTTP/1.1
[DEBUG] [org.apache.http.impl.execchain.MainClientExec] (main) Target auth state: UNCHALLENGED
[DEBUG] [org.apache.http.impl.execchain.MainClientExec] (main) Proxy auth state: UNCHALLENGED
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> GET /TEST/ProjectName/_packaging/BLABLA/maven/v1/com/nnn/quarkus/quarkus-rrr/1.0.0-SNAPSHOT/maven-metadata.xml HTTP/1.1
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> Cache-Control: no-cache, no-store
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> Pragma: no-cache
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> Host: myaddress
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> Connection: Keep-Alive
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> User-Agent: Apache-Maven/3.9.8 (Java 21.0.2; Windows 10 10.0)
[DEBUG] [org.apache.http.headers] (main) http-outgoing-0 >> Accept-Encoding: gzip,deflate
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "GET /TEST/ProjectName/_packaging/BLABLA/maven/v1/com/nnn/quarkus/quarkus-rrr/1.0.0-SNAPSHOT/maven-metadata.xml HTTP/1.1[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "Cache-Control: no-cache, no-store[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "Pragma: no-cache[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "Host: myaddress[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "User-Agent: Apache-Maven/3.9.8 (Java 21.0.2; Windows 10 10.0)[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 >> "[\r][\n]"
[DEBUG] [org.apache.http.wire] (main) http-outgoing-0 << "HTTP/1.1 401 Unauthorized[\r][\n]"

[WARNING] Could not transfer metadata com.nnn.quarkus:quarkus-rrr:1.0.0-SNAPSHOT/maven-metadata.xml from/to BLABLA (https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1): status code: 401, reason phrase: Unauthorized (401)
org.eclipse.aether.transfer.MetadataTransferException: Could not transfer metadata com.nnn.quarkus:quarkus-rrr:1.0.0-SNAPSHOT/maven-metadata.xml from/to BLABLA (https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1): status code: 401, reason phrase: Unauthorized (401)

Caused by: org.apache.http.client.HttpResponseException: status code: 401, reason phrase: Unauthorized (401)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.2:deploy (default-deploy) on project quarkus-rrr: Failed to retrieve remote metadata com.nnn.quarkus:quarkus-rrr:1.0.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.nnn.quarkus:quarkus-rrr:1.0.0-SNAPSHOT/maven-metadata.xml from/to BLABLA (https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1): status code: 401, reason phrase: Unauthorized (401) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.2:deploy (default-deploy) on project quarkus-rrr: Failed to retrieve remote metadata com.nnn.quarkus:quarkus-rrr:1.0.0-SNAPSHOT/maven-metadata.xml: Could not transfer metadata com.nnn.quarkus:quarkus-rrr:1.0.0-SNAPSHOT/maven-metadata.xml from/to BLABLA (https://myaddress/TEST/ProjectName/_packaging/BLABLA/maven/v1): status code: 401, reason phrase: Unauthorized (401)

cc @aloubyansky

Expected behavior

maven deploy goal succeeds

Actual behavior

maven deploy goal fails

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

Java version: 21.0.2

Quarkus version or git rev

3.12.1

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

mvn 3.9.8

Additional information

maven-compiler-plugin 3.13.0

@mkljajic91 mkljajic91 added the kind/bug Something isn't working label Jul 5, 2024
@quarkus-bot quarkus-bot bot added area/maven env/windows Impacts Windows machines labels Jul 5, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 5, 2024

/cc @quarkusio/devtools (maven)

@mkljajic91
Copy link
Author

mkljajic91 commented Jul 12, 2024

My workaround for this issue is using wagon transporter:

mvn deploy "-Dmaven.resolver.transport=wagon"

https://maven.apache.org/guides/mini/guide-resolver-transport.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/maven env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant