• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • artifactory-plugin
    • Jenkins 1.651.3
      artifactory plugin 2.8.1
      Artifactory server 4.14.0 (Pro License)

      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"??
            }
      }
      

          [JENKINS-39936] Any AQL in Download Spec file causes NPE

          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.

          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.

          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.

          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.

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

              Created:
              Updated: