Bug 1017097 - [deploy]A shell error pop up on git push after the app has been deployed twice with same id
[deploy]A shell error pop up on git push after the app has been deployed twic...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Dan Mace
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-09 05:15 EDT by Jianwei Hou
Modified: 2015-05-14 19:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-17 09:34:25 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jianwei Hou 2013-10-09 05:15:06 EDT
Description of problem:
Error message: Shell command '/bin/cp -a app-root/runtime/dependencies/. app-deployments/2013-10-09_04-06-33.574/dependencies' returned an error. rc=1 is seen when an app is being pushed. The program takes app-root/runtime/dependencies/ as a directory, which is file

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

How reproducible:
Always

Steps to Reproduce:
1. Create an application, set keep_deployments of the app to 2
rhc create-app p1 php-5.3
2. Change application code, commit and push, app will be deployed and a deploy id will be returned to end user
3. Deploy the app again via rest api, same deploy id is applied to the app
curl -s -k -H 'Content-Type: Application/json' --user jhou@redhat.com:x https://ec2-184-72-155-218.compute-1.amazonaws.com/broker/rest/domain/jhou/application/p1/deployments -X POST
4. Change application codes, commit and push again

Actual results:
After step 4
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 359 bytes | 0 bytes/s, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Stopping PHP cartridge
remote: [Wed Oct 09 04:06:31 2013] [warn] PassEnv variable SHELL was undefined
remote: [Wed Oct 09 04:06:31 2013] [warn] PassEnv variable USER was undefined
remote: [Wed Oct 09 04:06:31 2013] [warn] PassEnv variable LOGNAME was undefined
remote: Waiting for stop to finish
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: Shell command '/bin/cp -a app-root/runtime/dependencies/. app-deployments/2013-10-09_04-06-33.574/dependencies' returned an error. rc=1
remote: stdout: 
remote: stderr: /bin/cp: cannot stat `app-root/runtime/dependencies/.': No such file or directory
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://52550e316948fa0ce8000087@p1-jhou.dev.rhcloud.com/~/git/p1.git/
   61dd335..207f1a3  master -> master

Further dig in rhcsh, turns out the destination directory failed to be created
[p1-jhou.dev.rhcloud.com 52550e316948fa0ce8000087]\> file app-root/runtime/dependencies 
app-root/runtime/dependencies: broken symbolic link to `../../app-deployments/2013-10-09_04-06-06.771/dependencies'
[p1-jhou.dev.rhcloud.com 52550e316948fa0ce8000087]\> ls -l app-deployments/
total 12
drwxr-x---. 5 52550e316948fa0ce8000087 52550e316948fa0ce8000087 4096 Oct  9 04:06 2013-10-09_04-06-13.906
drwxr-x---. 5 52550e316948fa0ce8000087 52550e316948fa0ce8000087 4096 Oct  9 04:06 2013-10-09_04-06-33.574
drwxr-xr-x. 2 52550e316948fa0ce8000087 52550e316948fa0ce8000087 4096 Oct  9 04:06 by-id

Expected results:
Should be able to push the code and deploy the app successfully.

Additional info:
Comment 1 Andy Goldstein 2013-10-09 12:01:19 EDT
I believe this is fixed by https://github.com/openshift/origin-server/pull/3805
Comment 2 Dan Mace 2013-10-09 15:38:18 EDT
Confirmed this is fixed by https://github.com/openshift/origin-server/pull/3805
Comment 3 Jianwei Hou 2013-10-10 02:06:01 EDT
Verified on devenv_3880

A new deploy id is generated when no new changes were committed to the app, and this error is not reproduced anymore.

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