Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-29638

Downloading pom.xml which uses unicode character fails with 500

    Details

    • Notability:
      3

      Description

      SYMPTOM:

      Downloading "/repository/maven-central/com/alibaba/transmittable-thread-local/2.12.2/transmittable-thread-local-2.12.2.pom" returns 500 HTTP status code.
      Ref: https://search.maven.org/artifact/com.alibaba/transmittable-thread-local/2.11.4/jar

      REPRODUCE STEPS:

      1. Install NXRM 3.36.0 with PostgreSQL, and configure maven-central proxy repository
      2. Download the pom file:
        curl -s -D- -u admin:admin123 -k http://localhost:8081/repository/maven-central/com/alibaba/transmittable-thread-local/2.12.2/transmittable-thread-local-2.12.2.pom -O
        

      EXPECTED BEHAVIOUR:

      As this works with OrientDB, it should also work with PostgreSQL.
      With OrientDB:

      $ curl -s -D- -u admin:admin123 -k http://dh1.standalone.localdomain:8081/repository/maven-central/com/alibaba/transmittable-thread-local/2.12.2/transmittable-thread-local-2.12.2.pom | head -n20
      HTTP/1.1 200 OK
      date: Fri, 19 Nov 2021 03:32:36 GMT
      server: Nexus/3.36.0-01 (PRO)
      x-content-type-options: nosniff
      content-security-policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
      x-xss-protection: 1; mode=block
      last-modified: Tue, 28 Sep 2021 16:18:23 GMT
      etag: "c457ba11bc2dd34e37f87e1a89ea05d7"
      content-disposition: inline
      content-type: application/xml
      content-length: 25389
      
      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.alibaba</groupId>
        <artifactId>transmittable-thread-local</artifactId>
        <name>TransmittableThreadLocal(TTL)</name>
        <version>2.12.2</version>
        <description>&#x1f4cc; The missing Java™ std lib(simple &amp; 0-dependency) for framework/middleware
      

      As you can see, it successfully includes "📌" in the output.

      ACTUAL BEHAVIOUR:

      $ curl -s -D- -u admin:admin123 -k https://nxrm3-pg-k8s.standalone.localdomain/repository/maven-central/com/alibaba/transmittable-thread-local/2.12.2/transmittable-thread-local-2.12.2.pom | head -n20
      HTTP/2 500
      server: nginx/1.19.2
      date: Fri, 19 Nov 2021 03:33:03 GMT
      content-type: text/html
      content-length: 1865
      x-content-type-options: nosniff
      content-security-policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
      x-xss-protection: 1; mode=block
      x-frame-options: DENY
      cache-control: no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0
      pragma: no-cache
      expires: 0
      strict-transport-security: max-age=15724800; includeSubDomains
      
      
      <!DOCTYPE html>
      <html lang="en">
      <head>
        <title>500 - Nexus Repository Manager</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      (23) Failed writing body
      

      nexus.log shows below:

      2021-11-19 03:31:23,850+0000 DEBUG [qtp1337262725-740]  *SYSTEM org.sonatype.nexus.internal.web.ErrorPageServlet - Attaching cause
      javax.servlet.ServletException: org.sonatype.nexus.datastore.api.DataAccessException:
      ### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
        Detail: Unicode low surrogate must follow a high surrogate.
        Where: JSON data, line 1: ...ging":"jar","version":"2.12.2","pom_description":...
      ### The error may exist in org.sonatype.nexus.content.maven.store.Maven2ComponentDAO
      ### The error may involve org.sonatype.nexus.content.maven.store.Maven2ComponentDAO.updateComponentAttributes-Inline
      ### The error occurred while setting parameters
      ### SQL: UPDATE maven2_component SET attributes = ?, last_updated = CURRENT_TIMESTAMP         WHERE                 component_id = ?             AND attributes != ?;
      ### Cause: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
        Detail: Unicode low surrogate must follow a high surrogate.
        Where: JSON data, line 1: ...ging":"jar","version":"2.12.2","pom_description":...
              at org.apache.shiro.web.servlet.AdviceFilter.cleanup(AdviceFilter.java:196)
      ... (snip) ...
      Caused by: org.sonatype.nexus.datastore.api.DataAccessException:
      ### Error updating database.  Cause: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
        Detail: Unicode low surrogate must follow a high surrogate.
        Where: JSON data, line 1: ...ging":"jar","version":"2.12.2","pom_description":...
      ### The error may exist in org.sonatype.nexus.content.maven.store.Maven2ComponentDAO
      ### The error may involve org.sonatype.nexus.content.maven.store.Maven2ComponentDAO.updateComponentAttributes-Inline
      ### The error occurred while setting parameters
      ### SQL: UPDATE maven2_component SET attributes = ?, last_updated = CURRENT_TIMESTAMP         WHERE                 component_id = ?             AND attributes != ?;
      ### Cause: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
        Detail: Unicode low surrogate must follow a high surrogate.
        Where: JSON data, line 1: ...ging":"jar","version":"2.12.2","pom_description":...
              at org.sonatype.nexus.datastore.mybatis.DataAccessSqlSession.unwrapMyBatisException(DataAccessSqlSession.java:118)
      ... (snip) ...
      Caused by: org.postgresql.util.PSQLException: ERROR: invalid input syntax for type json
        Detail: Unicode low surrogate must follow a high surrogate.
        Where: JSON data, line 1: ...ging":"jar","version":"2.12.2","pom_description":...
              at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
      ...
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            hosako Hajime Osako
            Last Updated By:
            Joe Tom Joe Tom
            Team:
            NXRM - Mad Max
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                tigCommentSecurity.panel-title