cloudControl push rejected: cannot stat file

129 views Asked by At

I'm trying to push my application to cloudControl but it doesn't seem to be running the build process properly and keeps rejecting my push.

Here is the error:

C:\Users\Vincent\Documents\GitHub\***>cctrlapp *** push
Counting objects: 12, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 4.06 KiB | 0 bytes/s, done.
Total 10 (delta 1), reused 0 (delta 0)
remote:
remote: -----> Receiving push
remote:        Loading composer repositories with package information
remote:        Installing dependencies (including require-dev) from lock file
remote:          - Installing doctrine/lexer (v1.0)
remote:            Downloading: 100%
remote:
remote:          - Installing respect/validation (0.6.1)
remote:            Downloading: 100%
remote:
remote:          - Installing slim/slim (2.4.3)
remote:            Downloading: 100%
remote:
remote:          - Installing zendframework/zend-escaper (2.2.6)
remote:            Downloading: 100%
remote:
remote:          - Installing zf1/zend-exception (1.12.8)
remote:            Downloading: 100%
remote:
remote:          - Installing zf1/zend-session (1.12.8)
remote:            Downloading: 100%
remote:
remote:        zf1/zend-session suggests installing zf1/zend-config (Used in special situations or with special adapters)
remote:        zf1/zend-session suggests installing zf1/zend-db (Used in special situations or with special adapters)
remote:        zf1/zend-session suggests installing zf1/zend-loader (Used in special situations or with special adapters)
remote:        Generating autoload files
remote: cp: cannot stat `/srv/tmp/builddir/code/vendor': No such file or directory
remote:  !     cloudControl push rejected, failed to compile php app
remote:  !
remote: error: hook declined to update refs/heads/master
To ssh://***@cloudcontrolled.com/repository.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'ssh://***@cloudcontrolled.com/repository.git'
Command '['C:\\Program Files (x86)\\Git\\cmd\\git.exe', 'push', u'ssh://***@cloudcontrolled.com/repository.git', 'master']' returned non-zero exit status 1

Right now my project contains these files:

  • /
    • includes/
      • vendor/
    • .gitignore
    • composer.json
    • composer.lock
    • index.php

How do I get the post-receive hook to properly "compile" the PHP app?

This is my composer.json file:

{
    "name": "Hello World",
    "description": "My PHP application",
    "authors": [
        {
            "name": "Vincent",
            "email": " ... @gmail.com"
        }
    ],
    "config": {
        "vendor-dir": "includes/vendor"
    },
    "require": {
        "zendframework/zend-escaper": "2.2.6",
        "respect/validation": "~0.6.1",
        "slim/slim": "~2.4.3",
        "zf1/zend-session": "1.12.8"
    }
}
1

There are 1 answers

2
pst On BEST ANSWER

There are three likely issues here:

  • The directory is empty. Git does not track empty directories so even if it does exist in your working directory it does not exist in the repository.
  • The directory is not empty, but ignored using a .gitignore.
  • Composer is not looking for the vendor directoy in the right place. /srv/tmp/builddir/code/vendor would mean it would have to exist in /vendor yours is in /includes/vendor.

It might actually be a combination of any of the above. To be able to tell I'd need the contents of the .gitignore and the composer.json. If I had to bet, my money would be on the last option.

To fix the empty directory issue, make sure your /.gitignore file does not include the /includes/vendor in any way. Then create a /includes/vendor/.gitignore file with the following content:

# Ignore everything in this directory
*
# Except this file
!.gitignore

To fix the latest, check your composer.json and the 'target-dir' set there. Refer to the Composer documentation for more details.