Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1085831 - [rhevh] Broken cron job 'python < /usr/share/rhn/virtualization/poller.py'
Summary: [rhevh] Broken cron job 'python < /usr/share/rhn/virtualization/poller.py'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-node
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
: 3.5.0
Assignee: Ryan Barry
QA Contact: Virtualization Bugs
URL:
Whiteboard: node
Depends On: 1150377
Blocks: 1123329 rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-04-09 13:10 UTC by Jiri Belka
Modified: 2016-02-10 20:05 UTC (History)
14 users (show)

Fixed In Version: rhev-hypervisor6-6.6-20141218.0.iso rhev-hypervisor7-7.0-20141218.0.iso
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-11 20:55:21 UTC
oVirt Team: Node
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2015:0160 normal SHIPPED_LIVE ovirt-node bug fix and enhancement update 2015-02-12 01:34:52 UTC
oVirt gerrit 27300 master MERGED The RHN cronjob shouldn't try to call removed files Never

Description Jiri Belka 2014-04-09 13:10:46 UTC
Description of problem:

Putting non-existent file to pythong, as bonus there's no sendmail so output cannot be sent.

# tail cron | grep CROND
Apr  9 13:02:01 dell-r210ii-04 CROND[6206]: (root) CMD (python < /usr/share/rhn/virtualization/poller.py)
Apr  9 13:02:01 dell-r210ii-04 CROND[6208]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory
Apr  9 13:02:01 dell-r210ii-04 CROND[6204]: (root) MAIL (mailed 76 bytes of output but got status 0x0001#012)
Apr  9 13:04:01 dell-r210ii-04 CROND[6223]: (root) CMD (python < /usr/share/rhn/virtualization/poller.py)
Apr  9 13:04:01 dell-r210ii-04 CROND[6225]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory
Apr  9 13:04:01 dell-r210ii-04 CROND[6221]: (root) MAIL (mailed 76 bytes of output but got status 0x0001#012)
Apr  9 13:06:01 dell-r210ii-04 CROND[6233]: (root) CMD (python < /usr/share/rhn/virtualization/poller.py)
Apr  9 13:06:01 dell-r210ii-04 CROND[6235]: (CRON) EXEC FAILED (/usr/sbin/sendmail): No such file or directory
Apr  9 13:06:01 dell-r210ii-04 CROND[6231]: (root) MAIL (mailed 76 bytes of output but got status 0x0001#012)


# cat /etc/cron.d/rhn-virtualization.cron 
0-59/2 * * * * root python < /usr/share/rhn/virtualization/poller.py
# ls -l /usr/share/rhn/virtualization/poller.py*
-rw-r--r--. 1 root root 7679 2012-08-10 09:33 /usr/share/rhn/virtualization/poller.pyc
# python < /usr/share/rhn/virtualization/poller.pyc 
  File "<stdin>", line 1
SyntaxError: Non-ASCII character '\xd1' in file <stdin> on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Version-Release number of selected component (if applicable):
# cat /etc/rhev-hypervisor-release 
Red Hat Enterprise Virtualization Hypervisor release 6.5 (20140408.0.el6ev)

How reproducible:
100%

Steps to Reproduce:
1. check /var/log/cron and check /etc/cron.d/rhn-virtualization.cron
2.
3.

Actual results:
wrong path in cron job, spamming cron log

Expected results:
??

Additional info:

Comment 1 Fabian Deutsch 2014-04-10 14:45:46 UTC
It's not clear to me if this is a result of our code, or a problem in an rhn package.

Comment 2 haiyang,dong 2014-04-18 03:08:30 UTC
I could reproduce this bug in Red Hat Enterprise Virtualization Hypervisor release 6.5 (20140408.0.el6ev)

Comment 3 Ryan Barry 2014-04-21 14:39:27 UTC
(In reply to Fabian Deutsch from comment #1)
> It's not clear to me if this is a result of our code, or a problem in an rhn
> package.

Multiple:

We remove the uncompiled poller.py, so the cronjob can't find it.
We remove sendmail, so cron can't mail anything

(In reply to Jiri Belka from comment #0)
> # python < /usr/share/rhn/virtualization/poller.pyc 
>   File "<stdin>", line 1
> SyntaxError: Non-ASCII character '\xd1' in file <stdin> on line 1, but no
> encoding declared; see http://www.python.org/peps/pep-0263.html for details
> 
Python will spit this out if you try to push byte-compiled files through stdin.

python /usr/share/rhn/virtualization/poller.pyc (with no stdin redirection) works, however, as can be observed if with:

python /usr/share/rhn/virtualization/poller.pyc -d

Comment 4 Fabian Deutsch 2014-07-24 16:02:31 UTC
This is a mass change, moving bugs of merged patches into MODIFIED.

Please correct the state, if you think that the move was not justified.

Comment 6 haiyang,dong 2015-01-14 07:25:51 UTC
Test version:
rhev-hypervisor6-6.6-20150112.0
ovirt-node-3.1.0-0.42.20150109gitd06b7c5.el6.noarch

Test steps:
1. [root@dhcp-9-150 admin]# cat /etc/cron.d/rhn-virtualization.cron
0-59/2 * * * * root python  /usr/share/rhn/virtualization/poller.pyc

2. [root@dhcp-9-150 admin]# ls -l /usr/share/rhn/virtualization/poller.py*
-rw-r--r--. 1 root root 7904 2014-09-29 07:28 /usr/share/rhn/virtualization/poller.pyc

3.        
[root@dhcp-9-150 admin]# tail /var/log/cron |grep poller
Jan 14 07:18:01 localhost CROND[17625]: (root) CMD (python  /usr/share/rhn/virtualization/poller.pyc)
Jan 14 07:20:01 localhost CROND[17692]: (root) CMD (python  /usr/share/rhn/virtualization/poller.pyc)

so now it used correct path in cron job, Change the status into "VERIFIED".

For OSError: [Errno 30] Read-only file system: '/var/cache/rhn'  when executing cron job 'python  /usr/share/rhn/virtualization/poller.pyc', I have report a new bug 1181937 to track that.

Comment 8 errata-xmlrpc 2015-02-11 20:55:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-0160.html


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