Bug 1251759 - AttributeError: 'Config' object has no attribute '_files'
AttributeError: 'Config' object has no attribute '_files'
Status: CLOSED WONTFIX
Product: oVirt
Classification: Community
Component: ovirt-hosted-engine-ha (Show other bugs)
3.6
All All
unspecified Severity medium
: ---
: ---
Assigned To: Doron Fediuck
meital avital
sla
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-09 14:08 EDT by Jacek Kowalski
Modified: 2015-08-11 08:05 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-11 08:05:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jacek Kowalski 2015-08-09 14:08:00 EDT
Description of problem:

Exception handling in ovirt_hosted_engine_ha/env/config.py uses undefined property _files:

raise Exception("Configuration value not found: file={0}, key={1}"
   .format(self._files.get(type, unknown), key))

So error "Configuration value not found" is never thrown - instead it causes "AttributeError" (see stacktrace below).


Version-Release number of selected component (if applicable):

ovirt-hosted-engine-ha-1.3.0-0.0.master.20150615153650.20150615153645.git5f8c290.el7.noarch


Actual results:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/agent.py", line 185, in _run_agent
    host_id=host_id))
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/agent.py", line 64, in action_proper
    he.start_monitoring()
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 378, in start_monitoring
    for old_state, state, delay in self.fsm:
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/lib/fsm/machine.py", line 125, in next
    new_data = self.refresh(self._state.data)
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/state_machine.py", line 123, in refresh
    ] = self.hosted_engine.min_memory_threshold,
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/agent/hosted_engine.py", line 169, in min_memory_threshold
    return int(self._config.get(config.VM, config.MEM_SIZE))
  File "/usr/lib/python2.7/site-packages/ovirt_hosted_engine_ha/env/config.py", line 98, in get
    .format(self._files.get(type, unknown), key))
AttributeError: 'Config' object has no attribute '_files'


Expected results:

Configuration value not found: ...
Comment 1 Doron Fediuck 2015-08-10 06:01:52 EDT
Hi,
can you please provide some more details on what you were doing?
ie- is this a part of a normal installation? upgrade? were you using the appliance? 
Or was it an installed system. If so what was the trigger?

Please also attach relevant log files (vdsm, hosted engine files, setup if relevant).
Comment 2 Jacek Kowalski 2015-08-10 07:17:07 EDT
I've encountered this error when I accidentally deleted /var/lib/ovirt-hosted-engine-ha/vm.conf during setup and tried to recreate it manually - I omitted memSize. It should not happen in normal circumstances - yet I would prefer to get meaningful error message:

Error: 'Configuration value not found: file=/var/run/ovirt-hosted-engine-ha/vm.conf, key=memSize' - trying to restart agent

not:

AttributeError: 'Config' object has no attribute '_files'



Most likely self._files in ovirt_hosted_engine_ha/env/config.py should be replaced by some mix of self._dynamic_files and self._static_files
Comment 3 Doron Fediuck 2015-08-10 07:23:06 EDT
Roy,
in the official 3.6 release the above scenario won't be possible due to the move from local to shared configuration.

Is this correct?
Comment 4 Jacek Kowalski 2015-08-10 09:20:28 EDT
This issue was fixed in this CR request: https://gerrit.ovirt.org/#/c/44306 (https://gerrit.ovirt.org/#/c/44306/15/ovirt_hosted_engine_ha/env/config.py), which was accepted today.
Comment 5 Roy Golan 2015-08-11 08:05:40 EDT
Apparently that's an invalid case and also the vm.conf is moving to shared storage configuration which is controlled by ovirt-engine.

Note You need to log in before you can comment on or make changes to this bug.