Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-5415

Version name does not conform to requirements

    XMLWordPrintable

    Details

      Description

      There were 5,540 errors about "Request Processing Error" in production in the last 2 weeks. The REST API endpoint is:

      /nuxeo-studio/{projectId}/maven-metadata.xml
      

      The stacktrace is:

      java.lang.IllegalArgumentException: Version name does not conform to requirements
      	at com.nuxeo.studio.core.maven.MavenServlet.getVersionTokens(MavenServlet.java:386)
      	at com.nuxeo.studio.core.maven.MavenServlet.isFirstVersionGreaterThanSecond(MavenServlet.java:369)
      	at com.nuxeo.studio.core.maven.MavenServlet.getArtifactMavenMetadataContent(MavenServlet.java:311)
      	at com.nuxeo.studio.core.maven.MavenServlet.writeArtifactMavenMetadata(MavenServlet.java:278)
      	at com.nuxeo.studio.core.maven.MavenServlet.doGetMavenServlet(MavenServlet.java:161)
      	at com.nuxeo.studio.core.maven.MavenServlet.doGet(MavenServlet.java:100)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
      	at com.nuxeo.studio.core.maven.MavenServlet.service(MavenServlet.java:90)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      

      Probably because OEM-Content had at least one version which is not using semantic versioning.

      Because since April 2019, commit 8971421c changed the metadata implementation, where snapshot versions are also included as available versions. It brings the comparison right after (isFirstVersionGreaterThanSecond) which requires semantic versioning:

      @@ -278,8 +281,7 @@ public class MavenServlet extends HttpServlet {
               // tags
               String latest = ProjectVersion.ADMIN_CENTER_VERSION;
      
      -        for (ProjectVersion version : versionService.getReleasedVersions(projectId)) {
      -            String versionName = version.getName();
      +        for (String versionName : versionService.getAllVersionNames(projectId)) {
                   sb.append("\n\t\t\t<version>" + versionName + "</version>");
                   if (isFirstVersionGreaterThanSecond(versionName, latest)) {
                       latest = versionName;
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h