Error Connecting GCP CloudSql using Sequilize through nodejs in app engine?












0















When I try to connect second generation Cloud mysql with app engine using sequilize it give me following Error:



{"name":"SequelizeConnectionError","parent":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true},"original":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true}}




Sequelize option set:-




const db = new Sequelize(
config.database.db,
config.database.username,
config.database.password,
{
host:'localhost',
dialect: "mysql",
port: 3306,
dialectOptions: {
socketPath: '/cloudsql/phrasal-charger-215107:asia-south1:newdish123'
}
}
);



app.yaml




runtime: nodejs
env: flex


beta_settings:
cloud_sql_instances: phrasal-charger-215107:asia-south1:newdish123




MORE INFO



I tried putting '/cloudsql/phrasal-charger-215107:asia-south1:newdish123' in host didn't work.



when I put public ip address in the host given by CloudSQL and setting my ip with GCP as authorised ip then the sequelize is running perfectly and performing operation as expected.










share|improve this question























  • I'm getting the same problem using the mysql node library, so I think it's got more to do with the proxy. I believe ENOENT means the /cloudsql/ directory is missing.

    – Jim Jimson
    Nov 23 '18 at 4:49
















0















When I try to connect second generation Cloud mysql with app engine using sequilize it give me following Error:



{"name":"SequelizeConnectionError","parent":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true},"original":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true}}




Sequelize option set:-




const db = new Sequelize(
config.database.db,
config.database.username,
config.database.password,
{
host:'localhost',
dialect: "mysql",
port: 3306,
dialectOptions: {
socketPath: '/cloudsql/phrasal-charger-215107:asia-south1:newdish123'
}
}
);



app.yaml




runtime: nodejs
env: flex


beta_settings:
cloud_sql_instances: phrasal-charger-215107:asia-south1:newdish123




MORE INFO



I tried putting '/cloudsql/phrasal-charger-215107:asia-south1:newdish123' in host didn't work.



when I put public ip address in the host given by CloudSQL and setting my ip with GCP as authorised ip then the sequelize is running perfectly and performing operation as expected.










share|improve this question























  • I'm getting the same problem using the mysql node library, so I think it's got more to do with the proxy. I believe ENOENT means the /cloudsql/ directory is missing.

    – Jim Jimson
    Nov 23 '18 at 4:49














0












0








0








When I try to connect second generation Cloud mysql with app engine using sequilize it give me following Error:



{"name":"SequelizeConnectionError","parent":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true},"original":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true}}




Sequelize option set:-




const db = new Sequelize(
config.database.db,
config.database.username,
config.database.password,
{
host:'localhost',
dialect: "mysql",
port: 3306,
dialectOptions: {
socketPath: '/cloudsql/phrasal-charger-215107:asia-south1:newdish123'
}
}
);



app.yaml




runtime: nodejs
env: flex


beta_settings:
cloud_sql_instances: phrasal-charger-215107:asia-south1:newdish123




MORE INFO



I tried putting '/cloudsql/phrasal-charger-215107:asia-south1:newdish123' in host didn't work.



when I put public ip address in the host given by CloudSQL and setting my ip with GCP as authorised ip then the sequelize is running perfectly and performing operation as expected.










share|improve this question














When I try to connect second generation Cloud mysql with app engine using sequilize it give me following Error:



{"name":"SequelizeConnectionError","parent":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true},"original":{"errno":"ENOENT","code":"ENOENT","syscall":"connect","address":"/cloudsql/phrasal-charger-215107:asia-south1:newdish123","fatal":true}}




Sequelize option set:-




const db = new Sequelize(
config.database.db,
config.database.username,
config.database.password,
{
host:'localhost',
dialect: "mysql",
port: 3306,
dialectOptions: {
socketPath: '/cloudsql/phrasal-charger-215107:asia-south1:newdish123'
}
}
);



app.yaml




runtime: nodejs
env: flex


beta_settings:
cloud_sql_instances: phrasal-charger-215107:asia-south1:newdish123




MORE INFO



I tried putting '/cloudsql/phrasal-charger-215107:asia-south1:newdish123' in host didn't work.



when I put public ip address in the host given by CloudSQL and setting my ip with GCP as authorised ip then the sequelize is running perfectly and performing operation as expected.







mysql google-app-engine google-cloud-platform sequelize.js google-cloud-sql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 22 '18 at 8:13









Shivam SharmaShivam Sharma

1151412




1151412













  • I'm getting the same problem using the mysql node library, so I think it's got more to do with the proxy. I believe ENOENT means the /cloudsql/ directory is missing.

    – Jim Jimson
    Nov 23 '18 at 4:49



















  • I'm getting the same problem using the mysql node library, so I think it's got more to do with the proxy. I believe ENOENT means the /cloudsql/ directory is missing.

    – Jim Jimson
    Nov 23 '18 at 4:49

















I'm getting the same problem using the mysql node library, so I think it's got more to do with the proxy. I believe ENOENT means the /cloudsql/ directory is missing.

– Jim Jimson
Nov 23 '18 at 4:49





I'm getting the same problem using the mysql node library, so I think it's got more to do with the proxy. I believe ENOENT means the /cloudsql/ directory is missing.

– Jim Jimson
Nov 23 '18 at 4:49












2 Answers
2






active

oldest

votes


















1














I was getting the exact same issue, all of my code base didn't change at all. What I did to fix it was to create a new project and then create new App Engine Instance and a new Cloud SQL database in my new project.



Then I enabled SQL Admin for the project, created a new profile by running



gcloud init


and creating a new profile for the new project.



Then I deployed the app again:



gcloud app deploy


You can find the setup of my project here:



Node.JS on Google App Enging with Cloud SQLError: connect ENOENT /cloudsql/






share|improve this answer
























  • have to tried sequilize orm through nodejs?

    – Shivam Sharma
    Nov 25 '18 at 20:21





















1














Manually add the IP addresses of machines/networks that need access to Cloud SQL to the Authorized Networks section.



And



Check your proxy while making connection






share|improve this answer
























  • This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

    – Jim Jimson
    Nov 23 '18 at 4:46











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%2f53426456%2ferror-connecting-gcp-cloudsql-using-sequilize-through-nodejs-in-app-engine%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














I was getting the exact same issue, all of my code base didn't change at all. What I did to fix it was to create a new project and then create new App Engine Instance and a new Cloud SQL database in my new project.



Then I enabled SQL Admin for the project, created a new profile by running



gcloud init


and creating a new profile for the new project.



Then I deployed the app again:



gcloud app deploy


You can find the setup of my project here:



Node.JS on Google App Enging with Cloud SQLError: connect ENOENT /cloudsql/






share|improve this answer
























  • have to tried sequilize orm through nodejs?

    – Shivam Sharma
    Nov 25 '18 at 20:21


















1














I was getting the exact same issue, all of my code base didn't change at all. What I did to fix it was to create a new project and then create new App Engine Instance and a new Cloud SQL database in my new project.



Then I enabled SQL Admin for the project, created a new profile by running



gcloud init


and creating a new profile for the new project.



Then I deployed the app again:



gcloud app deploy


You can find the setup of my project here:



Node.JS on Google App Enging with Cloud SQLError: connect ENOENT /cloudsql/






share|improve this answer
























  • have to tried sequilize orm through nodejs?

    – Shivam Sharma
    Nov 25 '18 at 20:21
















1












1








1







I was getting the exact same issue, all of my code base didn't change at all. What I did to fix it was to create a new project and then create new App Engine Instance and a new Cloud SQL database in my new project.



Then I enabled SQL Admin for the project, created a new profile by running



gcloud init


and creating a new profile for the new project.



Then I deployed the app again:



gcloud app deploy


You can find the setup of my project here:



Node.JS on Google App Enging with Cloud SQLError: connect ENOENT /cloudsql/






share|improve this answer













I was getting the exact same issue, all of my code base didn't change at all. What I did to fix it was to create a new project and then create new App Engine Instance and a new Cloud SQL database in my new project.



Then I enabled SQL Admin for the project, created a new profile by running



gcloud init


and creating a new profile for the new project.



Then I deployed the app again:



gcloud app deploy


You can find the setup of my project here:



Node.JS on Google App Enging with Cloud SQLError: connect ENOENT /cloudsql/







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 23 '18 at 5:36









Jim JimsonJim Jimson

619413




619413













  • have to tried sequilize orm through nodejs?

    – Shivam Sharma
    Nov 25 '18 at 20:21





















  • have to tried sequilize orm through nodejs?

    – Shivam Sharma
    Nov 25 '18 at 20:21



















have to tried sequilize orm through nodejs?

– Shivam Sharma
Nov 25 '18 at 20:21







have to tried sequilize orm through nodejs?

– Shivam Sharma
Nov 25 '18 at 20:21















1














Manually add the IP addresses of machines/networks that need access to Cloud SQL to the Authorized Networks section.



And



Check your proxy while making connection






share|improve this answer
























  • This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

    – Jim Jimson
    Nov 23 '18 at 4:46
















1














Manually add the IP addresses of machines/networks that need access to Cloud SQL to the Authorized Networks section.



And



Check your proxy while making connection






share|improve this answer
























  • This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

    – Jim Jimson
    Nov 23 '18 at 4:46














1












1








1







Manually add the IP addresses of machines/networks that need access to Cloud SQL to the Authorized Networks section.



And



Check your proxy while making connection






share|improve this answer













Manually add the IP addresses of machines/networks that need access to Cloud SQL to the Authorized Networks section.



And



Check your proxy while making connection







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 15:01









Vivek Singh ThakurVivek Singh Thakur

111




111













  • This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

    – Jim Jimson
    Nov 23 '18 at 4:46



















  • This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

    – Jim Jimson
    Nov 23 '18 at 4:46

















This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

– Jim Jimson
Nov 23 '18 at 4:46





This will work for dev connections from your local machine, but the app engine VM IP can change from time to time, so this will only work temporarily.

– Jim Jimson
Nov 23 '18 at 4:46


















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%2f53426456%2ferror-connecting-gcp-cloudsql-using-sequilize-through-nodejs-in-app-engine%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

"Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

Alcedinidae

Origin of the phrase “under your belt”?