Bug 1258789

Summary: ovirt-engine-reports-tool handles relative export/import paths wrongly
Product: Red Hat Enterprise Virtualization Manager Reporter: Karolína Hajná <khajna>
Component: ovirt-engine-reportsAssignee: Yedidyah Bar David <didi>
Status: CLOSED ERRATA QA Contact: Karolína Hajná <khajna>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: dfediuck, didi, gklein, khajna, lsurette, pstehlik, rbalakri, Rhev-m-bugs, sbonazzo, sradco, yeylon, ykaul, ylavi
Target Milestone: ovirt-3.6.1   
Target Release: 3.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhevm-reports-3.6.1.1-1.el6ev Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-09 21:20:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1226910, 1287006    
Bug Blocks: 1198107    
Attachments:
Description Flags
ovirt-engine-reports-tool import log
none
3.6.1 import.log none

Description Karolína Hajná 2015-09-01 09:58:48 UTC
Created attachment 1068906 [details]
ovirt-engine-reports-tool import log

Description of problem:
When using ovirt-engine-reports-tool import on exported .zip file there is an error:
Failed to execute stage 'Misc configuration': Command './js-import.sh' failed to execute 

Version-Release number of selected component (if applicable):
3.6.0-0.12.master.el6

How reproducible:
100%

Steps to Reproduce:
1. Create an ad hoc report in first engine
2. Use ovirt-engine-reports-tool to export the created ad hoc report
3. Copy created .zip file to second engine of the same version as the first
4. Use the tool again to import created report to your second engine

Actual results:
import error

Expected results:
import successful

Comment 1 Yedidyah Bar David 2015-09-02 10:07:05 UTC
Seems from the log that the bug is with relative paths. E.g. instead of supplying 'adhoc3', input '/root/adhoc3' (or wherever it was). Can you please verify?

Comment 2 Yedidyah Bar David 2015-09-02 10:10:34 UTC
BTW, seems like the same bug affects export. Did it work for you there?

Comment 3 Karolína Hajná 2015-09-02 10:54:00 UTC
Importing the file with absolute path works. 
I didn't have any problems with export. Using filename only worked and the resulting .zip file was located in root directory. I tested the export with absolute path, too. It was successful.

Comment 6 Yedidyah Bar David 2015-10-12 06:13:58 UTC
The bug is that the reports tool, if used to export/import reports with a relative path, uses it relative $JASPER_HOME/buildomatic instead of to current working directory.

Changed the summary accordingly.

Yaniv, not sure what other info is needed. I think 3.6.1 is ok.

Comment 7 Karolína Hajná 2015-12-01 13:52:49 UTC
Created attachment 1100924 [details]
3.6.1 import.log

Export still uses relative paths relatively to $JASPER_HOME/buildomatic instead of working directory.
Import still fails completely when using relative paths.
I used 3.6.0-22 build for testing.

Comment 8 Yaniv Lavi 2015-12-01 13:54:56 UTC
Should be in this week.

Comment 9 Karolína Hajná 2015-12-03 10:11:55 UTC
On 3.6.1-2 build export works correctly. 
With import there is a problem when cwd is /root and the .zip file is in it. So when I enter a filename into the tool, there is an error: "Cannot read from <filename>". This works on the same machine from which the .zip file was exported, though. I haven't found any problem with permisions etc. 
Using absolute path or entering another directory and using relative path from there works fine. 

steps to reproduce:
1. Create and save an Ad Hoc View
2. Use the ovirt-engine-reports-tool for export
3. on the same machine use the tool again for importing file exported in last step - this should work
4. copy the file to another machine into /root directory and the tool for import from there. - this should end up with error
5. move the .zip file into another directory (for example root directory) and change your cwd to it.
6. use import again - should work

Comment 10 Karolína Hajná 2015-12-15 10:15:21 UTC
verified on rhevm-reports-setup-3.6.1.1-1.el6ev.noarch (build 3.6.1-4)

Comment 12 errata-xmlrpc 2016-03-09 21:20:48 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-2016-0425.html