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

Log parser plugin should not store the absolute path to the parsing file in each job config

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • log-parser-plugin
    • None
    • Jenkins 1.428

      The log parser plugin updates a job config with the following if the plugin is enabled for the job:

      <parsingRulesPath>/apps/jenkins/master/parsing-rules/java-default.txt</parsingRulesPath>

      Note the absolute path is used, even though the rules file is identified in the UI by its description, not its path.

      The rules file description should be stored in the job configuration so that rules files can be moved around on disk without having to update all the job configs that use them.

          [JENKINS-12436] Log parser plugin should not store the absolute path to the parsing file in each job config

          Kamil Kisiel added a comment -

          I just got bit by this rather badly. We moved our console log parsing file on the filesystem and updated the global jenkins configuration. I assumed since the rules are chosen by name in the job config they would all be updated automatically (after all, isn't that the point of a global config?). Of course it didn't and even worse the error is not reported anywhere in the job console and doesn't cause the job to fail in any way. The only way to discover the problem was the browse to a job and check its parsed console log output which displayed the message:

          ERROR:Failed to parse console log :
          log-parser plugin ERROR: Cannot parse log: Can't read parsing rules file:
          

          Kamil Kisiel added a comment - I just got bit by this rather badly. We moved our console log parsing file on the filesystem and updated the global jenkins configuration. I assumed since the rules are chosen by name in the job config they would all be updated automatically (after all, isn't that the point of a global config?). Of course it didn't and even worse the error is not reported anywhere in the job console and doesn't cause the job to fail in any way. The only way to discover the problem was the browse to a job and check its parsed console log output which displayed the message: ERROR:Failed to parse console log : log-parser plugin ERROR: Cannot parse log: Can't read parsing rules file:

          Kamil Kisiel added a comment -

          I should add, in order to fix the job configurations it was sufficient to go to each job and click the "save" button.

          Kamil Kisiel added a comment - I should add, in order to fix the job configurations it was sufficient to go to each job and click the "save" button.

          Jed Jacobs added a comment -

          Why is this still unresolved?  We have to open and save hundreds of configurations so the log parsing file could be found in its new location on the server.

          Jed Jacobs added a comment - Why is this still unresolved?  We have to open and save hundreds of configurations so the log parsing file could be found in its new location on the server.

          Mark Waite added a comment -

          x102785 it is not resolved because no one has submitted a pull request to propose a fix. The last commit to the plugin GitHub repository was over 3 years ago.

          You might consider using the "Adopt a plugin" instructions to adopt the log parser plugin.

          You could create one or more tests that show the problem, then make the code change that fixes the tests, then confirm that the fix works in regular working environments.

          Plugin maintenance is not actually a lot of effort for smaller plugins like this one and it can help you and help others in the community.

          Mark Waite added a comment - x102785 it is not resolved because no one has submitted a pull request to propose a fix. The last commit to the plugin GitHub repository was over 3 years ago. You might consider using the " Adopt a plugin " instructions to adopt the log parser plugin. You could create one or more tests that show the problem, then make the code change that fixes the tests, then confirm that the fix works in regular working environments. Plugin maintenance is not actually a lot of effort for smaller plugins like this one and it can help you and help others in the community.

          any PR is welcome

          Martin Reinhardt added a comment - any PR is welcome

            rgoren rgoren
            garethbowles garethbowles
            Votes:
            7 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: