Bug 1194638 - no patched log created when user does not have permission to apply patch
Summary: no patched log created when user does not have permission to apply patch
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Installer
Version: JON 3.3.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ER01
: JON 3.3.3
Assignee: Michael Burman
QA Contact: Armine Hovsepyan
Depends On:
TreeView+ depends on / blocked
Reported: 2015-02-20 12:41 UTC by Armine Hovsepyan
Modified: 2015-09-03 00:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-07-30 16:41:32 UTC
Type: Bug

Attachments (Terms of Use)
3.3.0_3.3.1_apply_patch_no_permission (226.24 KB, text/plain)
2015-02-20 12:41 UTC, Armine Hovsepyan
no flags Details
apply_patch_no_permissions.log (4.08 KB, text/plain)
2015-07-15 17:00 UTC, Armine Hovsepyan
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1525 normal SHIPPED_LIVE Moderate: Red Hat JBoss Operations Network 3.3.3 update 2015-07-30 20:41:08 UTC
Red Hat Bugzilla 1170405 None None None Never

Internal Links: 1170405

Description Armine Hovsepyan 2015-02-20 12:41:22 UTC
Created attachment 993890 [details]

Description of problem:
no patched log created when user does not have permission to apply patch

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

How reproducible:

Steps to Reproduce:
1. install jon 3.3.0 as root
2. apply patch as non-root 

Actual results:

The following log is visible >100 lines:

./jon-server-3.3.0.GA-update-01/apply-updates.sh: line 140: /home/hudson/jon-server-3.3.0.GA/.patched/3.3.0.GA-update-$date/update.log: No such file or directory

The following log is printed:
Missing write permissions for existing JON installation files, see '/home/hudson/jon-server-3.3.0.GA/.patched/3.3.0.GA-update-$date/update.log' for more details.

No update log is created

Expected results:
no misleading log is create

Additional info:
result log attached

Comment 1 Michael Burman 2015-06-29 10:52:53 UTC
The new output without permissions:

[miburman@miranda jon-server-3.3.0.GA-update-02]$ cp ~/projects/git/jon/patches/apply-updates.sh . | sed -i -e 's/UPDATE_VERSION=\"03\"/UPDATE_VERSION=\"02\"/' apply-updates.sh && ./apply-updates.sh ../jon-server-3.3.0.GA

Testing for INSTALL_PATCH_DEST[JON Server|JON agent] directory.
	Successfully detected server [../jon-server-3.3.0.GA] to be upgraded. Proceeding...
	Proceeding with application of patch '02' to ../jon-server-3.3.0.GA
	Checking [Server] file permissions...
mkdir: cannot create directory ‘../jon-server-3.3.0.GA/.patched’: Permission denied
	Missing write permissions for existing JON installation files.
	Unable to apply update. Exiting...
[miburman@miranda jon-server-3.3.0.GA-update-02]$

Or do we want to remove the mkdir error also?

Comment 2 Michael Burman 2015-06-29 11:24:06 UTC
Pushed to release/jon3.3.x:

commit d91ba5ed4f1f909835fa8ed792100dc7531afb81
Author: Michael Burman <yak@iki.fi>
Date:   Mon Jun 29 14:22:40 2015 +0300

    [BZ 1194638] Do not try to perform log appending if log file is not writeable

Comment 3 Simeon Pinder 2015-07-10 18:55:25 UTC
Available for test with 3.3.3 ER01 build: 
 *Note: jon-server-patch-3.3.0.GA.zip maps to ER01 build of

Comment 4 Armine Hovsepyan 2015-07-15 17:00:59 UTC
Created attachment 1052396 [details]

Comment 5 Armine Hovsepyan 2015-07-15 17:03:25 UTC
when user does not have permission to directory - apply patch log does not show no permissions - expected 
when user has permission to directory but does not have permission to update/write into jon server dir - permission log is visible - expected

see log attached

Comment 7 errata-xmlrpc 2015-07-30 16:41:32 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.


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