MongoDB Charts- Cannot Access MongoDB Charts by opening a web browser

1,704 views
Skip to first unread message

Nikita Chauhan

unread,
Aug 13, 2018, 7:19:19 AM8/13/18
to mongodb-user
I have completed all the steps but stuck on the final one - Launch the Charts web application.
Unable to access the charts dashboard. I have been trying to hit the IP of my server and not able to access it through to name of the container too. Need more specific guideline to troubleshoot this situation.

Tom Hollander

unread,
Aug 16, 2018, 2:37:21 AM8/16/18
to mongodb-user
Hi Nikita - 

Sorry to hear you are having problems. Have you looked at the troubleshooting tips at https://docs.mongodb.com/charts/current/installation/#troubleshooting

Can you please verify that the Docker service is running, and obtain the service logs as described in the documentation. If you can't figure out the problem from the logs, please copy them into this thread, making sure to remove any sensitive information should it be present.

thanks
Tom 

Volkan

unread,
Aug 16, 2018, 4:33:28 PM8/16/18
to mongodb-user
Hi Tom,

I'm having the same issue. Here is the log output:

mongodb-charts_charts.1.pcr17y3xc236@linuxkit-025000000001    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.pcr17y3xc236@linuxkit-025000000001    |  ✔ tokens
mongodb-charts_charts.1.pcr17y3xc236@linuxkit-025000000001    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.pcr17y3xc236@linuxkit-025000000001    |  ✔ stitchConfig
mongodb-charts_charts.1.pcr17y3xc236@linuxkit-025000000001    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.pcr17y3xc236@linuxkit-025000000001    |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://127.0.0.1:27017. Too many failed attempts. Last error: failed to connect to server [127.0.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]

I can connect to mongodb from a terminal in my Mac but charts connect connect.

Thanks for your help.

fmp...@aggies.ncat.edu

unread,
Aug 16, 2018, 4:33:29 PM8/16/18
to mongodb-user
Hello all I am having issues with getting my MongoDB Charts to go past the login page after I put in the creds. I am running docker ce version 18.03 and am running mongodb in a docker container from dockerhub with bind_ip_all.
My docker0 interface is 172.17.0.2 so my secret is

echo "mongodb://172.17.0.1" | docker secret create charts-mongodb-uri -

Both the mongodb container and charts container is running from my linux host machine with the docker CE installed on it.


In the charts-docker-compose yml file I have the following:
version: "3.3"

services:
  charts:
    image: quay.io/mongodb/charts:v0.9.0
    hostname: charts
    ports:
      # host:container port mapping. If you want MongoDB Charts to be
      # reachable on a different port on the docker host, change this
      # to <port>:80, e.g. 8888:80.
      - 8889:80
    volumes:
      - keys:/mongodb-charts/volumes/keys
      - db-certs:/mongodb-charts/volumes/db-certs
    environment:
      # This environment variable controls the built-in support widget and
      # metrics collection in MongoDB Charts. To disable both, set the value
      # to "off". The default is "on".
      CHARTS_SUPPORT_WIDGET_AND_METRICS: "on"
      # Directory where you can upload SSL certificates (.pem format) which
      # should be considered trusted self-signed or root certificates when
      # Charts is accessing MongoDB servers with ?ssl=true
      SSL_CERT_DIR: /mongodb-charts/volumes/db-certs
    networks:
      - backend
    secrets:
      - charts-mongodb-uri

networks:
  backend:

volumes:
  keys:
  db-certs:

secrets:
  charts-mongodb-uri:
    external: true


On the docker host I am connecting to the URL via port 8889 using the url of http://localhost:8889/   I also tried http://127.0.0.1:8889 which works fine with no problem. However my issue is when I input the email and password into its field and click login button, nothing happens. From the charts-cli add user command I am adding a user with the UserAdmin role. It seems the only two user options are UserAdmin and User anyways.

docker exec -it $(docker container ls --filter name=_charts -q) charts-cli add-user --first-name "tim" --last-name "jones" --email "pa...@trail.com" --password "changepass" --role "UserAdmin"



Log file shows this which looks good:

mongodb-charts_charts.1.qb2ighrectaio@work    |  encryptionKeyPath

mongodb-charts_charts.1.qb2ighrectaio@work    |  tokens

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchConfigTemplate

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchConfig

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchConfigWritten (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  mongoDBReachable (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchChildProcess

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchServerRunning (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchAdminCreated (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchUnconfigured (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchSetup ({ stitchBaseUrl: 'http://localhost:8080',  stitchAppId: '5b758bdccc18890011b1082d',  stitchClientAppId: 'mongodb-charts-hrpkg',  stitchGroupId: '5b5b2bdccc18890011b13c6a' })

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchServerQuitting (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  webConfigWritten (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  stitchServerQuit (true)

mongodb-charts_charts.1.qb2ighrectaio@work    |  supervisorStarted (true)




The charts-cli.log file looks good too:


root@charts:/# cat /mongodb-charts/logs/charts-cli.log
2018-08-16T19:34:00.245+00:00 INFO  called charts-cli startup with arguments {"_":["startup"],"debug":false,"help":false,"version":false,"d":"/mongodb-charts","directory":"/mongodb-charts","$0":"mongodb-charts/bin/charts-cli.js"}
2018-08-16T19:34:00.271+00:00 INFO  encryptionKeyPath task success
2018-08-16T19:34:00.324+00:00 INFO  tokens task success
2018-08-16T19:34:00.326+00:00 INFO  stitchConfigTemplate task success
2018-08-16T19:34:00.330+00:00 INFO  stitchConfig task success
2018-08-16T19:34:00.341+00:00 INFO  stitchConfigWritten task success (true)
2018-08-16T19:34:00.426+00:00 INFO  waiting for MongoDB, attempt #1 to connect to MongoDB at mongodb://172.17.0.1
2018-08-16T19:34:00.682+00:00 WARN  waiting for MongoDB, successfully connected to MongoDB at mongodb://172.17.0.1 after 1 attempts.
2018-08-16T19:34:00.682+00:00 WARN  waiting for Stitch to start, attempt #1 to connecto to Stitch server at http://localhost:8080
2018-08-16T19:34:00.682+00:00 WARN  waiting for Stitch to start, attempt #1 failed: connect ECONNREFUSED 127.0.0.1:8080
2018-08-16T19:34:00.682+00:00 WARN  waiting for Stitch to start, attempt #2 to connecto to Stitch server at http://localhost:8080
2018-08-16T19:34:00.682+00:00 WARN  waiting for Stitch to start, attempt #2 failed: connect ECONNREFUSED 127.0.0.1:8080
2018-08-16T19:34:00.682+00:00 INFO  waiting for Stitch to start, successfully connected to Stitch at http://localhost:8080 after 2 attempts.
...
...
...
..
2018-08-16T19:34:00.682+00:00 INFO  called  charts-cli add-user with arguments
...
...
2018-08-16T19:34:00.682+00:00 INFO user pa...@trail.com has been added with role UserAdmin



I am not sure as to why the login is not working. When I put in an incorect password it prompts for a valid email/password entry. But when I put in the correct values it does nothing after clicking login

Tom Hollander

unread,
Aug 16, 2018, 6:20:29 PM8/16/18
to mongodb-user
Hi Volkan -

In your case, the issue is that the Docker container interprets 127.0.0.1 as local to the container. Assuming your mongod is running on the host, you will need to use a special hostname that lets the container find the host. For Docker 18.03 and higher on Windows or Mac, please try mongodb://host.docker.internal. If you're running on on Linux please try mongodb://172.17.0.1.

HTH
Tom

Tom Hollander

unread,
Aug 16, 2018, 6:22:01 PM8/16/18
to mongodb-user
Hi Paul -

Your logs definitely seem to be in order. I'm not sure why you can't log in. What web browser are you using? If you open your browser's development tools, do you see any error logs? Have you tried connecting from any other browsers/computers?

Tom

Volkan

unread,
Aug 17, 2018, 1:25:53 PM8/17/18
to mongodb-user
Hi Tom, 

Thank you for your help. 
Setting the key to this fixed the issue. I'm now up and running with charts.
mongodb://host.docker.internal

Thanks

Dũng Đinh

unread,
Sep 18, 2018, 6:40:54 AM9/18/18
to mongodb-user
Hi all,

I have the same problem. I have followed step by step https://docs.mongodb.com/charts/current/installation/#install-charts
everything seems OK but I can not browser MongoDB chart from my Firefox

Docker Info
Containers: 15
 Running: 2
 Paused: 0
 Stopped: 13
Images: 4
Server Version: 18.06.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: active
 NodeID: qb2who9hbbanl2so0ht0sfojv
 Is Manager: true
 ClusterID: ik7l00bjtsggsc2j2x5i1s5kr
 Managers: 1
 Nodes: 1
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.65.3
 Manager Addresses:
  192.168.65.3:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155d890114
ID: ETQR:PKOW:NHLC:LAB6:EXX6:H2N5:3TP2:E63T:55DW:HVRJ:MLD6:ZTNZ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 52
 Goroutines: 190
 System Time: 2018-09-18T10:06:17.4771461Z
 EventsListeners: 2
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false


docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS              PORTS               NAMES
967444c44974        quay.io/mongodb/charts:v0.10.0   "/bin/sh -c '/usr/bi…"   8 minutes ago       Up 8 minutes        80/tcp              mongodb-charts_charts.1.sh8plp0dm1ie5cmsjv146ce9g

docker service ls
ID                  NAME                    MODE                REPLICAS            IMAGE                            PORTS
ittcew5fndpe        mongodb-charts_charts   replicated          1/1                 quay.io/mongodb/charts:v0.10.0   *:80->80/tcp, *:443->443/tcp

docker service logs mongodb-charts_charts

mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ parsedArgs
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ installDir ('/mongodb-charts')
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ log
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ existingInstallation (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ salt
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ productNameAndVersion ({ productName: 'MongoDB Charts', version: '0.10.0' })
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ gitHash ('872b2a4f')
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ supportWidgetAndMetrics ('on')
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ chartsTestAdminCreated
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ chartsMongoDBUri
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ lastKnownVersion ('0.10.0')
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ tokens
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchConfig
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ libMongoIsInPath (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ mongoDBReachable (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchChildProcess
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchServerRunning (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchAdminCreated (false)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchUnconfigured (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchSetup ({ stitchBaseUrl: 'http://localhost:8080',  stitchAppId: '5b9a8aa7cc18890010c8f8e8',  stitchClientAppId: 'mongodb-charts-twwwi',  stitchGroupId: '5b9a8aa4cc18890010c8f8de' })
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ migrationsExecuted ({})
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchServerQuitting (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ webConfigWritten (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ stitchServerQuit (true)
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ nginxConfigured ('http')
mongodb-charts_charts.1.sh8plp0dm1ie@linuxkit-00155d890114    |  ✔ supervisorStarted (true)

The difference thing is I am connecting to mongodb from MongoDB Atlas instead of local mongodb

Any advice?

Cheers,

Tom Hollander

unread,
Sep 18, 2018, 8:38:56 PM9/18/18
to mongodb-user
Hi Dũng -

Everything looks healthy from your logs, and using Atlas for your metadata is supported. 

What URL are you hitting to try to access Charts? What are you seeing in the browser - any error messages?

Did the step to create your first Charts user complete successfully?

Tom

Dũng Đinh

unread,
Sep 18, 2018, 10:51:20 PM9/18/18
to mongodb-user
Hi Tom,

I tried to access Charts tool http://127.0.0.1:80 and it showed that could not find.....

The step to create Charts user is successfully.

Cheers,
Dung Dinh

Tom Hollander

unread,
Sep 18, 2018, 11:24:31 PM9/18/18
to mongodb-user
Do you have anything else listening on port 80? 
It looks like you're running Windows... is IIS running on the server?

Dũng Đinh

unread,
Sep 19, 2018, 2:28:58 AM9/19/18
to mongodb-user
Yes, I am running Window 10... IIS not running now

PS C:\WINDOWS\system32> netstat -anb | findStr "80"
  TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
  TCP    [::]:80                [::]:0                 LISTENING
  UDP    [fe80::b076:188a:9215:fc03%21]:1900  *:*
  UDP    [fe80::b076:188a:9215:fc03%21]:62838  *:*

Tom Hollander

unread,
Sep 20, 2018, 6:57:45 PM9/20/18
to mongodb-user
Can you send a screenshot of exactly what you see when you browse to http://localhost ?

Dũng Đinh

unread,
Sep 20, 2018, 9:54:50 PM9/20/18
to mongodb-user
Hi Tom,

The attached when I browse http://localhost and Ethernet Card of Docker

Thanks,
localhost.png
EthernetCard.png

8020erwin

unread,
Nov 27, 2018, 4:36:31 PM11/27/18
to mongodb-user
Hi I have the same problem as Düng.

No errors in the log, but cannot connect to the localhost from a browser.(windows 10, chrome firefox)
For what it is worth, my vEthernet(DockerNAT) has the same ip addres as Düng's.

Kind regards 

Erwin

8020erwin

unread,
Nov 30, 2018, 6:25:35 AM11/30/18
to mongodb-user
after a Docker update i got the message that vpnkit.exe was blocked by the firewall.
I unblocked it and now it works.
Reply all
Reply to author
Forward
0 new messages