Google Cloud Build failed for Laravel artisan, involving database connection












0















I'm trying to pack source as image and build by Google Cloud Build



here's my docker file:



FROM php
RUN cd ~ && curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN cd ~ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer
ADD ./mysource /app
WORKDIR /app
RUN cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs
RUN cd /app && composer require laravel/horizon && php artisan vendor:publish --provider="LaravelHorizonHorizonServiceProvider"


turned out the build failed and log showed:
(newest log at the top)



Step #1: 
ERROR: build step 1 "gcr.io/cloud-builders/docker" failed: exit status 1
Finished Step #1
Step #1: The command '/bin/sh -c cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs' returned a non-zero code: 1
Step #1: Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 46:
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 50:
Step #1: chema.tables where table_schema = forge and table_name = explorers)
Step #1: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
Step #1:
Step #1: In Connection.php line 664:
Step #1:
Step #1: > @php artisan package:discover
Step #1: > IlluminateFoundationComposerScripts::postAutoloadDump
Step #1: Generating optimized autoload files


I'm looking for something like services in bitbucket pipeline, which u could use during build process . I also referenced the issue raised here, but those responds didn't resolve my situation.



appreciate for any idea










share|improve this question























  • How do your laravel-project/.env settings look like? It may be worthwhile checking and updating these settings with the correct database connection parameters. Are there any user name and password configured in the laradock/.env file?

    – George
    Nov 21 '18 at 21:37











  • yes the .env is well config, and I'm pretty sure that's something with connection betweens 'steps' if cloud build. Coz I did also try connecting to previous step by the most simple mysql cli, to localhost/127.0.0.1/0.0.0.0/<container name of previous step> all failed

    – Michael Linus
    Nov 22 '18 at 4:33













  • More detail on my cloud build yaml Step1:gcr.io/cloud-builders/docker arg: run --name=mysql -p 3306:3306 --env MYSQL_USER=forge --env MYSQL_PASSWORD=forge --env MYSQL_DATABASE=forge --env MYSQL_ROOT_PASSWORD=secret --env MYSQL_ROOT_HOST=% -d circleci/mysql Step2:gcr.io/cloud-builders/docker arg:build -t <..... build an img from a dockerfile> Having connection attempt in docker file like RUN mysql -u root --password=root -h 127.0.0.1 --port=3306 --database=forge

    – Michael Linus
    Nov 22 '18 at 4:36













  • Are connection parameters correct? You need to adjust them manually, to facilitate build success.

    – George
    Nov 23 '18 at 23:34
















0















I'm trying to pack source as image and build by Google Cloud Build



here's my docker file:



FROM php
RUN cd ~ && curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN cd ~ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer
ADD ./mysource /app
WORKDIR /app
RUN cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs
RUN cd /app && composer require laravel/horizon && php artisan vendor:publish --provider="LaravelHorizonHorizonServiceProvider"


turned out the build failed and log showed:
(newest log at the top)



Step #1: 
ERROR: build step 1 "gcr.io/cloud-builders/docker" failed: exit status 1
Finished Step #1
Step #1: The command '/bin/sh -c cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs' returned a non-zero code: 1
Step #1: Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 46:
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 50:
Step #1: chema.tables where table_schema = forge and table_name = explorers)
Step #1: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
Step #1:
Step #1: In Connection.php line 664:
Step #1:
Step #1: > @php artisan package:discover
Step #1: > IlluminateFoundationComposerScripts::postAutoloadDump
Step #1: Generating optimized autoload files


I'm looking for something like services in bitbucket pipeline, which u could use during build process . I also referenced the issue raised here, but those responds didn't resolve my situation.



appreciate for any idea










share|improve this question























  • How do your laravel-project/.env settings look like? It may be worthwhile checking and updating these settings with the correct database connection parameters. Are there any user name and password configured in the laradock/.env file?

    – George
    Nov 21 '18 at 21:37











  • yes the .env is well config, and I'm pretty sure that's something with connection betweens 'steps' if cloud build. Coz I did also try connecting to previous step by the most simple mysql cli, to localhost/127.0.0.1/0.0.0.0/<container name of previous step> all failed

    – Michael Linus
    Nov 22 '18 at 4:33













  • More detail on my cloud build yaml Step1:gcr.io/cloud-builders/docker arg: run --name=mysql -p 3306:3306 --env MYSQL_USER=forge --env MYSQL_PASSWORD=forge --env MYSQL_DATABASE=forge --env MYSQL_ROOT_PASSWORD=secret --env MYSQL_ROOT_HOST=% -d circleci/mysql Step2:gcr.io/cloud-builders/docker arg:build -t <..... build an img from a dockerfile> Having connection attempt in docker file like RUN mysql -u root --password=root -h 127.0.0.1 --port=3306 --database=forge

    – Michael Linus
    Nov 22 '18 at 4:36













  • Are connection parameters correct? You need to adjust them manually, to facilitate build success.

    – George
    Nov 23 '18 at 23:34














0












0








0








I'm trying to pack source as image and build by Google Cloud Build



here's my docker file:



FROM php
RUN cd ~ && curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN cd ~ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer
ADD ./mysource /app
WORKDIR /app
RUN cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs
RUN cd /app && composer require laravel/horizon && php artisan vendor:publish --provider="LaravelHorizonHorizonServiceProvider"


turned out the build failed and log showed:
(newest log at the top)



Step #1: 
ERROR: build step 1 "gcr.io/cloud-builders/docker" failed: exit status 1
Finished Step #1
Step #1: The command '/bin/sh -c cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs' returned a non-zero code: 1
Step #1: Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 46:
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 50:
Step #1: chema.tables where table_schema = forge and table_name = explorers)
Step #1: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
Step #1:
Step #1: In Connection.php line 664:
Step #1:
Step #1: > @php artisan package:discover
Step #1: > IlluminateFoundationComposerScripts::postAutoloadDump
Step #1: Generating optimized autoload files


I'm looking for something like services in bitbucket pipeline, which u could use during build process . I also referenced the issue raised here, but those responds didn't resolve my situation.



appreciate for any idea










share|improve this question














I'm trying to pack source as image and build by Google Cloud Build



here's my docker file:



FROM php
RUN cd ~ && curl -sS https://getcomposer.org/installer -o composer-setup.php
RUN cd ~ && php composer-setup.php --install-dir=/usr/local/bin --filename=composer
ADD ./mysource /app
WORKDIR /app
RUN cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs
RUN cd /app && composer require laravel/horizon && php artisan vendor:publish --provider="LaravelHorizonHorizonServiceProvider"


turned out the build failed and log showed:
(newest log at the top)



Step #1: 
ERROR: build step 1 "gcr.io/cloud-builders/docker" failed: exit status 1
Finished Step #1
Step #1: The command '/bin/sh -c cd /app && composer update --ignore-platform-reqs && composer install --ignore-platform-reqs' returned a non-zero code: 1
Step #1: Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 46:
Step #1: SQLSTATE[HY000] [2002] Connection refused
Step #1: In PDOConnection.php line 50:
Step #1: chema.tables where table_schema = forge and table_name = explorers)
Step #1: SQLSTATE[HY000] [2002] Connection refused (SQL: select * from information_s
Step #1:
Step #1: In Connection.php line 664:
Step #1:
Step #1: > @php artisan package:discover
Step #1: > IlluminateFoundationComposerScripts::postAutoloadDump
Step #1: Generating optimized autoload files


I'm looking for something like services in bitbucket pipeline, which u could use during build process . I also referenced the issue raised here, but those responds didn't resolve my situation.



appreciate for any idea







build google-cloud-platform google-cloud-build






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 4:21









Michael LinusMichael Linus

61




61













  • How do your laravel-project/.env settings look like? It may be worthwhile checking and updating these settings with the correct database connection parameters. Are there any user name and password configured in the laradock/.env file?

    – George
    Nov 21 '18 at 21:37











  • yes the .env is well config, and I'm pretty sure that's something with connection betweens 'steps' if cloud build. Coz I did also try connecting to previous step by the most simple mysql cli, to localhost/127.0.0.1/0.0.0.0/<container name of previous step> all failed

    – Michael Linus
    Nov 22 '18 at 4:33













  • More detail on my cloud build yaml Step1:gcr.io/cloud-builders/docker arg: run --name=mysql -p 3306:3306 --env MYSQL_USER=forge --env MYSQL_PASSWORD=forge --env MYSQL_DATABASE=forge --env MYSQL_ROOT_PASSWORD=secret --env MYSQL_ROOT_HOST=% -d circleci/mysql Step2:gcr.io/cloud-builders/docker arg:build -t <..... build an img from a dockerfile> Having connection attempt in docker file like RUN mysql -u root --password=root -h 127.0.0.1 --port=3306 --database=forge

    – Michael Linus
    Nov 22 '18 at 4:36













  • Are connection parameters correct? You need to adjust them manually, to facilitate build success.

    – George
    Nov 23 '18 at 23:34



















  • How do your laravel-project/.env settings look like? It may be worthwhile checking and updating these settings with the correct database connection parameters. Are there any user name and password configured in the laradock/.env file?

    – George
    Nov 21 '18 at 21:37











  • yes the .env is well config, and I'm pretty sure that's something with connection betweens 'steps' if cloud build. Coz I did also try connecting to previous step by the most simple mysql cli, to localhost/127.0.0.1/0.0.0.0/<container name of previous step> all failed

    – Michael Linus
    Nov 22 '18 at 4:33













  • More detail on my cloud build yaml Step1:gcr.io/cloud-builders/docker arg: run --name=mysql -p 3306:3306 --env MYSQL_USER=forge --env MYSQL_PASSWORD=forge --env MYSQL_DATABASE=forge --env MYSQL_ROOT_PASSWORD=secret --env MYSQL_ROOT_HOST=% -d circleci/mysql Step2:gcr.io/cloud-builders/docker arg:build -t <..... build an img from a dockerfile> Having connection attempt in docker file like RUN mysql -u root --password=root -h 127.0.0.1 --port=3306 --database=forge

    – Michael Linus
    Nov 22 '18 at 4:36













  • Are connection parameters correct? You need to adjust them manually, to facilitate build success.

    – George
    Nov 23 '18 at 23:34

















How do your laravel-project/.env settings look like? It may be worthwhile checking and updating these settings with the correct database connection parameters. Are there any user name and password configured in the laradock/.env file?

– George
Nov 21 '18 at 21:37





How do your laravel-project/.env settings look like? It may be worthwhile checking and updating these settings with the correct database connection parameters. Are there any user name and password configured in the laradock/.env file?

– George
Nov 21 '18 at 21:37













yes the .env is well config, and I'm pretty sure that's something with connection betweens 'steps' if cloud build. Coz I did also try connecting to previous step by the most simple mysql cli, to localhost/127.0.0.1/0.0.0.0/<container name of previous step> all failed

– Michael Linus
Nov 22 '18 at 4:33







yes the .env is well config, and I'm pretty sure that's something with connection betweens 'steps' if cloud build. Coz I did also try connecting to previous step by the most simple mysql cli, to localhost/127.0.0.1/0.0.0.0/<container name of previous step> all failed

– Michael Linus
Nov 22 '18 at 4:33















More detail on my cloud build yaml Step1:gcr.io/cloud-builders/docker arg: run --name=mysql -p 3306:3306 --env MYSQL_USER=forge --env MYSQL_PASSWORD=forge --env MYSQL_DATABASE=forge --env MYSQL_ROOT_PASSWORD=secret --env MYSQL_ROOT_HOST=% -d circleci/mysql Step2:gcr.io/cloud-builders/docker arg:build -t <..... build an img from a dockerfile> Having connection attempt in docker file like RUN mysql -u root --password=root -h 127.0.0.1 --port=3306 --database=forge

– Michael Linus
Nov 22 '18 at 4:36







More detail on my cloud build yaml Step1:gcr.io/cloud-builders/docker arg: run --name=mysql -p 3306:3306 --env MYSQL_USER=forge --env MYSQL_PASSWORD=forge --env MYSQL_DATABASE=forge --env MYSQL_ROOT_PASSWORD=secret --env MYSQL_ROOT_HOST=% -d circleci/mysql Step2:gcr.io/cloud-builders/docker arg:build -t <..... build an img from a dockerfile> Having connection attempt in docker file like RUN mysql -u root --password=root -h 127.0.0.1 --port=3306 --database=forge

– Michael Linus
Nov 22 '18 at 4:36















Are connection parameters correct? You need to adjust them manually, to facilitate build success.

– George
Nov 23 '18 at 23:34





Are connection parameters correct? You need to adjust them manually, to facilitate build success.

– George
Nov 23 '18 at 23:34












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405215%2fgoogle-cloud-build-failed-for-laravel-artisan-involving-database-connection%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53405215%2fgoogle-cloud-build-failed-for-laravel-artisan-involving-database-connection%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

'app-layout' is not a known element: how to share Component with different Modules