Details
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
################################################
- 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.