Search code examples
tomcatartifactory

After Update to 7.84.14, Artifactory returns 400 on download artifact, which is not on the outer most level of the repo


I updated Artifactory to the latest version 7.84.14 from 7.77.11.

After that I am getting Error 400 when I try to download an Artifact which is not on the most outer level of the Repo.

I suspect it has something to do with Tomcat and the option: org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH

Artifactory is stating that they updated Tomcat in 7.83.1 to 9.0.87 [1]. Tomcat writes they replaced the option with encodedSolidusHandling in 9.0.34 [2]. But i didn't change anything in this regard.

But IDK if it's really the issue, because the Error is pretty useless, and nothing gets logged, other than the request itself:

"GET /ui/api/v1/download?repoKey=ext-maven-ms-local&path=com%252Fgoogle%252Fcode%252Ffindbugs%252Fjsr305%252F3.0.2%252Fjsr305-3.0.2.jar HTTP/2.0" 400 435 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0"

Error in Artifactory UI

Nginx Config

[1] https://jfrog.com/help/r/jfrog-release-information/artifactory-fixed-security-vulnerabilities?tocId=RmN~_12jNg_Wj1Kheh1IwQ

[2] https://tomcat.apache.org/tomcat-9.0-doc/changelog.html

Maybe someone has the same issue? Or can help me solve it.


Solution

  • Seem like the artifactory.service(Artifactory service installation) does not have all JavaOpts updated properly.

    Execute ps -ef | grep artifactory and check if the "-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true" parameter is present.

    If not please execute $JFROG_HOME/artifactory/bin/uninstallService.sh(Please check on $JFROG_HOME/artifactory/var directory in some os it move var to var.backup with uninstall) followed by executing $JFROG_HOME/artifactory/bin/installService.sh

    This will help us to update the artifactory.service will all missing parameters.

    The "ps -ef | grep artifactory" should look like this.

    /opt/jfrog/artifactory/app/third-party/java/bin/java -Djava.util.logging.config.file=/opt/jfrog/artifactory/app/artifactory/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -server -Xms512m -Xmx2g -XX:+UseG1GC -XX:OnOutOfMemoryError=kill -9 %p --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.naming/com.sun.jndi.ldap=ALL-UNNAMED -Dfile.encoding=UTF8 -Djruby.compile.invokedynamic=false -Djruby.bytecode.version=1.8 -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djava.security.egd=file:/dev/./urandom -Dartdist=docker -Djf.product.home=/opt/jfrog/artifactory -Djruby.bytecode.version=1.8 -Dignore.endorsed.dirs= -classpath /opt/jfrog/artifactory/app/artifactory/tomcat/bin/bootstrap.jar:/opt/jfrog/artifactory/app/artifactory/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/jfrog/artifactory/app/artifactory/tomcat -Dcatalina.home=/opt/jfrog/artifactory/app/artifactory/tomcat -Djava.io.tmpdir=/opt/jfrog/artifactory/var/work/artifactory/tomcat/temp org.apache.catalina.startup.Bootstrap start