Bug 1412064 - Error when adding hosts: __init__.py:925:_open:IOError: [Errno 13] Permission denied: '/var/log/ovirt-imageio-daemon/daemon.log'
Summary: Error when adding hosts: __init__.py:925:_open:IOError: [Errno 13] Permissio...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-imageio
Classification: oVirt
Component: Daemon
Version: ---
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.0-beta
: ---
Assignee: Daniel Erez
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-11 06:29 UTC by Han Han
Modified: 2020-04-15 15:09 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-15 14:56:57 UTC
oVirt Team: Storage
rule-engine: ovirt-4.1+


Attachments (Terms of Use)
The error abrt caught (8.06 MB, application/x-gzip)
2017-01-11 06:29 UTC, Han Han
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1289761 0 low CLOSED PackStack installs Nova crontab that nova user can't run 2021-02-22 00:41:40 UTC
oVirt gerrit 69052 0 None MERGED spec: Require vdsm since we depend on vdsm user 2020-04-15 16:05:06 UTC

Internal Links: 1289761

Description Han Han 2017-01-11 06:29:43 UTC
Created attachment 1239329 [details]
The error abrt caught

Description of problem:
When add a host to ovirt, there is a python error:
__init__.py:925:_open:IOError: [Errno 13] Permission denied: '/var/log/ovirt-imageio-daemon/daemon.log'

Version-Release number of selected component (if applicable):
RHV host:
vdsm-4.19.1-1.el7ev.x86_64
libvirt-2.5.0-1.virtcov.el7.x86_64
ovirt-imageio-daemon-0.5.0-0.el7ev

RHEVM:
ovirt-engine-4.1.0-0.3.beta2.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install abrt-cli in rhv-host.
Create a datacenter and cluster, add a host. Then check python error:
# abrt-cli ls
id 688e64d3033f6869cf8db65b43c67b629db31a09
reason:         __init__.py:925:_open:IOError: [Errno 13] Permission denied: '/var/log/ovirt-imageio-daemon/daemon.log'
time:           Wed 11 Jan 2017 01:05:04 AM EST
cmdline:        /usr/bin/python /usr/bin/ovirt-imageio-daemon
package:        ovirt-imageio-daemon-0.5.0-0.el7ev
uid:            36 (vdsm)
count:          1
Directory:      /var/spool/abrt/Python-2017-01-11-01:05:04-1865
Run 'abrt-cli report /var/spool/abrt/Python-2017-01-11-01:05:04-1865' for creating a case in Red Hat Customer Portal

The backtrace:
__init__.py:925:_open:IOError: [Errno 13] Permission denied: '/var/log/ovirt-imageio-daemon/daemon.log'

Traceback (most recent call last):
  File "/usr/bin/ovirt-imageio-daemon", line 14, in <module>
    server.main(sys.argv)
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_daemon/server.py", line 50, in main
    configure_logger()
  File "/usr/lib/python2.7/site-packages/ovirt_imageio_daemon/server.py", line 68, in configure_logger
    logging.config.fileConfig(conf, disable_existing_loggers=False)
  File "/usr/lib64/python2.7/logging/config.py", line 78, in fileConfig
    handlers = _install_handlers(cp, formatters)
  File "/usr/lib64/python2.7/logging/config.py", line 156, in _install_handlers
    h = klass(*args)
  File "/usr/lib64/python2.7/logging/handlers.py", line 117, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python2.7/logging/handlers.py", line 64, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/ovirt-imageio-daemon/daemon.log'

Local variables in innermost frame:
self: <logging.handlers.RotatingFileHandler object at 0x13f4a90>


Actual results:
As above

Expected results:
No python error

Additional info:
I remember that there is a similar error when adding RHEL7.3 host to Ovirt4.0. But I don't have env now. Pls check if there is the same error in RHEL7.3 and Ovirt4.0.

Comment 1 Daniel Erez 2017-01-11 08:06:21 UTC
Hi Han Han,

A few questions for further investigation of the issue:

* What are the exact steps that the test is performing to install the host?
* Can you please check the owner and group of the log file (/var/log/ovirt-imageio-daemon/daemon.log)


@Nir - are you familiar with this issue perhaps?

Comment 2 Han Han 2017-01-11 08:45:44 UTC
The first question:
First of all, prepare a ovirt4.1.beta server.Then install a host with RHEL7.4. and prepare vdsm repo on it.
Prepare abrt environment:
# yum install abrt-cli -y
# vim /etc/abrt/abrt-action-save-package-data.conf
OpenGPGCheck = no
# systemctl restart abrtd

And do following steps on ovirt:
1. Create a datacenter with default options.
2. Create a cluster for the datacenter with these options: CPU Architecture: x86_64; CPU Type: Intel Conroe Family or AMD Opteron G1(decided by your RHV-host CPU vendor); other options by default
3. Add a host for the cluster, filled with name, address, password, waiting the host up in Ovirt
At last, check it by abrt
# abrt-cli ls
id 688e64d3033f6869cf8db65b43c67b629db31a09
reason:         __init__.py:925:_open:IOError: [Errno 13] Permission denied: '/var/log/ovirt-imageio-daemon/daemon.log'
time:           Wed 11 Jan 2017 01:05:04 AM EST
cmdline:        /usr/bin/python /usr/bin/ovirt-imageio-daemon
package:        ovirt-imageio-daemon-0.5.0-0.el7ev
uid:            36 (vdsm)
count:          1
Directory:      /var/spool/abrt/Python-2017-01-11-01:05:04-1865
Run 'abrt-cli report /var/spool/abrt/Python-2017-01-11-01:05:04-1865' for creating a case in Red Hat Customer Portal

The Autoreporting feature is disabled. Please consider enabling it by issuing
'abrt-auto-reporting enabled' as a user with root privileges

Go to the Directory and check backtrace or other info.



The second question:
Unluckily, there is no file in the dir /var/log/ovirt-imageio-daemon/:
# ls -alZ /var/log/ovirt-imageio-daemon/daemon.log
ls: cannot access /var/log/ovirt-imageio-daemon/daemon.log: No such file or directory
#  ls -alZ /var/log/ovirt-imageio-daemon/
drwxr-xr-x. root kvm  system_u:object_r:var_log_t:s0   .
drwxr-xr-x. root root system_u:object_r:var_log_t:s0   ..

Comment 3 Daniel Erez 2017-01-11 08:57:00 UTC
(In reply to Han Han from comment #2)
> The first question:
> First of all, prepare a ovirt4.1.beta server.Then install a host with
> RHEL7.4. and prepare vdsm repo on it.
> Prepare abrt environment:
> # yum install abrt-cli -y
> # vim /etc/abrt/abrt-action-save-package-data.conf
> OpenGPGCheck = no
> # systemctl restart abrtd
> 
> And do following steps on ovirt:
> 1. Create a datacenter with default options.
> 2. Create a cluster for the datacenter with these options: CPU Architecture:
> x86_64; CPU Type: Intel Conroe Family or AMD Opteron G1(decided by your
> RHV-host CPU vendor); other options by default
> 3. Add a host for the cluster, filled with name, address, password, waiting
> the host up in Ovirt
> At last, check it by abrt
> # abrt-cli ls
> id 688e64d3033f6869cf8db65b43c67b629db31a09
> reason:         __init__.py:925:_open:IOError: [Errno 13] Permission denied:
> '/var/log/ovirt-imageio-daemon/daemon.log'
> time:           Wed 11 Jan 2017 01:05:04 AM EST
> cmdline:        /usr/bin/python /usr/bin/ovirt-imageio-daemon
> package:        ovirt-imageio-daemon-0.5.0-0.el7ev
> uid:            36 (vdsm)
> count:          1
> Directory:      /var/spool/abrt/Python-2017-01-11-01:05:04-1865
> Run 'abrt-cli report /var/spool/abrt/Python-2017-01-11-01:05:04-1865' for
> creating a case in Red Hat Customer Portal
> 
> The Autoreporting feature is disabled. Please consider enabling it by issuing
> 'abrt-auto-reporting enabled' as a user with root privileges
> 
> Go to the Directory and check backtrace or other info.
> 
> 
> 
> The second question:
> Unluckily, there is no file in the dir /var/log/ovirt-imageio-daemon/:
> # ls -alZ /var/log/ovirt-imageio-daemon/daemon.log
> ls: cannot access /var/log/ovirt-imageio-daemon/daemon.log: No such file or
> directory

@Nir - are you familiar with this issue perhaps? in which step the daemon.log file should be created?


> #  ls -alZ /var/log/ovirt-imageio-daemon/
> drwxr-xr-x. root kvm  system_u:object_r:var_log_t:s0   .
> drwxr-xr-x. root root system_u:object_r:var_log_t:s0   ..

Comment 5 Nir Soffer 2017-01-11 12:11:39 UTC
Duplicate of bug 1401901?

Comment 6 Allon Mureinik 2017-01-12 09:42:12 UTC
(In reply to Nir Soffer from comment #5)
> Duplicate of bug 1401901?

Seems so.
Nir/Daniel - please verify this and close as a duplicate (or, conclude that this is not true and actually fix it, of course :-))

Comment 7 Daniel Erez 2017-01-17 07:45:27 UTC
Indeed similar to bug 1401901. Moving to MODIFIED for verification.

Comment 8 Sandro Bonazzola 2017-01-25 07:54:12 UTC
4.0.6 has been the last oVirt 4.0 release, please re-target this bug.

Comment 9 Raz Tamir 2017-01-31 18:17:26 UTC
Verified on ovirt-engine-4.1.0.3-0.1.el7

Install abrt-cli and enable it on host and add it to the system - works fine with no errors when executing $ abrt-cli


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