Error Connecting GCP CloudSql using Sequilize through nodejs in app engine?
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
add a comment |
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
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
add a comment |
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
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
mysql google-app-engine google-cloud-platform sequelize.js google-cloud-sql
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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/
have to tried sequilize orm through nodejs?
– Shivam Sharma
Nov 25 '18 at 20:21
add a comment |
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
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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/
have to tried sequilize orm through nodejs?
– Shivam Sharma
Nov 25 '18 at 20:21
add a comment |
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/
have to tried sequilize orm through nodejs?
– Shivam Sharma
Nov 25 '18 at 20:21
add a comment |
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/
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/
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
add a comment |
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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