• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • codesonar-plugin
    • jenkins Jenkins 2.303.1
      codesonar plugin 2.1
      codesonar Release 5.4, Patchlevel 0

      Hi

      If i create a empty jenkins project and add just a codesonar step to the "Post-build Actions"

      I get the following error.
      Started by user
      Running as SYSTEM
      [EnvInject] - Loading node environment variables.
      Building in workspace C:\Users\auto-rdbuilds\.jenkins\workspace\CodesonarTest
      [Codesonar] Using hub URI: "correct url"
      ERROR: Step 'Codesonar' failed: unexpected element (uri:"", local:"project"). Expected elements are <{}alert>,<{}analysis>,<{}warning>
      Finished: FAILURE
      Attatched is the job config

      Kind regards

      Jens

          [JENKINS-66674] Plugin reports "unexpected element"

          gt_dbechtold added a comment -

          The plugin code has changed since this issue was originally posted, so I think the behavior is now different.  From what I interpret from the original description of this issue, the user has created an empty Freestyle project named "project" and added a mostly empty CodeSonar plugin invocation as a Post-build Action.  It appears that the user specified "correct url" as the Hub Address parameter.

          With version 3.3.1, I notice the following behaviors, all of which I think are acceptable and actionable:

          1. If I leave the Hub Address empty, the Jenkins build log will show an error that says: "[CodeSonar] Hub address not provided".  I think this is reasonable and expected behavior.
          2. If I specify "correct url" as the Hub Address, the Jenkins build log will show an exception that says: "Illegal character in authority at index 7: http://correct url".  I think this error tells you exactly what the problem is.
          3. If I change "correct url" to "correct-url" (to avoid the illegal character error), the Jenkins build log will show an exception that says: "Could not find a .prj_files folder for project".  I think this message is unsurprising since in an empty Jenkins project, no analysis has been performed, so there is no analysis output directory.

          In the last case above, the error is produced since the plugin is trying to search for the analysis project file/directory within the Jenkins working directory on the agent and no analysis output can be found.

          I think the error messages could be made more user-friendly, but I don't think the error messages are exactly unfriendly in this context.  I don't think there is anything here that needs fixing, but we will can consider improving the error messages in a future release.

          Please reopen this issue if you disagree with my assessment.

          gt_dbechtold added a comment - The plugin code has changed since this issue was originally posted, so I think the behavior is now different.  From what I interpret from the original description of this issue, the user has created an empty Freestyle project named "project" and added a mostly empty CodeSonar plugin invocation as a Post-build Action.  It appears that the user specified "correct url" as the Hub Address parameter. With version 3.3.1, I notice the following behaviors, all of which I think are acceptable and actionable: If I leave the Hub Address empty, the Jenkins build log will show an error that says: " [CodeSonar] Hub address not provided".  I think this is reasonable and expected behavior. If I specify "correct url" as the Hub Address, the Jenkins build log will show an exception that says: "Illegal character in authority at index 7: http://correct url".  I think this error tells you exactly what the problem is. If I change "correct url" to "correct-url" (to avoid the illegal character error), the Jenkins build log will show an exception that says: "Could not find a .prj_files folder for project".  I think this message is unsurprising since in an empty Jenkins project, no analysis has been performed, so there is no analysis output directory. In the last case above, the error is produced since the plugin is trying to search for the analysis project file/directory within the Jenkins working directory on the agent and no analysis output can be found. I think the error messages could be made more user-friendly, but I don't think the error messages are exactly unfriendly in this context.  I don't think there is anything here that needs fixing, but we will can consider improving the error messages in a future release. Please reopen this issue if you disagree with my assessment.

            gt_dbechtold gt_dbechtold
            jens_lund_jensen Jens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: