Skip to content

Parse Dashboard with Heroku Server unreachable #527

Closed

Description

@PauloxD

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Dashboard!

  • [ YEP] You're running version >=1.0.18 of Parse Dashboard.
  • [YEP ] You're running version >=2.2.18 of Parse Server.
  • [TO THE BEST OF MY KNOWLEDGE ] You've searched through existing issues. Chances are that your issue has been reported or resolved before.

Environment Setup

Hi,

I have searched through the listed issues, trying various solutions but nothing I have tried seems to work.

Okay so, I have a Parse Server which is up an running on Heroku, using the MongoDB add on. This part works absolutely fine. I have setup the config vars in Heroku using the process.env parameters

Trying to use the Parse Dashboard is where the problems occur. I have created a new app on Heroku and am trying to point it at the the app. I'm not experienced, in anyway with server hosting etc, so please bare with me. I believe I am using it as 'middleware'

The setup for the Dashboard app index.js file looks as such:

var express = require('express');
var ParseDashboard = require('parse-dashboard');
var path = require('path');

var allowInsecureHTTP = process.env.PARSE_DASHBOARD_ALLOW_INSECURE_HTTP || 'true'

var dashboard = new ParseDashboard({
  apps: [
    {
      appId: process.env.PARSE_DASHBOARD_APP_ID || 'myAppId',
      masterKey: process.env.PARSE_DASHBOARD_MASTER_KEY || 'myMasterKey',
      serverURL: process.env.PARSE_DASHBOARD_SERVER_URL || 'http://localhost:1337/parse',
      appName: process.env.PARSE_DASHBOARD_APP_NAME || 'MyApp',
      javascriptKey: process.env.PARSE_DASHBOARD_JAVASCRIPT_KEY || 'NOT USED',
      production: process.env.PARSE_DASHBOARD_PRODUCTION || 'true'
    },
  ],
  users: [
  {
    user: process.env.PARSE_DASHBOARD_USER_ID || 'user1',
    pass: process.env.PARSE_DASHBOARD_USER_PASSWORD || 'pass'
    },
  ],

}, allowInsecureHTTP);

var app = express();
app.enable('trust proxy');

// make the Parse Dashboard available at /
app.use('/', dashboard);

var port = process.env.PORT || 4040;
var httpServer = require('http').createServer(app);
httpServer.listen(port, function() {
  console.log('parse-dashboard-example running on port ' + port + '.');
});

The code compiles fine and is pushed to the git repo on my Heroku application
However, when I click the open app button, I get the following screen

screen shot 2016-09-07 at 13 17 41

It says the server is unreachable

Steps to reproduce

I'm not too sure how to reproduce - I have a Parse Server running on MongoDB through Heroku on it's own application
I have the Parse Dashboard running on it's own application and I am trying to point it at the database

Logs/Trace

Note: If you get a browser JS error please run npm run dev. This will provide source maps and a much more useful stack trace.

2016-09-07T12:17:32.400889+00:00 heroku[router]: at=info method=GET path="/" host=dashboard-miref.herokuapp.com request_id=590d7b71-37c7-435a-a7b2-ad8081394fe5 fwd="31.49.28.44" dyno=web.1 connect=0ms service=14ms status=304 bytes=146
2016-09-07T12:17:32.438191+00:00 heroku[router]: at=info method=GET path="/bundles/dashboard.bundle.js" host=dashboard-miref.herokuapp.com request_id=5f6c2186-4e35-4290-8b7c-f9703d1d86ec fwd="31.49.28.44" dyno=web.1 connect=0ms service=7ms status=304 bytes=240
2016-09-07T12:17:32.500089+00:00 heroku[web.1]: Process exited with status 143
2016-09-07T12:17:32.662113+00:00 heroku[router]: at=info method=GET path="/parse-dashboard-config.json" host=dashboard-miref.herokuapp.com request_id=efe2f13b-084e-4732-b138-5d39740cb9aa fwd="31.49.28.44" dyno=web.1 connect=1ms service=6ms status=200 bytes=484
2016-09-07T12:17:35.745295+00:00 heroku[router]: at=info method=GET path="/bundles/sprites.svg" host=dashboard-miref.herokuapp.com request_id=aeec261f-f517-448f-850a-3c3ba8cbff48 fwd="31.49.28.44" dyno=web.1 connect=1ms service=3ms status=304 bytes=239

Activity

  1. flovilmart commented on Sep 7, 2016

    @flovilmart
    Contributor

    serverURL: process.env.PARSE_DASHBOARD_SERVER_URL || 'http://localhost:1337/parse',

    You should set the public server URL for your parse-server, now it looks like it's pointing to 'http://localhost:1337/parse'

  2. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    I have setup a config variable in the dashboard settings section that points to the server's url

  3. flovilmart commented on Sep 7, 2016

    @flovilmart
    Contributor

    Not sure how heroku works, but it's very likely that the contents of that variable don't point to the right server.

    If you try to replace that whole line with:

    serverURL: 'http://<my-parse-server-url>'
    
  4. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    I have also just tried hard coding it.

    It didn't like that either

  5. flovilmart commented on Sep 7, 2016

    @flovilmart
    Contributor

    Does it work locally connecting with your remote heroku server? It's very unlikely to be a problem with parse-dashboard itself but a configuration error.

  6. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    To be honest, I haven't tried and am unsure on how to do it. If you would like me to try, I am happy to do so, but could you give me some instruction (please not just a link to the readme file)

  7. flovilmart commented on Sep 7, 2016

    @flovilmart
    Contributor

    You haven't tried to run parse-dashboard locally? Is your parse-server running and accessible?

  8. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    No. I simply downloaded the repo. updated the information and pushed it to my Heroku application.
    The Parse Server works fine, I can send and receive information from it, on both REST and iOS formats

  9. flovilmart commented on Sep 7, 2016

    @flovilmart
    Contributor

    So if the parse-server work fine, this is very likely that the URL is wrong. I can't help more than that without seeing the configuration.

    Also, everything you need to know to run/deploy should be in the README.

  10. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    Here is a screenshot of the config variables

    Update: Removed Screen shot as it showed some information that I didn't want public

  11. flovilmart commented on Sep 7, 2016

    @flovilmart
    Contributor

    You should use HTTPS to connect to your heroku server, as you're transmitting the masterKey over HTTP, anyone could be able to steal it :)

  12. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    I read somewhere that this is not required as Heroku hides itself. But I will try changing it to HTTPS and let you know

  13. PauloxD commented on Sep 7, 2016

    @PauloxD
    Author

    Um I feel like a complete dimwit now,

    Simply changing the url to https: worked like a charm. Thank you Sir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions