KeystoneJS app failing to deploy on Google App Engine
I have a KeystoneJS app on a Google Compute Engine instance, after executing mongod and npm start in my project folder, I run gcloud app deploy and get the following error:
Mongoose connection "error" event fired with:
{ MongoError: failed to connect to server [localhost:27017] on first connect
at Pool.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:326:35)
at Pool.emit (events.js:182:13)
at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:272:12)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:182:13)
at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:175:49)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoError',
message:
'failed to connect to server [localhost:27017] on first connect' }
Error: KeystoneJS (Modern Marketing) failed to start - Check that you are running `mongod` in a separate process.
at NativeConnection.<anonymous> (/app/node_modules/keystone/lib/core/openDatabaseConnection.js:59:10)
at NativeConnection.emit (events.js:182:13)
at Immediate.<anonymous> (/app/node_modules/mongoose/lib/connection.js:296:19)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! modern-marketing@0.0.0 start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the modern-marketing@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-01-02T05_59_39_493Z-debug.log
I don't have much experience with MongoDB or KeystoneJS, so any insight is appreciated
node.js mongodb google-app-engine google-compute-engine keystonejs
add a comment |
I have a KeystoneJS app on a Google Compute Engine instance, after executing mongod and npm start in my project folder, I run gcloud app deploy and get the following error:
Mongoose connection "error" event fired with:
{ MongoError: failed to connect to server [localhost:27017] on first connect
at Pool.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:326:35)
at Pool.emit (events.js:182:13)
at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:272:12)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:182:13)
at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:175:49)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoError',
message:
'failed to connect to server [localhost:27017] on first connect' }
Error: KeystoneJS (Modern Marketing) failed to start - Check that you are running `mongod` in a separate process.
at NativeConnection.<anonymous> (/app/node_modules/keystone/lib/core/openDatabaseConnection.js:59:10)
at NativeConnection.emit (events.js:182:13)
at Immediate.<anonymous> (/app/node_modules/mongoose/lib/connection.js:296:19)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! modern-marketing@0.0.0 start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the modern-marketing@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-01-02T05_59_39_493Z-debug.log
I don't have much experience with MongoDB or KeystoneJS, so any insight is appreciated
node.js mongodb google-app-engine google-compute-engine keystonejs
1
You say its on Compute Engine, but you are running App Engine commands. Can you clarify what product you are actually using? They are two very different products.
– BrettJ
Jan 5 at 20:40
add a comment |
I have a KeystoneJS app on a Google Compute Engine instance, after executing mongod and npm start in my project folder, I run gcloud app deploy and get the following error:
Mongoose connection "error" event fired with:
{ MongoError: failed to connect to server [localhost:27017] on first connect
at Pool.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:326:35)
at Pool.emit (events.js:182:13)
at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:272:12)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:182:13)
at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:175:49)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoError',
message:
'failed to connect to server [localhost:27017] on first connect' }
Error: KeystoneJS (Modern Marketing) failed to start - Check that you are running `mongod` in a separate process.
at NativeConnection.<anonymous> (/app/node_modules/keystone/lib/core/openDatabaseConnection.js:59:10)
at NativeConnection.emit (events.js:182:13)
at Immediate.<anonymous> (/app/node_modules/mongoose/lib/connection.js:296:19)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! modern-marketing@0.0.0 start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the modern-marketing@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-01-02T05_59_39_493Z-debug.log
I don't have much experience with MongoDB or KeystoneJS, so any insight is appreciated
node.js mongodb google-app-engine google-compute-engine keystonejs
I have a KeystoneJS app on a Google Compute Engine instance, after executing mongod and npm start in my project folder, I run gcloud app deploy and get the following error:
Mongoose connection "error" event fired with:
{ MongoError: failed to connect to server [localhost:27017] on first connect
at Pool.<anonymous> (/app/node_modules/mongodb-core/lib/topologies/server.js:326:35)
at Pool.emit (events.js:182:13)
at Connection.<anonymous> (/app/node_modules/mongodb-core/lib/connection/pool.js:272:12)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:182:13)
at Socket.<anonymous> (/app/node_modules/mongodb-core/lib/connection/connection.js:175:49)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoError',
message:
'failed to connect to server [localhost:27017] on first connect' }
Error: KeystoneJS (Modern Marketing) failed to start - Check that you are running `mongod` in a separate process.
at NativeConnection.<anonymous> (/app/node_modules/keystone/lib/core/openDatabaseConnection.js:59:10)
at NativeConnection.emit (events.js:182:13)
at Immediate.<anonymous> (/app/node_modules/mongoose/lib/connection.js:296:19)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! modern-marketing@0.0.0 start: `node keystone.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the modern-marketing@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-01-02T05_59_39_493Z-debug.log
I don't have much experience with MongoDB or KeystoneJS, so any insight is appreciated
node.js mongodb google-app-engine google-compute-engine keystonejs
node.js mongodb google-app-engine google-compute-engine keystonejs
asked Jan 2 at 6:53
chased57chased57
31
31
1
You say its on Compute Engine, but you are running App Engine commands. Can you clarify what product you are actually using? They are two very different products.
– BrettJ
Jan 5 at 20:40
add a comment |
1
You say its on Compute Engine, but you are running App Engine commands. Can you clarify what product you are actually using? They are two very different products.
– BrettJ
Jan 5 at 20:40
1
1
You say its on Compute Engine, but you are running App Engine commands. Can you clarify what product you are actually using? They are two very different products.
– BrettJ
Jan 5 at 20:40
You say its on Compute Engine, but you are running App Engine commands. Can you clarify what product you are actually using? They are two very different products.
– BrettJ
Jan 5 at 20:40
add a comment |
1 Answer
1
active
oldest
votes
It seems that while deploying to GAE, you're keeping the default connection to a local hosted mongo database. (failed to connect to server [localhost:27017]
)
Since GAE environment doesn't have mongodb running, you have to create a mongo database (there are many different mongodb services that you could use here) and set your project up with MONGO_URI
env variable.
Keystonejs will then try to connect the database you set in this variable.
I hope this comment will help you, if you still have some issues setting all that stuff up, you can show us your app.yaml file ;)
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%2f54002373%2fkeystonejs-app-failing-to-deploy-on-google-app-engine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It seems that while deploying to GAE, you're keeping the default connection to a local hosted mongo database. (failed to connect to server [localhost:27017]
)
Since GAE environment doesn't have mongodb running, you have to create a mongo database (there are many different mongodb services that you could use here) and set your project up with MONGO_URI
env variable.
Keystonejs will then try to connect the database you set in this variable.
I hope this comment will help you, if you still have some issues setting all that stuff up, you can show us your app.yaml file ;)
add a comment |
It seems that while deploying to GAE, you're keeping the default connection to a local hosted mongo database. (failed to connect to server [localhost:27017]
)
Since GAE environment doesn't have mongodb running, you have to create a mongo database (there are many different mongodb services that you could use here) and set your project up with MONGO_URI
env variable.
Keystonejs will then try to connect the database you set in this variable.
I hope this comment will help you, if you still have some issues setting all that stuff up, you can show us your app.yaml file ;)
add a comment |
It seems that while deploying to GAE, you're keeping the default connection to a local hosted mongo database. (failed to connect to server [localhost:27017]
)
Since GAE environment doesn't have mongodb running, you have to create a mongo database (there are many different mongodb services that you could use here) and set your project up with MONGO_URI
env variable.
Keystonejs will then try to connect the database you set in this variable.
I hope this comment will help you, if you still have some issues setting all that stuff up, you can show us your app.yaml file ;)
It seems that while deploying to GAE, you're keeping the default connection to a local hosted mongo database. (failed to connect to server [localhost:27017]
)
Since GAE environment doesn't have mongodb running, you have to create a mongo database (there are many different mongodb services that you could use here) and set your project up with MONGO_URI
env variable.
Keystonejs will then try to connect the database you set in this variable.
I hope this comment will help you, if you still have some issues setting all that stuff up, you can show us your app.yaml file ;)
answered Jan 12 at 10:05


Arthur FaugerasArthur Faugeras
16
16
add a comment |
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%2f54002373%2fkeystonejs-app-failing-to-deploy-on-google-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
1
You say its on Compute Engine, but you are running App Engine commands. Can you clarify what product you are actually using? They are two very different products.
– BrettJ
Jan 5 at 20:40