Filipe Roque created MNG-8145:
---------------------------------

             Summary: GOAWAY received 
                 Key: MNG-8145
                 URL: https://issues.apache.org/jira/browse/MNG-8145
             Project: Maven
          Issue Type: Bug
          Components: Artifacts and Repositories
    Affects Versions: 4.0.0-beta-3
            Reporter: Filipe Roque


When using a repository mirror with an nginx reverse proxy, HTTP/2 connection 
may fail due to reaching 
[keepalive_requests:|http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests]
{code:java}
[ERROR] Failed to execute goal 
org.apache.felix:maven-bundle-plugin:5.1.9:manifest (bundle-manifest) on 
project commons-io: Execution bundle-manifest of goal 
org.apache.felix:maven-bundle-plugin:5.1.9:manifest failed: Plugin 
org.apache.felix:maven-bundle-plugin:5.1.9 or one of its dependencies could not 
be resolved: Failed to collect dependencies at 
org.apache.felix:maven-bundle-plugin:jar:5.1.9 -> 
org.apache.maven:maven-archiver:jar:3.5.2: Failed to read artifact descriptor 
for org.slf4j:slf4j-api:jar:1.7.25: The following artifacts could not be 
resolved: org.slf4j:slf4j-api:pom:1.7.25 (absent): Could not transfer artifact 
org.slf4j:slf4j-api:pom:1.7.25 from/to maven-localrepository1 
(https://localhost:8443/central): /127.0.0.1:42086: GOAWAY received -> [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 verbose output
[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/PluginResolutionException
{code}
 

This can be reproduced with:
{code:bash}
git clone --quiet --branch rel/commons-io-2.16.1 
[email protected]:apache/commons-io.git && cd commons-io

# builds OK without mirror and empty local repository
TEMP_M2=$(mktemp -d)
echo $TEMP_M2
cat >$TEMP_M2/empty_settings.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 
http://maven.apache.org/xsd/settings-1.0.0.xsd";>
</settings>
EOF
/opt/maven/apache-maven-4.0.0-beta-3/bin/mvn -s $TEMP_M2/empty_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -q clean verify -DskipTests


# prepare a nginx mirror
mkdir -p /tmp/docker-ssl-proxy/
#openssl req -subj '/CN=myhost.local' -x509 -newkey rsa:4096 -nodes -keyout 
/tmp/docker-ssl-proxy/key.pem -out /tmp/docker-ssl-proxy/cert.pem -days 365
openssl req -subj '/CN=localhost' -x509 -newkey rsa:4096 -nodes -keyout 
/tmp/docker-ssl-proxy/key.pem -out /tmp/docker-ssl-proxy/cert.pem -days 365

cat >/tmp/docker-ssl-proxy/default.conf <<EOF
server {
  listen 443 ssl;

  http2 on;

  # lower default value of 1000 for easier demonstration
  keepalive_requests 500;

  ssl_certificate /etc/nginx/conf.d/cert.pem;
  ssl_certificate_key /etc/nginx/conf.d/key.pem;

  location /central {
     proxy_pass https://repo.maven.apache.org/maven2;
  }
}
EOF

docker run -d --rm \
  --name my-custom-nginx-container \
  -p 8443:443 \
  -v /tmp/docker-ssl-proxy/:/etc/nginx/conf.d/ \
  nginx:1.27.0

cp /etc/ssl/certs/adoptium/cacerts /tmp/docker-ssl-proxy/mykeystore.jks
keytool \
  -keystore /tmp/docker-ssl-proxy/mykeystore.jks \
  -storepass changeit \
  -importcert \
  -alias SITENAME \
  -trustcacerts \
  -file /tmp/docker-ssl-proxy/cert.pem

TEMP_M2=$(mktemp -d)
echo $TEMP_M2
cat >$TEMP_M2/mirror_settings.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 
http://maven.apache.org/xsd/settings-1.0.0.xsd";>
  <mirrors>
   <mirror>
    <id>maven-localrepository1</id>
    <mirrorOf>central</mirrorOf>
    <url>https://localhost:8443/central</url>
   </mirror>
  </mirrors>
</settings>
EOF

export 
MAVEN_OPTS='-Djavax.net.ssl.trustStore=/tmp/docker-ssl-proxy/mykeystore.jks 
-Djavax.net.ssl.trustStorePassword=changeit'
/opt/maven/apache-maven-4.0.0-beta-3/bin/mvn -s $TEMP_M2/mirror_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -q clean verify -DskipTests {code}
 

Does not happen with, which only use HTTP/1.1
{code:java}
/opt/maven/apache-maven-3.9.7/bin/mvn -s $TEMP_M2/mirror_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -q clean verify -DskipTests
/opt/maven/apache-maven-4.0.0-beta-3/bin/mvn -s $TEMP_M2/mirror_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -Dmaven.resolver.transport=apache -q clean verify 
-DskipTests
/opt/maven/apache-maven-4.0.0-beta-3/bin/mvn -s $TEMP_M2/mirror_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -Dmaven.resolver.transport=wagon -q clean verify 
-DskipTests
/opt/maven/apache-maven-4.0.0-beta-3/bin/mvn -s $TEMP_M2/mirror_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -Dmaven.resolver.transport=jdk 
-Daether.transport.jdk.httpVersion=HTTP_1_1 -q clean verify -DskipTests
/opt/maven/apache-maven-4.0.0-beta-3/bin/mvn -s $TEMP_M2/mirror_settings.xml 
-Dmaven.repo.local=$TEMP_M2 -Dmaven.resolver.transport=jdk 
-Daether.transport.jdk.httpVersion.maven-localrepository1=HTTP_1_1 -q clean 
verify -DskipTests{code}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to