heroku / heroku-buildpack-php

Heroku's buildpack for PHP applications.
https://devcenter.heroku.com/categories/php
MIT License
808 stars 1 forks source link

Failed to compile php, push rejected when depoying php app #174

Closed ValleJulien closed 8 years ago

ValleJulien commented 8 years ago

Trying to deploy my symfony app I have this error occured:

Counting objects: 74, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (36/36), done.
Writing objects: 100% (36/36), 14.54 KiB | 0 bytes/s, done.
Total 36 (delta 24), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> PHP app detected
remote: 
remote:  !     WARNING: Your 'composer.json' contains a non-'stable' setting
remote:        for 'minimum-stability'. This may cause the installation of
remote:        unstable versions of runtimes and extensions during this deploy.
remote:        It is recommended that you always use stability flags instead,
remote:        even if you have 'prefer-stable' enabled. For more information,
remote:        see https://getcomposer.org/doc/01-basic-usage.md#stability
remote: 
remote: -----> Bootstrapping...
remote: 
remote: gzip: stdin: not in gzip format
remote: tar: Child returned status 1
remote: tar: Error is not recoverable: exiting now
remote:  !     Push rejected, failed to compile PHP app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to my-app.
remote: 
To https://git.heroku.com/my-app.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: impossible de pousser des références vers 'https://git.heroku.com/my-app.git'

I really don't understand why, and I am not sure it is in relation with php buildpack. Before this error not appear and I have the same configuration as before.

This is my composer.json file:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-4": { "": "src/" }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": "~5.6.0",
        "ext-mbstring": "*",
        "ext-mcrypt": "*",
        "symfony/symfony": "2.7.*",
        "doctrine/orm": "^2.4.8",
        "doctrine/doctrine-bundle": "~1.4",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.8",
        "sensio/distribution-bundle": "~4.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "~2.0",
        "friendsofsymfony/user-bundle": "~2.0@dev",
        "knplabs/doctrine-behaviors": "~1.1",
        "friendsofsymfony/jsrouting-bundle": "^1.5",
        "jms/serializer-bundle": "^1.1",
        "genemu/form-bundle": "2.2.*",
        "elao/web-profiler-extra-bundle" : "~2.3",
        "a2lix/translation-form-bundle": "^2.0",
        "ircmaxell/password-compat": "~1.0",
        "vich/uploader-bundle": "^0.14.0",
        "liip/imagine-bundle": "^1.4",
        "doctrine/data-fixtures": "^1.1",
        "league/geotools": "@stable",
        "winzou/state-machine-bundle": "~0.2.2",
        "doctrine/doctrine-fixtures-bundle": "~2.2",
        "muka/shape-reader": "dev-master",
        "league/csv": "^8.0",
        "ronanguilloux/isocodes": "^2.0",
        "liuggio/excelbundle": "~2.0",
        "liip/doctrine-cache-bundle": "^1.0",
        "evheniy/robots-txt-bundle": "1.*",
        "php-amqplib/rabbitmq-bundle": "^1.9",
        "icicleio/icicle": "^0.9.6"
    },
    "require-dev": {
        "sensio/generator-bundle": "~2.3",
        "heroku/heroku-buildpack-php": "*"
    },
    "scripts": {
        "pre-install-cmd": [
            "BetonDirect\\EntityBundle\\HerokuDatabase::populateEnvironment"
        ],
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
        ],
        "compile": [
          "php app/console assetic:dump --no-debug"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "symfony-assets-install": "hard-copy",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml",
        },
        "branch-alias": {
            "dev-master": "2.7-dev"
        },
        "heroku": {
            "php-config": [
                "date.timezone=Europe/Paris"
            ]
        }
    }
}

For depolying I run this command: git push heroku my-branch:master and I see the hroku logs that build the app.

More explanation here: http://stackoverflow.com/questions/38523304/deploy-symfony-app-on-heroku-return-push-failed-error

Someone have the same problem ?

srigi commented 8 years ago

Same issue (gzip: stdin: not in gzip format) here. I had to define v95 in my buildpack file to make it work again.

dzuelke commented 8 years ago

This is an intermittent issue; it happens when S3 drops the connection mid transfer. No need to revert the buildpack revision. Simply push again and it'll work.

There will be a change in the next buildpack release that catches this error condition and re-tries the transfer.

ValleJulien commented 8 years ago

@srigi I don't know if it could help me to proceed like you suggest, I don't try your suggestion.

In fact, as @dzuelke mentionned in his post, I have to update the buildpack and puh him on to my heroku app.

This issue can be closed, the problem is just to update the buildpack in local and on heroku app.

srigi commented 8 years ago

@dzuelke @ValleJulien Yeah, I realized that this has something with the networking between datacenters. In the morning (in Europe) it worked, around noon it stopped. I had to help myself by this dirty hack because I had to deploy.

dzuelke commented 8 years ago

Just to clarify, @ValleJulien and @srigi, if this problem occurs, you do not need to take any action other than to redeploy. Changing the buildpack revision has zero impact on the issue, because all buildpack revisions pull from the exact same S3 location (and older revisions may be coded to use tarballs that no longer exist and as such cease to function).

The only thing you need to do is git push heroku master again, and the build should succeed.

srigi commented 8 years ago

@dzuelke OK, thanks.