Memorystore connection issues during laravel app deployment

550 views
Skip to first unread message

Brad Kilshaw

unread,
Nov 5, 2018, 8:38:54 AM11/5/18
to Google App Engine

I'm using GAE for a Laravel PHP site and using flex instances. I've always had no problem doing a "gcloud app deploy" to get my app deployed. However, for the last 24 hours or so when I attempt to deploy I get the following error:


Step #1: Package manifest generated successfully.
Step #1: > chmod -R 755 bootstrap/cache
Step #1: > php artisan cache:clear
Step #1:
Step #1: In AbstractConnection.php line 155:
Step #1:                                              
Step #1:   Connection timed out [tcp://1.2.3.4:6379]  
Step #1:                                              
Step #1:
Step #1: Script php artisan cache:clear handling the post-install-cmd event returned with error code 1
Step #1: The command '/bin/sh -c /build-scripts/composer.sh' returned a non-zero code: 1
Finished Step #1
ERROR
ERROR
: build step 1 "gcr.io/cloud-builders/docker@sha256:12345" failed: exit status 1
Step #1:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ERROR
: (gcloud.app.deploy) Cloud build failed. Check logs at https://console.cloud.google.com/gcr/builds/12345?project=1234 Failure status: UNKNOWN: Error Response: [2] Build failed; check build logs for details







For reference, here is the relevant section of the composer.json:


"scripts": {
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover"
    ],
    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "chmod -R 755 bootstrap/cache",
        "php artisan cache:clear",
        "php artisan config:clear"
    ]
}



I have a Memorystore (redis) instance I use since GAE memcache isn't available on flex instances yet. My app uses redis as a cache, so as you can see above, once the new code is deployed composer is configured to clear the cache, which is where it's timing out and failing.


If I SSH into an existing instance, I can run php artisan cache:clear no problem. However, it's failing on deploy. It's a pretty simple code change that's only UI tweaks (html/javascript) so none of the redis or connection code has changed.


Any ideas?


Amit (Google Cloud Support)

unread,
Nov 7, 2018, 1:26:46 PM11/7/18
to Google App Engine

Hello Brad,


From nutshell, it seems like the issue is related to the composer.json file which executed during the build steps. I have seen you already posted the StackOverflow question for this issue, please kindly note that Google Groups is intended for discussing about general product discussions, in StackOverflow you can get more help from the community experts.


From the last message in your StackOverflow post, it seems the issue stems from some changes on Cloud Platform and due to that, I would recommend that you create a private issue by following this Issue Tracker link with  provide as much detail as possible of your issue, including your project ID, App Engine deployment debug logs (with using --verbosity=debug), Cloud Build logs,the reproduction steps, etc as this will allow us to check the relevant logs inside of your project, potentially reproduce the issue and investigate it further.


Rich Vida

unread,
Jun 26, 2019, 10:59:30 AM6/26/19
to Google App Engine
Hi Brad, were you ever able to get this figured out? I'm currently running into the same issue.


On Monday, November 5, 2018 at 8:38:54 AM UTC-5, Brad Kilshaw wrote:

Nicolas (Google Cloud Platform Support)

unread,
Jun 26, 2019, 5:44:58 PM6/26/19
to google-a...@googlegroups.com

Hi Rich,

 

As Amit mentioned in his last comment I would recommend you to open an Issue Tracker for yourself with your own information (project ID, App Engine deployment debug logs (with using --verbosity=debug), the reproduction steps, etc. As even if the error can look the same root cause can be different.

 

Thanks!


Reply all
Reply to author
Forward
0 new messages