Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39936

Any AQL in Download Spec file causes NPE

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We have a jenkins free style job that with a Generic-Artifactory Integration enabled.
      The Download Details have is filled with an aql. Any "correct" aql query cause an NPE when job starts.

      Jenkins Artifactory Plugin version: 2.8.1
      ERROR: null
      java.lang.NullPointerException
      	at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.pathToUnixFormat(SpecsHelper.java:106)
      	at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecsHelper.getDownloadUploadSpec(SpecsHelper.java:98)
      	at org.jfrog.hudson.generic.GenericArtifactsResolver.retrieveDependenciesBySpec(GenericArtifactsResolver.java:73)
      	at org.jfrog.hudson.generic.ArtifactoryGenericConfigurator.setUp(ArtifactoryGenericConfigurator.java:329)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:156)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      	at hudson.model.Run.execute(Run.java:1738)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      Finished: FAILURE
      

      I had try also the unique aql working in Spec file found in your documentation here, see example 2

      Anyway documentation lacks at all on how adapt an aql into Spec File format.
      Little example:
      standard aql

      items.find({ "repo": "m2-tds-snapshot-local" }).sort({"$desc" : ["name"]}).limit(12)
      

      Spec file

      {
        "files": [
          {
            "aql": {
              "items.find": {
                "repo": "my-local-repo",
                "sort"???
              }
              "sort"???
              "limit"??
            }
      }
      

        Attachments

          Activity

          Hide
          zoltanors Zoltán Orsós added a comment - - edited

          I also found this issue.

          Add "regexp": "true" at the end of your file section.

          {
            "files": [
              {
                "aql": {
                  "items.find": {
                       "repo": "my-repo"
                  }
                },
                "target": "dest",
                "regexp": "true"
              }
            ]
          }
          

          The problem is in the following class:
          https://github.com/JFrogDev/build-info/blob/master/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/spec/SpecsHelper.java at line 106.

          fileSpec.getPattern().replaceAll("\\\\", "/") cannot be invoked when using aql query, since pattern is null then.

          Show
          zoltanors Zoltán Orsós added a comment - - edited I also found this issue. Add "regexp": "true" at the end of your file section. { "files" : [ { "aql" : { "items.find" : { "repo" : "my-repo" } }, "target" : "dest" , "regexp" : " true " } ] } The problem is in the following class: https://github.com/JFrogDev/build-info/blob/master/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/spec/SpecsHelper.java at line 106. fileSpec.getPattern().replaceAll("\\\\", "/") cannot be invoked when using aql query, since pattern is null then.
          Hide
          eyalbe Eyal Ben Moshe added a comment -

          Thanks for reporting and pinpointing this issue Nikolas! Our apologies for the inconvenience.
          We opened the following issue to track this fix.
          https://www.jfrog.com/jira/browse/HAP-846
          We'll soon publish a snapshot version with the fix. We'll add the download link to this version as a comment in the above issue.

          Show
          eyalbe Eyal Ben Moshe added a comment - Thanks for reporting and pinpointing this issue Nikolas! Our apologies for the inconvenience. We opened the following issue to track this fix. https://www.jfrog.com/jira/browse/HAP-846 We'll soon publish a snapshot version with the fix. We'll add the download link to this version as a comment in the above issue.

            People

            Assignee:
            eyalbe Eyal Ben Moshe
            Reporter:
            nfalco Nikolas Falco
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: