Bug 1052276

Summary: [new relic] Ruby cart restart should not fail attempting to touch $OPENSHIFT_REPO_DIR/tmp/restart.txt
Product: OpenShift Online Reporter: Jessica Forrester <jforrest>
Component: ImageAssignee: Michal Fojtik <mfojtik>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.xCC: bmeng, chunchen, yadu
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:55:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1057447    

Description Jessica Forrester 2014-01-13 14:48:29 UTC
Description of problem:
If the end user deletes the tmp dir under $OPENSHIFT_REPO_DIR/tmp then an application restart will fail because the command below fails:
touch $OPENSHIFT_REPO_DIR/tmp/restart.txt

Should check the code in post-deploy as well since it also attempts to touch this file.

We shouldn't assume that directory is still there since it is underneath their repo dir.

How reproducible:
Occurs in PROD when  and tries to restart their app.  Recreating the tmp dir allows app to be restarted again.

Steps to Reproduce:
1. Create a ruby app
2. ssh in and delete app-root/repo/tmp
3. Restart the app

Actual results:
500 error with these messages (as reported by site in new relic):
Error: Failed to execute: 'control restart' for /var/lib/openshift/<id>/rubyrestarting Ruby carttouch: cannot touch `/var/lib/openshift/<id>/app-root/runtime/repo//tmp/restart.txt': No such file or directory -- Unable to complete the requested operation due to: Failed to correctly execute all parallel operations - ["RestartCompOp"]

Expected results:
The application should restart.

Comment 2 Dan McPherson 2014-01-13 23:07:00 UTC
If tmp isn't there we should fall back to the standard apache restart.

Comment 3 openshift-github-bot 2014-01-14 10:51:15 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/8538a1b2dac7ae49bafe671ba89b1be4f13e5131
Bug 1052276 - Check if tmp/ directory exists before ruby restart

Comment 4 Michal Fojtik 2014-01-14 12:37:48 UTC
Fyi, we are doing the full apache restart anyway. I think the reason why is to pick up environment variables changes (performance/passenv). In that case I think it does not even make a sense to touch the restart.txt.

Comment 5 Yan Du 2014-01-15 08:04:37 UTC
test ruby-1.8 and ruby-1.9 on devenv_4224, after ssh into app and delete app-root/repo/tmp, app can restart normally. 

[root@Daphne test]# rhc app restart ruby19
RESULT:
ruby19 restarted

Move to verified.