Description of problem: Unable to complete rhevm-dwh-setup. Version-Release number of selected component (if applicable): rhevm-dwh.noarch 0:3.3.0-28.el6ev How reproducible: 100% Steps to Reproduce: 1. rhevm-dwh-setup 2. readonly DB user? no Actual results: [root@pb-rh33 ~]# rhevm-dwh-setup Welcome to ovirt-engine-dwh setup utility This utility can configure a read only user for DB access. Would you like to do so? (yes|no): no Skipping creation of read only DB user. Error encountered while installing rhevm-dwh, please consult the log file: /var/log/ovirt-engine/rhevm-dwh-setup-2014_01_23_17_58_44.log [root@pb-rh33 ~]# tail -n 15 /var/log/ovirt-engine/rhevm-dwh-setup-2014_01_23_17_57_34.log 2014-01-23 17:57:36::DEBUG::common_utils::963::root:: stderr = ERROR: role "engine_history" does not exist 2014-01-23 17:57:36::DEBUG::common_utils::964::root:: retcode = 1 2014-01-23 17:57:36::ERROR::rhevm-dwh-setup::691::root:: Exception caught! 2014-01-23 17:57:36::ERROR::rhevm-dwh-setup::692::root:: Traceback (most recent call last): File "/usr/bin/rhevm-dwh-setup", line 634, in main utils.createDB(db_dict['dbname'], db_dict['username']) File "/usr/share/ovirt-engine-dwh/common_utils.py", line 1174, in createDB runPostgresSuQuery(sql_query) File "/usr/share/ovirt-engine-dwh/common_utils.py", line 1493, in runPostgresSuQuery stdIn=stdIn, File "/usr/share/ovirt-engine-dwh/common_utils.py", line 967, in execCmd raise Exception(msg) Exception: Return Code is not zero Expected results: Additional info:
please attach logs
*** Bug 1057233 has been marked as a duplicate of this bug. ***
The problem was caused by custom bash startup script, which was running also in non-interactive mode and therefore confusing the rhevm-dwh-setup utility.
Reopening, since I was told by pstehlik (CCed) this is a bug. If a login shell, which does not check for interactive/noninteractive mode is used, the dwh-setup fails in various ways without reporting the actual cause. Example of the original faulty script behaviour. [root@pb-rh33 ~]# su postgres -c 'echo hi' hi [root@pb-rh33 ~]# su - postgres -c 'echo hi' CPU => Intel Core 2 Duo P9xxx (Penryn Class Core 2) uptime => 10:06:14 up 26 days, 19:49, 1 user, load average: 0.05, 0.03, 0.00 RAM => Total 4.7 GB / Free 0.3 GB swap => Total 2.0 GB / Free 2.0 GB OS => Red Hat Enterprise Linux Server release 6.5 (Santiago) IP/s => eth0: 10.34.63.70 Bridge/s => VDSM => package vdsm is not installed libvirt => package libvirt is not installed qemu => package qemu-kvm-rhev is not installed CPU => Intel Core 2 Duo P9xxx (Penryn Class Core 2) uptime => 10:06:14 up 26 days, 19:49, 1 user, load average: 0.05, 0.03, 0.00 RAM => Total 4.7 GB / Free 0.3 GB swap => Total 2.0 GB / Free 2.0 GB OS => Red Hat Enterprise Linux Server release 6.5 (Santiago) IP/s => eth0: 10.34.63.70 Bridge/s => VDSM => package vdsm is not installed libvirt => package libvirt is not installed qemu => package qemu-kvm-rhev is not installed hi
Well, I claim this is not a bug. Or at least not something we want to fix. Just this one is probably quite easy to fix - as I told Petr in private - we can e.g. check if the output of 'su - user -c /bin/true' is empty and err otherwise. But what if the admin changed /bin/su? What if there are some other complex changes we didn't think of? In 3.4 this code was replaced with code that does seteuid instead of su, so this will not happen there. Backporting this will not be trivial and as I said I do not think it's worth it. Besides, having /etc/profile output stuff for non-interactive shells will probably kill other things as well. I am pretty certain that host-deploy might be affected. Do we want to fix all of that?
I was told there are bunch of such scripts around internet, so they are problably more common then /bin/su modifications. Wouldn't this issue be solved by using "su user -c command" instead of "su - user -c command"? It does not make sense to fix just dwh-setup. If such problems happen in other tools as well, it makes sense to fix them all or none of them.
(In reply to Petr Beňas from comment #6) > I was told there are bunch of such scripts around internet, Can you give me an example? Not for a script showing nice stuff on login, an example for a recommendation by an experienced unix professional to call such a script from /etc/profile without checking if it's an interactive shell? > so they are > problably more common then /bin/su modifications. Wouldn't this issue be > solved by using "su user -c command" instead of "su - user -c command"? No. 'su user' without '-' has other issues. A trivial example: By default, /root is unreadable for normal users, and so you'll get this: # su postgres -c 'psql -c "select 1"' could not change directory to "/root" ?column? ---------- 1 (1 row) > > It does not make sense to fix just dwh-setup. If such problems happen in > other tools as well, it makes sense to fix them all or none of them. Indeed.
Can we close this bug then? Yaniv
Exactly same happened on another setup - with NO clear explanation to user: ... This utility can configure a read only user for DB access. Would you like to do so? (yes|no): no Skipping creation of read only DB user. Failed to backup database: 'pg_database_size' Starting ovirt-engine... [ DONE ] Starting oVirt-ETL... [ DONE ] Error encountered while installing rhevm-dwh, please consult the log file: /var/log/ovirt-engine/rhevm-dwh-setup-2014_01_24_09_41_52.log log: 2014-01-24 09:45:28:EBUG::common_utils::962::root:: output = Starting ovirt-engine-dwhd: at Fri Jan 24 09:45:18 CET 2014[ OK ]^M 2014-01-24 09:45:28:EBUG::common_utils::963::root:: stderr = 2014-01-24 09:45:28:EBUG::common_utils::964::root:: retcode = 0 2014-01-24 09:45:28::ERROR::rhevm-dwh-setup::691::root:: Exception caught! 2014-01-24 09:45:28::ERROR::rhevm-dwh-setup::692::root:: Traceback (most recent call last): File "/usr/bin/rhevm-dwh-setup", line 607, in main sys.exit(0) SystemExit: 0
Clearing the needinfo flag since the question was answered.
Verified in av3. Setup with dwh and reports configuration finished successfully with the same script, which caused problems in previous versions.
Andrew, I do not think this is significant enough to be mentioned in the release notes. If we do want to document it, might use something like: In 3.3, rhevm-dwh-setup used the command /bin/su to run commands as another user. This was sensitive to custom shell startup/login scripts, which could fail it, or cause other unexpected behvior. In 3.4, its functionality was merged into engine-setup, which uses the function seteuid directly, and is thus not sensitive to such custom startup/login scripts. As I wrote in other comments, we do not guarantee that such startup scripts will not break any other function of rhevm - users can make many kinds of changes to their systems which might break stuff. But this specific issue is now solved.
Hi Yedidyah, Thank you for the clarification - I was actually hoping to ask you about this one myself. :) I've placed the requires_doc_text flag on '-' for now, but please let me know if there is any need to document this in the advisory later on. Kind regards, Andrew
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. http://rhn.redhat.com/errata/RHEA-2014-0601.html