skip to Main Content

I am trying to run parse dashboard via the following docker-compose.yml:

version: '3'
services:

  mongo:
    image: mongo
    ports:
      - 27017:27017
    volumes:
      - ./data-db:/data/db

  parse:
    image: parseplatform/parse-server
    ports:
      - 1337:1337
    links:
      - mongo
    environment:
      - PARSE_SERVER_APPLICATION_ID=yourappid
      - PARSE_SERVER_MASTER_KEY=yourmasterkey
      - PARSE_SERVER_DATABASE_URI=mongodb://mongo:27017/dev
      - PARSE_SERVER_START_LIVE_QUERY_SERVER=1
#      - PARSE_SERVER_LIVE_QUERY={"classNames":["people","monitor"]}

  dashboard:
    image: parseplatform/parse-dashboard
    ports:
      - 4040:4040
    environment:
      - PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse
      - PARSE_DASHBOARD_APP_ID=yourappid
      - PARSE_DASHBOARD_MASTER_KEY=yourmasterkey
      - PARSE_DASHBOARD_APP_NAME=appname
      - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=1
      - PARSE_DASHBOARD_USER_ID=admin
      - PARSE_DASHBOARD_USER_PASSWORD=admin

After running this file via the command:

docker-compose -f ./docker-compose.yml up -d

I am going to the http://localhost:4040/login where I’ve put admin as username and admin as password.

After that, I will be redirected to http://localhost:4040/apps/appname/browser which is just an empty page.

enter image description here

The interesting part is that if I am using the inspect elements I will get some errors for some unknown reason:

enter image description here

Does any of you have any idea what I did wrong? The interesting part is that sometimes if I am refreshing the page for a while it will work. But just sometimes.

Some logs from terminal:

Recreating docker_dashboard_1 ... done
Starting docker_mongo_1       ... done
Recreating docker_parse_1     ... done
Attaching to docker_mongo_1, docker_dashboard_1, docker_parse_1
dashboard_1  | The dashboard is now available at http://0.0.0.0:4040/
mongo_1      | chown: changing ownership of '/data/db': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/mongod.lock': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/journal': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/journal/WiredTigerLog.0000000001': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/journal/WiredTigerPreplog.0000000001': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/journal/WiredTigerPreplog.0000000002': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/WiredTiger.lock': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/WiredTiger': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/WiredTiger.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/WiredTiger.turtle': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/WiredTigerHS.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/sizeStorer.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/_mdb_catalog.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/storage.bson': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/collection-0--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/index-1--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/collection-2--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/index-3--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/collection-4--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/index-5--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/index-6--4357951009205190989.wt': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/diagnostic.data': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/diagnostic.data/metrics.2022-02-22T16-34-04Z-00000': Operation not permitted
mongo_1      | chown: changing ownership of '/data/db/diagnostic.data/metrics.interim': Operation not permitted
docker_mongo_1 exited with code 1
parse_1      | warn: DeprecationWarning: The Parse Server option 'directAccess' default will change to 'true' in a future version. Additionally, the environment variable 'PARSE_SERVER_ENABLE_EXPERIMENTAL_DIRECT_ACCESS' will be deprecated and renamed to 'PARSE_SERVER_DIRECT_ACCESS' in a future version; it is currently possible to use either one.
parse_1      | warn: DeprecationWarning: The Parse Server option 'enforcePrivateUsers' default will change to 'true' in a future version.
parse_1      | allowClientClassCreation: true
parse_1      | allowCustomObjectId: false
parse_1      | appId: yourappid
parse_1      | cacheMaxSize: 10000
parse_1      | cacheTTL: 5000
parse_1      | collectionPrefix: 
parse_1      | customPages: {}
parse_1      | databaseURI: mongodb://mongo:27017/dev
parse_1      | directAccess: false
parse_1      | emailVerifyTokenReuseIfValid: false
parse_1      | enableAnonymousUsers: true
parse_1      | enableExpressErrorHandler: false
parse_1      | enforcePrivateUsers: false
parse_1      | expireInactiveSessions: true
parse_1      | fileUpload: {"enableForAnonymousUser":false,"enableForPublic":false,"enableForAuthenticatedUser":true}
parse_1      | graphQLPath: /graphql
parse_1      | host: 0.0.0.0
parse_1      | idempotencyOptions: {"ttl":300,"paths":[]}
parse_1      | logsFolder: ./logs
parse_1      | masterKey: ***REDACTED***
parse_1      | masterKeyIps: []
parse_1      | maxUploadSize: 20mb
parse_1      | mountGraphQL: false
parse_1      | mountPath: /parse
parse_1      | mountPlayground: false
parse_1      | objectIdSize: 10
parse_1      | pages: {"enableRouter":false,"enableLocalization":false,"localizationFallbackLocale":"en","placeholders":{},"forceRedirect":false,"pagesPath":"./public","pagesEndpoint":"apps","customUrls":{},"customRoutes":[]}
parse_1      | playgroundPath: /playground
parse_1      | port: 1337
parse_1      | preserveFileName: false
parse_1      | preventLoginWithUnverifiedEmail: false
parse_1      | protectedFields: {"_User":{"*":["email"]}}
parse_1      | revokeSessionOnPasswordReset: true
parse_1      | scheduledPush: false
parse_1      | security: {"enableCheck":false,"enableCheckLog":false}
parse_1      | sessionLength: 31536000
parse_1      | startLiveQueryServer: true
parse_1      | verifyUserEmails: false
parse_1      | jsonLogs: false
parse_1      | verbose: false
parse_1      | level: undefined
parse_1      | serverURL: http://localhost:1337/parse
parse_1      | 
parse_1      | [1] parse-server running on http://localhost:1337/parse
parse_1      | info: Parse LiveQuery Server started running
parse_1      | error: Uncaught internal server error. getaddrinfo EAI_AGAIN mongo {"name":"MongoServerSelectionError","reason":{"type":"Single","setName":null,"maxSetVersion":null,"maxElectionId":null,"servers":{},"stale":false,"compatible":true,"compatibilityError":null,"logicalSessionTimeoutMinutes":null,"heartbeatFrequencyMS":10000,"localThresholdMS":15,"commonWireVersion":null},"stack":"MongoServerSelectionError: getaddrinfo EAI_AGAIN mongon    at Timeout._onTimeout (/parse-server/node_modules/mongodb/lib/core/sdam/topology.js:437:30)n    at listOnTimeout (internal/timers.js:557:17)n    at processTimers (internal/timers.js:500:7)"}
parse_1      | MongoServerSelectionError: getaddrinfo EAI_AGAIN mongo
parse_1      |     at Timeout._onTimeout (/parse-server/node_modules/mongodb/lib/core/sdam/topology.js:437:30)
parse_1      |     at listOnTimeout (internal/timers.js:557:17)
parse_1      |     at processTimers (internal/timers.js:500:7) {
parse_1      |   reason: TopologyDescription {
parse_1      |     type: 'Single',
parse_1      |     setName: null,
parse_1      |     maxSetVersion: null,
parse_1      |     maxElectionId: null,
parse_1      |     servers: Map(1) { 'mongo:27017' => [ServerDescription] },
parse_1      |     stale: false,
parse_1      |     compatible: true,
parse_1      |     compatibilityError: null,
parse_1      |     logicalSessionTimeoutMinutes: null,
parse_1      |     heartbeatFrequencyMS: 10000,
parse_1      |     localThresholdMS: 15,
parse_1      |     commonWireVersion: null
parse_1      |   }
parse_1      | }
docker_parse_1 exited with code 1

3

Answers


  1. When using the dashboard in docker you run in development mode, --dev and PARSE_DASHBOARD_TRUST_PROXY: 1. It’s recommend to run this behind a reverse proxy when deployed. You can look at my repo for examples:

        dashboard:
            image: parseplatform/parse-dashboard:4.0.0
            environment:
                PARSE_DASHBOARD_TRUST_PROXY: 1
                PARSE_DASHBOARD_COOKIE_SESSION_SECRET: AB8849B6-D725-4A75-AA73-AB7103F0363F # This should be constant across all deployments on your system
                MOUNT_PATH: /dashboard # This needs to be exactly what you plan it to be behind the proxy, i.e. If you want to access cs.uky.edu/dashboard it should be "/dashboard"
            command: parse-dashboard --dev
            volumes:
                - ./dashboard/parse-dashboard-config.json:/src/Parse-Dashboard/parse-dashboard-config.json
            ports:
                - 127.0.0.1:4040:4040
            depends_on:
                - parse
    
    Login or Signup to reply.
  2. you cant use PARSE_DASHBOARD_SERVER_URL as localhost. try you internal IP(starts with 192) or public IP. It will work
    eployed.

    dashboard:
        image: parseplatform/parse-dashboard:4.0.0
        environment:
            PARSE_DASHBOARD_SERVER_URL=http://[other intenal / public IP]:1337/parse
    
    Login or Signup to reply.
  3. It seems that the Cross-Origin error is the problem.

    There are a few issues similar to yours on the GitHub Parse repository, like this one. Browsing more I found this issue where there are some hints. I guess that you can solve your problem as suggested in the issue:

    The error message is explicit about the issue that the
    Access-Control-Allow-Origin header is missing in the preflight
    response sent from Parse Server. Can you log and post the preflight
    response from Parse Server to verify that?

    You can also try to:

    • explicitly set the server IP address instead of localhost in the serverURL configuration
    • set PARSE_SERVER_ALLOW_ORIGIN to the specific domain instead of the wildcard *

    I think that just setting PARSE_SERVER_ALLOW_ORIGIN in your environment section in your docker-compose.yml may solve the problem, but if it doesn’t you can try with the specific URL as suggested.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search