Bug 1032950

Summary: [origin_node_331]Failed to build app by git push after deploying by artifact_url
Product: OpenShift Online Reporter: chunchen <chunchen>
Component: ImageAssignee: Andy Goldstein <agoldste>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: agoldste, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1033113 1033766 (view as bug list) Environment:
Last Closed: 2014-01-24 03:30:37 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:
Bug Depends On:    
Bug Blocks: 1033113, 1033766    

Description chunchen 2013-11-21 09:48:11 UTC
Description of problem:
It's failed to build app by git push after deploying by artifact_url, will meet "Operation not permitted" errors.

Version-Release number of selected component (if applicable):
devenv_4056

How reproducible:
always

Steps to Reproduce:
1. Create an app
rhc app create cphp01 php-5.3
2. Configure deployment type to binary
curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-23-22-121-187.compute-1.amazonaws.com/broker/rest/application/528db435e55e7539ba0000be -X PUT -d deployment_type=binary
3. Deploy a binary file by artifact_url
curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-23-22-121-187.compute-1.amazonaws.com/broker/rest/application/528db435e55e7539ba0000be/deployments -X POST -d artifact_url=http://cphp-ccyd.rhcloud.com/cphp2.tar.gz
4. Configure deployment type to git
curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-23-22-121-187.compute-1.amazonaws.com/broker/rest/application/528db435e55e7539ba0000be -X PUT -d deployment_type=git
5. Do some changes in app local repo
cd cphp01
touch 1.txt
6. Git push the changes
git add .; git commit -amp; git push

Actual results:
[master 83ff058] p
 0 files changed
 create mode 100644 1.txt
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 244 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Stopping PHP cartridge
remote: [Thu Nov 21 02:26:00 2013] [warn] PassEnv variable SHELL was undefined
remote: [Thu Nov 21 02:26:00 2013] [warn] PassEnv variable USER was undefined
remote: [Thu Nov 21 02:26:00 2013] [warn] PassEnv variable LOGNAME was undefined
remote: Waiting for stop to finish
remote: Operation not permitted - /var/lib/openshift/528db435e55e7539ba0000be/app-deployments/by-id/32a86648
To ssh://528db435e55e7539ba0000be.rhcloud.com/~/git/cphp01.git/
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://528db435e55e7539ba0000be.rhcloud.com/~/git/cphp01.git/'

Expected results:
Building application after deploying by artifact_url should be successfully.

Additional info:
It will not meet this issue when deploying the binary file from local.

Comment 1 Andy Goldstein 2013-11-21 15:34:23 UTC
https://github.com/openshift/origin-server/pull/4214

Comment 2 openshift-github-bot 2013-11-21 17:10:22 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/ae08e4ea393437954385922a1b0af13c2fe11805
Bug 1032950

Change ownership of by-id link to gear uid/gid so future deployments
that don't go through mcollective don't fail because of file
permissions issues.

Comment 3 chunchen 2013-11-22 01:56:03 UTC
It's fixed, verified on devenv_4060, so mark it as VERIFIED.