Parse-server: Crashes on Heroku, error code H10

Created on 22 Apr 2016  Β·  19Comments  Β·  Source: parse-community/parse-server

Just deployed to Heroku and I'm getting this crash error:

2016-04-22T01:31:53.925057+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gemparseservertest.herokuapp.com request_id=63645159-2ce4-44ba-aa3f-344790b58a46 fwd="73.71.103.1" dyno= connect= service= status=503 bytes=
2016-04-22T01:31:55.206156+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gemparseservertest.herokuapp.com request_id=4a0ed7ae-c0a3-48bf-ad25-bdce23f6edf2 fwd="73.71.103.1" dyno= connect= service= status=503 bytes=
2016-04-22T01:32:17.138695+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gemparseservertest.herokuapp.com request_id=6d86e071-6315-44c3-8046-f6f35b7ab28e fwd="73.71.103.1" dyno= connect= service= status=503 bytes=
2016-04-22T01:33:14.268016+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gemparseservertest.herokuapp.com request_id=81f44885-3e42-40e5-8231-d0895e8359fa fwd="73.71.103.1" dyno= connect= service= status=503 bytes=
2016-04-22T01:33:55.180903+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gemparseservertest.herokuapp.com request_id=e067c524-f43f-4a94-a515-71aa6b46af15 fwd="73.71.103.1" dyno= connect= service= status=503 bytes=
2016-04-22T01:40:34.827054+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gemparseservertest.herokuapp.com request_id=aaa44123-7f18-46a5-870c-0f66c323544e fwd="73.71.103.1" dyno= connect= service= status=503 bytes=
2016-04-22T01:40:35.848889+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gemparseservertest.herokuapp.com request_id=6a3bc5a2-919d-411a-a680-38586186abc9 fwd="73.71.103.1" dyno= connect= service= status=503 bytes=

I was following the instructions here:
https://devcenter.heroku.com/articles/deploying-a-parse-server-to-heroku

After I forked the repo and connected to Heroku in the "Connect to Github" section, it crashed immediately.

Last commit from forked repo: 6e9529f81c081d5967aa0ba5126e25591cd528f2
Exposes the loggerAdapter as log to Cloud Functions and Triggers (#1565)

Any other information I can provide?

Most helpful comment

THIS SOLUTION IS FOR GO

When you deploy an app through heroku, it does not allow you to specify the port number.
In other words, you can not specify your web service's port number as 8000 or something else, heroku decides the port number in runtime.
so, you can not use the following code:

    log.Fatal(http.ListenAndServe(":8000", router))

What you can do is, getting the runtime port of heroku.
In short, just use the following code:

    log.Fatal(http.ListenAndServe(":" + os.Getenv("PORT"), router))

All 19 comments

Here is the build log.
I'm not too familiar with Heroku or Node, so any help in hunting would be really appreciated.

-----> Using set buildpack heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_ENV=production
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  >=4.3
       engines.npm (package.json):   unspecified (use default)

       Resolving node version >=4.3 via semver.io...
       Downloading and installing node 5.10.1...
       Using default npm version: 3.8.3
-----> Restoring cache
       Loading 2 from cacheDirectories (default):
       - node_modules
       - bower_components (not cached - skipping)
-----> Building dependencies
       Pruning any extraneous modules
       Installing node modules (package.json)
-----> Caching build
       Clearing previous node cache
       Saving 2 cacheDirectories (default):
       - node_modules
       - bower_components (nothing to cache)
-----> Build succeeded!
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       β”œβ”€β”€ [email protected]
       └── [email protected]

-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 20.3M
-----> Launching...
       Released v13
       https://gemparseservertest.herokuapp.com/ deployed to Heroku

Jumped on the machine (heroku bash) and tried building manually with node ./bin/parse-server. Here is the error:

~ $ node ./bin/parse-server
module.js:341
    throw err;
    ^

Error: Cannot find module '../lib/cli/parse-server'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/app/bin/parse-server:3:1)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

From what I can tell, the desired module is in ../src/cli/parse-server, not ../lib/cli/. Perhaps I'm doing something wrong? I'm not entirely sure who/where is calling that dir to test.

That's because the lib folder is not under version control and you're deploying a fork of the repo directly to heroku, which is not the preferred way to deploy parse-server. Heroku recommendes using parse-server-example. Please look at the recommended deployment in the documentation (README and wiki)

Thanks a ton, deploying parse-server-example fixed it!

Hey guys, im having a similar problem after deploying the parse-server ago. trying to login/ signup and I keep getting this

2016-04-23T21:20:33.968881+00:00 heroku[router]: at=info method=POST path="/parse/1/login" host=intense-hollows-60991.herokuapp.com request_id=5b792331-09c2-49b1-aa4c-48bd18f8f161 fwd="94.11.105.106" dyno=web.1 connect=1ms service=4ms status=403 bytes=466

That seems very different from the problem I was facing. Do you have the output from heroku logs? It seems like a config issue, have you had any success searching for 'heroku 403 error' or the like?

Yes from the heroku logs

2016-04-23T22:25:04.118548+00:00 heroku[router]: at=info method=POST path="/parse/1/users" host=intense-hollows-60991.herokuapp.com request_id=e546e91e-e45b-4e1d-a2c0-2bf7bd77ff1c fwd="94.11.105.106" dyno=web.1 connect=0ms service=8ms status=403 bytes=466

I can’t pinpoint any issues with the config as I have an android app that points to the same endpoints and that works

On 24 Apr 2016, at 00:50, aaronbannin [email protected] wrote:

That seems very different from the problem I was facing. Do you have the output from heroku logs? It seems like a config issue, have you had any success searching for 'heroku 403 error' or the like?

β€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/parse-server/issues/1589#issuecomment-213853853

Have you double checked your API keys? A 403 seems to imply a permissions issue.

What does the log look like for a successful transaction from your Android app?

The request URL seems off with /parse/1, is that your mountPath?

Parse.serverURL = 'https://intense-hollows-60991.herokuapp.com/parse/'

I didn’t add that manually. I believe that come from Parse.User sdk.

On 24 Apr 2016, at 20:45, Florent Vilmart [email protected] wrote:

The request URL seems off with /parse/1, is that your mountPath?

β€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/parse-server/issues/1589#issuecomment-214027351

I just checked the SDK and there don't seem to be any places where the SDK would add a trailing 1 to your server URL... If you run a query, does the path look the same?

Hmm.. Please could you have a look @ this

http://www.mobileparadigm.co.uk/urls/cft_access/services/cft/ http://www.mobileparadigm.co.uk/urls/cft_access/services/cft/

view source and click the ft_main.js

you will find

Parse.User.signUp(username, password, { ACL: new Parse.ACL() }, {
success: function(user) {
new ManageTodosView();
self.undelegateEvents();
delete self;
},
etc

I havne’t appended anything to the serverUrl

On 24 Apr 2016, at 20:51, Florent Vilmart [email protected] wrote:

I just checked the SDK and there don't seem to be any places where the SDK would add a trailing 1 to your server URL... If you run a query, does the path look the same?

β€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/parse-server/issues/1589#issuecomment-214028053

Seems that you're using an outdated version of parse.js, can you try with 1.6.14? I tried injecting the code into your app and still face an unauthorized error...

and example is
2016-04-24T19:51:22.109760+00:00 heroku[router]: at=info method=POST path="/parse/classes/BibleStudy" host=intense-hollows-60991.herokuapp.com request_id=8352a1e7-1729-4283-aac6-87fd073c3006 fwd="94.11.105.106" dyno=web.1 connect=1ms service=1285ms status=200 bytes=2324

On 24 Apr 2016, at 20:27, aaronbannin [email protected] wrote:

Have you double checked your API keys? A 403 seems to imply a permissions issue.

What does the log look like for a successful transaction from your Android app?

β€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub https://github.com/ParsePlatform/parse-server/issues/1589#issuecomment-214025606

I tried that version and I get TypeError: Parse.Collection is undefined..Looked @ the source code for both versions and everything to do with Parse Backbone is non existent in 1.6.14, even parse-lastest

On 24 Apr 2016, at 21:04, Florent Vilmart [email protected] wrote:

1.6.14

THIS SOLUTION IS FOR GO

When you deploy an app through heroku, it does not allow you to specify the port number.
In other words, you can not specify your web service's port number as 8000 or something else, heroku decides the port number in runtime.
so, you can not use the following code:

    log.Fatal(http.ListenAndServe(":8000", router))

What you can do is, getting the runtime port of heroku.
In short, just use the following code:

    log.Fatal(http.ListenAndServe(":" + os.Getenv("PORT"), router))

Thanks a ton, deploying parse-server-example fixed it!

How you did this? Can you explain little bit. I am facing this problem also.

@chowdhuryshakur that was 4 years ago, but looks like this guidance helped:

Please look at the recommended deployment in the documentation (README and wiki)

Not sure what the current deployment and docs look like.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ShawnBaek picture ShawnBaek  Β·  4Comments

darkprgrmmr picture darkprgrmmr  Β·  4Comments

carjo422 picture carjo422  Β·  3Comments

ViolentCrumble picture ViolentCrumble  Β·  3Comments

mohmagdy picture mohmagdy  Β·  3Comments