Scenario: 1) Create a new application using rhc create-app foo php-5 --from-code=empty 2) Add a git remote for that app to an existing repo 2) In an existing repo, do 'git push <remote> master' The prereceive is assuming that the repo has at least 1 commit - when --from-code=empty that is not the case. So a fatal error (which doesn't actually prevent) execution is displayed to the user: Counting objects: 55, done. Delta compression using up to 4 threads. Compressing objects: 100% (41/41), done. Writing objects: 100% (55/55), 15.60 KiB, done. Total 55 (delta 16), reused 41 (delta 9) remote: fatal: Not a valid object name master remote: fatal: Invalid revision range 0000000000000000000000000000000000000000..888ba90a3aec6cd55f9b6e200275becce4376baa remote: Stopping Ruby cartridge remote: Syntax error on line 10 of /var/lib/openshift/5245cc609f79cf2b93000716/ruby/etc/conf.d/openshift.conf: remote: DocumentRoot must be a directory remote: httpd (no pid file) not running We should guard against that case in prereceive - if the repo is init'd but has no commits we shouldn't be checking the commit values. Not super high priority, but RHC is gearing up to start using =empty more aggressively and I want to stomp this. Was a consequence of the change I made to support "empty" earlier on - we didn't catch it during test. Can be deferred, but valuable to fix.
Based on reported bug report i've updated the check for the branch in the openshift app repo. If the return value of the git ls-tree... is unsuccessful and returns value > 0 ( no branch is present ), the output is redirected to 2/dev/null, and no hot deploy is needed. Also when the app is created with empty repo and no initial (or other commits) are present, no hot deploy is needed. Pull Req.: https://github.com/openshift/origin-server/pull/3837
Hi Jakub, There were a few issues with the gear script relating to git pre/postreceive and marker files. The following PR incorporates fixes for this BZ as well as other items. https://github.com/openshift/origin-server/pull/3861
Checked on devenv_3891, issue has been fixed. $ git push origin master Counting objects: 3710, done. Compressing objects: 100% (3291/3291), done. Writing objects: 100% (3710/3710), 3.35 MiB | 891 KiB/s, done. Total 3710 (delta 63), reused 3710 (delta 63) remote: Stopping PHP cartridge remote: Syntax error on line 2 of /var/lib/openshift/5259037548d5f94ce3000179/php/configuration/etc/conf.d/openshift.conf: remote: DocumentRoot must be a directory remote: httpd (no pid file) not running remote: Building git ref 'master', commit d710f99 remote: Building PHP cartridge remote: Preparing build for deployment remote: Prepared deployment artifacts in /var/lib/openshift/5259037548d5f94ce3000179/app-deployments/2013-10-12_04-12-05.385 remote: Deployment id is 7530b76b remote: Activating deployment remote: remote: done. remote: ================================================== remote: Wiki-Admin login: admin remote: Wiki-Admin password: OpenShiftAdmin remote: Don't forget to change your wiki admin password! remote: ================================================== remote: Starting PHP cartridge remote: Result: success remote: Activation status: success remote: Deployment completed To ssh://5259037548d5f94ce3000179.rhcloud.com/~/git/php1.git/ * [new branch] master -> master After git push, the code added to the app, and app works well.