Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-1232

Knox upgrade procedure and/or internal logic broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 0.6.0
    • None
    • KnoxCLI, KnoxShell
    • All Linux versions
    • Patch

    Description

      All versions affected: Tested from 0.6 - 0.12

      After upgrading knox packages with rpm, some rpmsave files are created in /usr/hdp/current/knox-server/data/services

      ################################################

      1. find /usr/hdp/current/knox-server/data/services -name *rpmsave -exec ls -l {} \;
        rw-rr- 1 knox knox 1525 Nov 29 2016 /usr/hdp/current/knox-server/data/services/ambari/2.2.0/service.xml.rpmsave
        rw-rr- 1 knox knox 3168 Nov 29 2016 /usr/hdp/current/knox-server/data/services/ambariui/2.2.0/service.xml.rpmsave
        rw-rr- 1 knox knox 4650 Nov 29 2016 /usr/hdp/current/knox-server/data/services/ambariui/2.2.0/rewrite.xml.rpmsave
        rw-rr- 1 knox knox 1910 Nov 29 2016 /usr/hdp/current/knox-server/data/services/yarnui/2.7.0/service.xml.rpmsave
        rw-rr- 1 knox knox 8964 Nov 29 2016 /usr/hdp/current/knox-server/data/services/yarnui/2.7.0/rewrite.xml.rpmsave
        rw-rr- 1 knox knox 6703 Nov 29 2016 /usr/hdp/current/knox-server/data/services/jobhistoryui/2.7.0/rewrite.xml.rpmsave
        rw-rr- 1 knox knox 2059 Nov 29 2016 /usr/hdp/current/knox-server/data/services/hdfsui/2.7.0/service.xml.rpmsave
        rw-rr- 1 knox knox 4449 Nov 29 2016 /usr/hdp/current/knox-server/data/services/hdfsui/2.7.0/rewrite.xml.rpmsave
        rw-rr- 1 knox knox 3256 Nov 29 2016 /usr/hdp/current/knox-server/data/services/yarn-rm/2.5.0/service.xml.rpmsave
        ################################################

      Knox doesn't read only the service.xml files during startup, but all files in the respective dir:
      Check ServiceDefinitionsLoader.java:59

      reference github file: https://github.com/hortonworks/knox/blob/HDP-2.6.4.0-91-tag/gateway-server/src/main/java/org/apache/hadoop/gateway/util/ServiceDefinitionsLoader.java getFileList

      for ( File file : getFileList(servicesDir) ) {

      • Read new and old config files can result in an incorrect based on outdated definitions.
      • ServiceDefinitionsLoader.java or getFileList function should be modified in order to read only .xml$ files in the directory.

      Workaround.
      =========
      As a workaround by removing the rpmsave files and restarting Knox fix the issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hfernandez Hernan Fernandez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: