google-cloud-php icon indicating copy to clipboard operation
google-cloud-php copied to clipboard

Debugging: Deploy process failing when enable_stackdrive_integration is enabled.

Open dimitriadamou opened this issue 3 years ago • 5 comments

Hi all,

When including enable_stackdrive_integration in my yaml for flex (runtime: php) at the end of the build process I am getting the following error

Step #1: Enabling stackdriver integration...
Step #1: You must include either google/cloud >= 0.33.0 or google/error-reporting >= 0.4.0error building image: error building stage: waiting for process to exit: exit status 1

However I am certain I have the latest version.

My composer.json looks like the following

{
    "require": {
        "php": "7.3.*",
        "ext-redis": "*",
        "ext-curl": "*",
        "ext-stackdriver_debugger": "*",
        "ext-grpc": "*",
        "ext-protobuf": "*",
        "google/cloud": "^0.174.0"
    }
}

Removing enable_stackdrive_integration from my yaml config allows me to successfully deploy.

dimitriadamou avatar Feb 08 '22 06:02 dimitriadamou

The implementation is checking for the existence of the following class before throwing that error: Google\Cloud\ErrorReporting\Bootstrap

Would you be able to verify whether you have it delivered along with your installation?

dwsupplee avatar Feb 08 '22 21:02 dwsupplee

Hi @dwsupplee I can confirm that Google\Cloud\ErrorReporting\Bootstrap exists as it is pulled in via composer due to google/cloud Screen Shot 2022-02-09 at 11 13 25 am

dimitriadamou avatar Feb 09 '22 00:02 dimitriadamou

I have attached my build log - log-854cba49-60c0-4130-b5a6-e89602755ea4.txt

dimitriadamou avatar Feb 09 '22 00:02 dimitriadamou

I have found the issue - @dwsupplee you mentioned

The implementation is checking for the existence of the following class before throwing that error: Google\Cloud\ErrorReporting\Bootstrap

On my build I have my vendor directory in a different location. I am very sorry for not providing the full composer.json file.

    "config": {
        "vendor-dir": "app/vendor"
    },

Removing that the build passes, however I rely on my vendor directory being in app/vendor - I have made changes to the project to put vendor in the ${APP_DIR} folder.

I tried poking around but I could not find anything in the Docker image - what composer flags do I have to pass over to the build system to target the updated vendor-dir location? The documentation is not very clear with COMPOSER_FLAGS (https://cloud.google.com/appengine/docs/flexible/php/reference/app-yaml)

dimitriadamou avatar Feb 09 '22 00:02 dimitriadamou

I think the short answer here is that using vendor-dir on app engine may not be entirely supported. Have you been able to find a work-around?

bshaffer avatar Aug 08 '22 20:08 bshaffer