How should I go about updating Parse on AWS? Thanks
The details will depend on your exact setup, but generally you will need to clone your server project, update the package.json file to use the latest version of Parse Server, and the push the project.
Ok I'll give it a try this evening. Thanks for the quick response
On Sun, Mar 6, 2016 at 3:53 PM Drew [email protected] wrote:
The details will depend on your exact setup, but generally you will need
to clone your server project, update the package.json file to use the
latest version of Parse Server, and the push the project.—
Reply to this email directly or view it on GitHub
https://github.com/ParsePlatform/parse-server/issues/873#issuecomment-192989394
.
Hmm it doesn't seem to work. This is the response I'm getting in the server (Image attached).
Here is my package.json:
{
"name": "parse-server-example",
"version": "2.1.4",
"description": "An example Parse API server using the parse-server module",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-server-example"
},
"license": "MIT",
"dependencies": {
"express": "~4.2.x",
"kerberos": "~0.0.x",
"parse": "~1.6.12",
"parse-server": "~2.1"
},
"scripts": {
"start": "node index.js"
},
"engines": {
"node": ">=4.1"
}
}

change the parse-server entry to be "2.1.4" and you should get the latest version. (after deploying)
Where is that? Where it says version?
In package.json you have something like:
"dependencies": {
...
"parse-server" : "~2.1"
Change the ~2.1 to 2.1.4 and re-deploy to make sure you get that version.
I'm getting the same 502 Bad Gateway Error. Here is my package.json. Can you check if I'm doing something wrong.
{
"name": "parse-server-example",
"version": "1.0.0",
"description": "An example Parse API server using the parse-server module",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-server-example"
},
"license": "MIT",
"dependencies": {
"express": "~4.2.x",
"kerberos": "~0.0.x",
"parse": "~1.6.12",
"parse-server": "~2.1.4"
},
"scripts": {
"start": "node index.js"
},
"engines": {
"node": ">=4.1"
}
}
On which port are you listening on parse? How is configured you AWS deployment? through elastic beanstalk?
Yes, I use the Parse Server Example and followed the directions. https://github.com/ParsePlatform/parse-server-example
Yeah updating does not work this way on aws
Did someone found a way to update parse server to 2.1.4 in AWS Beanstalk?
No. Still no luck. I'm still trying.
When I change to 2.1.4 within the package.json file, upload to elastic beanstalk and deploy, I get the following message:
The configuration file __MACOSX/parse-server-example/.ebextensions/._app.config in application version 2.1.4 contains invalid YAML or JSON. YAML exception: unacceptable character '' (0x0) special characters are not allowed in "
", position 0, JSON exception: Unexpected character () at position 0.. Update the configuration file.
Has anyone else got this problem in their AWS dashboard, or fixed it? I am trying to update in order to use the original Parse dashboard also!
When you first install parse server to EB, you give it a package.json with a version of Parse Server specified. EB runs npm install, and that installs that version of Parse Server to your instances.
Why would it be any different to update? Just change the version and deploy the same way you did initially, but with a different version.
I've tried it many times with a fresh install and it doesn't work. Always a 502 error
Sent from my iPhone
On Mar 15, 2016, at 3:00 PM, George Capote [email protected] wrote:
When you first install parse server to EB, you give it a package.json with a version of Parse Server specified. EB runs npm install, and that installs that version of Parse Server to your instances.
Why would it be any different to update? Just change the version and deploy the same way you did initially, but with a different version.
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
@capote I used this link to set it up, it was a shorter install than most I've seen. I don't recall having the option to specify a version number.
@prent To solve your issue. AWS has its own way for zipping files and building a package.
My favorite is : zip ../myapp.zip -r * .[^.]* inside the folder.
However I am not able to upgrade parse server by simply changing the package.json file. It gives me 502 error
@poojanjhaveri so if I download the package, unzip, edit and zip again it should work? I'm not fully sure I understand what you mean!
@prent yes that is correct. but when you zip it back. Use this command ^
@poojanjhaveri so that worked for the zip&upload unlike previous times, but it gives me a 502 bad gateway once it's running unfortunately. Have you experienced that before?
Just check the logs and see what the 502 is all about. And read my post fully--you specify the version number in a package.json _before_ you upload the package to EB. EB itself will simply install whatever you tell it to install in package.json.
@prent yes I have experienced that if you are trying to update parse server. So for now I just went with whatever was given in parse-server-example repository
@capote That's what I done, zipped it up and uploaded to EB. Unfortunately it still didn't work, I'll keep on playing around with it and see how it goes, for now I've just reverted back to the parse-server-example originally provided.
Has anyone checked the logs to see what the error is? "Didn't work" and "502" are nowhere near descriptive enough to be asking for help with on a public forum.
@capote here is what's in my logs.
From Nginx:
2016/03/16 17:09:50 [error] 24505#0: *5142 connect() failed (111: Connection refused) while connecting to upstream, client: IP-was-here, server: , request: "POST /parse/classes/_Installation HTTP/1.1", upstream: "http://127.0.0.1:8081/parse/classes/_Installation", host: "my-host-url-was-here"
The only thing I can see here is port 8081 is being used, but in index.js there's port 1337 (changed to 8081 also and re uploaded, but no change, so changed it back)
And from the node logs
/var/app/current/node_modules/parse-server/lib/requiredParameter.js:8
throw errorMessage;
^
You must provide a serverURL!npm ERR! Linux 4.1.17-22.30.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/node" "/opt/elasticbeanstalk/node-install/node-v4.3.0-linux-x64/bin/npm" "start"
npm ERR! node v4.3.0
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start:node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node index.js'.
npm ERR! This is most likely a problem with the parse-server-example package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index.js
npm ERR! You can get their info via:
npm ERR! npm owner ls parse-server-example
npm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:
npm ERR! /var/app/current/npm-debug.log[email protected] start /var/app/current
node index.js
This is my first time using node or EB, trying my best to learn as I go.
You must provide a serverURL!
Did you make sure to give EB all of the environment variables that Parse Server needs, including serverURL?
You can see how these things get set in node from environment variables in index.js of your parse-server-example. process.env retrieves environment variables.
I'm having all the issues above with regards to the nginx 502 error upon updating AEB with the parse app example, but I was able to fix the zip issue that @prent was having on my mac by running the following in terminal on the zip I made:
zip -d my-file-name.zip __MACOSX/\*
OK, I've finally figured out the 502 issue on my end...when I created the .zip, I zipped up the parent folder...in order for AEB to work with a new version, you have to zip up the files in the root...so that when unzipped you get the files and not a folder containing the files.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deployment.source.html#using-features.deployment.source.gui
So did you get it to work with v2.1.4 or just uploaded? I tried that on
2.1.4 and received the same error.
On Thu, Mar 17, 2016 at 12:26 AM Cory Shaw [email protected] wrote:
OK, I've finally figured out the 502 issue on my end...when I created the
.zip, I zipped up the parent folder...in order for AEB to work with a new
version, you have to zip up the files in the root...so that when unzipped
you get the files and not a folder containing the files.http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deployment.source.html#using-features.deployment.source.gui
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/ParsePlatform/parse-server/issues/873#issuecomment-197690460
@aaadesignstudios me also.
@capote these are my environment variables:
APP_ID
DATABASE_URI
FILE_KEY
MASTER_KEY
NODE_ENV
PARSE_MOUNT
I didn't change anything in the old package except for the version number, so I'm kinda baffled. Should I need to add in Server URL, even though it wasn't there originally?
Does the index.js file have a default set for SERVER_URL? Does it try to access process.env.SERVER_URL? Just look through that file, it should be visible what is getting set and what is required.
When I instantiate ParseServer in my app, it takes in serverURL among other things from the environment.
Yeah mine is working with 2.1.4. I figured it out by looking at the logs. In my logs npm complained about not being able to find package.json, which led me to fixing the zip issue. What do your logs say?
If anything, @prent, you might want to re-clone the server example and try again. As long as your AEB Environment Properties are specified properly via the Beanstalk Environment GUI, they trickle into all the vars in index.js.
@capote checked it out and nothing in there!
// Example express application adding the parse-server module to expose Parse
// compatible API routes.var express = require('express');
var ParseServer = require('parse-server').ParseServer;var databaseUri = process.env.DATABASE_URI || process.env.MONGOLAB_URI
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
fileKey: process.env.FILE_KEY || 'noFileKey',
masterKey: process.env.MASTER_KEY || 'myMasterKey'
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKeyvar app = express();
// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a web site.');
});var port = process.env.PORT || 1338;
app.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});
@coryshaw I think I might start from scratch, but I'd love to know what it was causing the annoyance!
Hi all,
I've been dealing with this problem during the last hours and found a lot of problems, started from scratch a lot of times and tried to modify the AWS used example with 'eb' in terminal.
After all the fighting (and a lot of time outs in deploys) with Elastic Beanstalk I've achieved nothing. Why don't we create the required files (app.json, index.json and packacge.json) between all of us and those that have the server running may find the problem. I start posting my version of these files and what I have in the Configuration at EB.
app.json:
{
"name": "Parse Server Example",
"description": "An example Parse API server using the parse-server module",
"repository": "https://github.com/ParsePlatform/parse-server-example",
"logo": "https://avatars0.githubusercontent.com/u/1294580?v=3&s=200",
"keywords": ["node", "express", "parse"],
"env": {
"PARSE_MOUNT": {
"description": "Configure Parse API route.",
"value": "/parse"
},
"APP_ID": {
"description": "A unique identifier for your app.",
"value": "myAppId"
},
"MASTER_KEY": {
"description": "A key that overrides all permissions. Keep this secret.",
"value": "myMasterKey"
},
"SERVER_URL": {
"description": "URL to connect to your Heroku instance (update with your app's name + PARSE_MOUNT)",
"value": "myURL"
},
"FILE_KEY": {
"description": "The Parse file key",
"value": "myFileKey"
},
"CLIENT_KEY": {
"description": "The Parse client key",
"value": "myClientKey"
},
"REST_KEY": {
"description": "The Parse REST key",
"value": "myRestKey"
}
},
"image": "heroku/nodejs",
"addons": ["mongolab"]
}
index.js:
`
// Example express application adding the parse-server module to expose Parse
// compatible API routes.
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var databaseUri = process.env.DATABASE_URI;
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
}
var api = new ParseServer({
databaseURI: process.env.DATABASE_URI,
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/main.js',
appId: process.env.APP_ID || '',
fileKey: process.env.FILE_KEY || '',
masterKey: process.env.MASTER_KEY || '',
clientKey: process.env.CLIENT_KEY || '',
restAPIKey: process.env.REST_KEY || '',
serverURL: process.env.SERVER_URL || ''
});
// Client-keys like the javascript key or the .NET key are not necessary with parse-server
// If you wish you require them, you can set them as options in the initialization above:
// javascriptKey, restAPIKey, dotNetKey, clientKey
var app = express();
// Serve the Parse API on the /parse URL prefix
var mountPath = process.env.PARSE_MOUNT || '/parse';
app.use(mountPath, api);
// Parse Server plays nicely with the rest of your web routes
app.get('/', function(req, res) {
res.status(200).send('I dream of being a web site!');
});
var port = process.env.PORT || 1337;
app.listen(port, function() {
console.log('parse-server-example running on port ' + port + '.');
});
`
package.json:
{
"name": "parse-server-example",
"version": "2.1.4",
"description": "An example Parse API server using the parse-server module",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-server-example"
},
"license": "MIT",
"dependencies": {
"express": "~4.2.x",
"kerberos": "~0.0.x",
"parse": "~1.6.12",
"parse-server": "~2.1.4"
},
"scripts": {
"start":"node index.js"
},
"engines": {
"node": ">=4.1"
}
}
EB_config:

Best regards,
Mauro
@prent like I said, my index.js passes a serverURL to the Parse Server via that object that its constructor takes. Looks like Mauro's passes in even more information. That error message you showed us from your logs indicates that it wants a serverURL, so put that in, try it out again, and if it works, great! If it doesn't work, check the logs again, read them carefully, and just try to address the issues it gives.
@coryshaw @poojanjhaveri Thanks guys, in case it helps anyone else, your zip ../myapp.zip -r * .[^.]* command and the pointer to the doc solved my issue.
My logs indicated a permissions issue, and this solution makes complete sense.
Do we have any news on this issue?
I have a similar problem on this. When I start my parse server with npm I get this error when login in the parse-dahsboard and I can't see anything:
error: Uncaught internal server error. { Error: connect ECONNREFUSED 95.85.16.13:27017
at Object.exports._errnoException (util.js:1036:11)
at exports._exceptionWithHostPort (util.js:1059:20)
at TCPConnectWrap.afterConnect as oncomplete
name: 'MongoError',
message: 'connect ECONNREFUSED 95.85.16.13:27017' } Error: connect ECONNREFUSED 95.85.16.13:27017
at Object.exports._errnoException (util.js:1036:11)
at exports._exceptionWithHostPort (util.js:1059:20)
at TCPConnectWrap.afterConnect as oncomplete
Anything on that?
I had coryshaw issue, my problem was that I was compressing the hidden files, after zipping by selecting only the visible ones it worked :-)
I had the same issue. The reason is that when you download the currently deployed version from dashboard, modify the and zip it again, Apple will create some hidden file like __MACOSX along with the zip file. In order to resolve this, use this command to zip the folder
zip -r -X archive_name.zip folder_to_compress
Then upload this zip file to the dashboard again
Most helpful comment
I'm having all the issues above with regards to the nginx 502 error upon updating AEB with the parse app example, but I was able to fix the zip issue that @prent was having on my mac by running the following in terminal on the zip I made:
zip -d my-file-name.zip __MACOSX/\*