MongoDB Charts installation failed

3,012 views
Skip to first unread message

Astro

unread,
Jun 30, 2018, 3:52:02 PM6/30/18
to mongodb-user

This command from the documentation for Ubuntu is failing:

docker exec -it \
  $(docker container ls --filter name=_charts -q) \
  charts-cli add-user --first-name "<First>" --last-name "<Last>" \
  --email "<us...@example.com>" --password "<Password>" \
  --role "<UserAdmin|User>"

add-user command error: An error occurred creating a user: An error occurred setting up the StitchMongoDBService: request to http://localhost:8080/api/admin/v3.0/auth/providers/local-userpass/login failed, reason: connect ECONNREFUSED 127.0.0.1:8080

When checked using: 
sudo docker service logs mongodb-charts_charts.1.m3bgt3z2dunzqwv57e2pzhwma


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

Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it is referring to. 

Tom Hollander

unread,
Jul 1, 2018, 8:31:30 AM7/1/18
to mongodb-user
Hi Astro -

Sorry to hear you are having troubles. 127.0.0.1:8080 is the Stitch server running internally to the container. mongodb://thinkpad:27017 would be the value you put into the charts-mongodb-uri Docker secret.

Assuming this is the correct URI for the database server you want to use, my best guess from the information provided is that it may be a name resolution problem. If this is a remote machine, please try using the IP address. If it refers to your local machine, there are special hostnames you can use to tell Docker to talk to the local machine, but they vary by OS and Docker version - please see https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach for details. 

Hope this helps
Tom 

Astro

unread,
Jul 1, 2018, 10:06:18 AM7/1/18
to mongodb-user
Hi Tom,

I was able to launch Charts app locally. One additional thing I did was to get readWrite permission to the user that was used to create a secret.

Having the only readAnyDatabase leads to errors related to not having enough permissions to create required indexes for the chart app.

Changing the user role to readWriteAnyDatabase allowed the start to start the Stitch server.


Thanks!

Astro

unread,
Jul 1, 2018, 10:09:11 AM7/1/18
to mongodb-user
Is there any way to show a result of a groupby query in a table in a chart? This is one of the most frequently used analysis.

Thanks!

Tom Hollander

unread,
Jul 1, 2018, 7:39:57 PM7/1/18
to mongodb-user
Thanks Astro. The need for readWriteAnyDatabase was known, it seems we have an error in the docs stating that readAnyDatabase is enough. I'll get that fixed.

Tabular views of data is not supported in beta but it's something we'll be starting work on very soon.

Tom

Carlos F. Enguix

unread,
Jul 4, 2018, 1:03:31 PM7/4/18
to mongodb-user
Hi Tom:

I cannot run MongoDB charts giving me a similar error to Astro. Here I include all the steps done:

I am running Windows 10 Home Edition and docker quickstart terminal and mongodb on localhost port 27017 as a Windows Service

docker quickstart terminal version 
docker --version
Docker version 18.03.0-ce, build 0520e24302
docker is configured to use the default machine with IP 192.168.99.100

$ dir
boot2docker.iso  docker-compose.exe  docker-quickstart-terminal.ico  kitematic       start.sh      unins000.exe
docker.exe       docker-machine.exe  installers                      mongodb-charts  unins000.dat

docker swarm leave --force

#docker swarm init --advertise-addr 10.0.2.15 I have tried this address same error

docker swarm init --advertise-addr 192.168.99.100

echo "mongodb://host.docker.internal" | docker secret create charts-mongodb-uri -


docker stack deploy -c charts-docker-compose-v0.9.0.yml mongodb-charts

docker service ls

docker exec -it $(docker container ls --filter name=_charts -q) charts-cli add-user --first-name "Carlos" --last-name "Enguix" --email "Myemail" --password "XXXXXX" --role "UserAdmin"

Error message:
add-user command error: An error occurred creating a user: An error occurred setting up the StitchMongoDBService: request to http://localhost:8080/api/admin/v3.0/auth/providers/local-userpass/login failed, reason: connect ECONNREFUSED 127.0.0.1:8080

$ docker service logs qcg5pzd5y97x
mongodb-charts_charts.1.ocrb6bi6i2t5@default    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.ocrb6bi6i2t5@default    |  ✔ tokens
mongodb-charts_charts.1.ocrb6bi6i2t5@default    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.ocrb6bi6i2t5@default    |  ✔ stitchConfig
mongodb-charts_charts.1.ocrb6bi6i2t5@default    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.ocrb6bi6i2t5@default    |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://host.docker.internal. Too many failed attempts. Last error: failed to connect to server [host.docker.internal:27017] on first connect [MongoNetworkError: getaddrinfo ENOTFOUND host.docker.internal host.docker.internal:27017]

I have followed all the steps indicated on the Web page.

Any hints of what I am doing wrong.

Thanks 

Carlos

Astro

unread,
Jul 4, 2018, 1:39:43 PM7/4/18
to mongodb-user
Hi Carlos,

echo "mongodb://host.docker.internal" | docker secret create charts-mongodb-uri -

Here in this command, you need to specify the hostname of mongodb from which you want to visualize your data and store charts metadata. I think you should replace 

host.docker.internal with the hostname where the mongod is running. From what you've shared, it should be your host machine's docker interface. Check this post on how to get that ip.

Additionally, you need to enable auth on the mongodb which is running on your host machine including a user that has readWriteAnyDatabase permissions and pass that user along with the username and password within the connection string as:

mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]


@Tom, please add anything if required.

Thanks!

Tom Hollander

unread,
Jul 4, 2018, 6:26:27 PM7/4/18
to mongodb-user
Hi Carlos -

We haven't tested Charts with Docker Toolbox, so we're entering uncharted territory (ha - see what I did there? :-). But let's still try to get this working!

Looking at the logs, I think the problem is likely that host.docker.internal doesn't work with Docker Toolbox. There are a bunch of other posts suggesting other addresses that might work, e.g. docker.for.win.localhost, 10.0.75.1, 172,17.0.1 but I don't have an environment to test these. I'd suggest using docker exec to launch a bash shell in the Charts container and see if any of these hosts (or other options) successfully ping. 

Another option would be to run MongoDB within a second Docker container and update the Docker Compose file to put them on the same network. 

Let me know what you discover.
Tom 

kris...@normative.io

unread,
Jul 14, 2018, 12:49:56 AM7/14/18
to mongodb-user
Hi Tom,

I am getting a variant of the same error. When I run:

docker exec -it \ $(docker container ls --filter name=_charts -q) \ charts-cli add-user --first-name "<First>" --last-name "<Last>" \ --email "<us...@example.com>" --password "<Password>" \ --role "<UserAdmin|User>"

I get:

add-user command error: An error occurred creating a user: An error occurred setting up the StitchMongoDBService: request to http://localhost:8080/api/admin/v3.0/auth/providers/local-userpass/login failed, reason: connect ECONNREFUSED 127.0.0.1:8080


And when I check using:
sudo docker service logs mongodb-charts_charts

I get:

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ encryptionKeyPath 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ tokens 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ stitchConfigTemplate 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ stitchConfig 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ stitchConfigWritten (true)

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://admin:pass...@127.0.0.1:27017/companies. Too many failed attempts. Last error: Password contains an illegal unescaped character


However, I don't have any illegal characters in the password.... 


I also used the following commands when installing:

sudo docker swarm init
echo "mongodb://admin:pass...@127.0.0.1:27017/companies" | docker secret create
sudo mv charts-docker-compose-v0.9.0.yml ./mongodb-charts
docker stack deploy -c charts-docker-compose-v0.9.0.yml mongodb-charts

Any ideas? 




Meta Mind AB (Normative)

The contents of this message are confidential and are not to be shared with outside parties without prior permission.

Tom Hollander

unread,
Jul 14, 2018, 2:40:58 AM7/14/18
to mongodb-user
Hi Kristian -

I couldn't tell you why it's complaining about illegal characters in the password - Charts just returns whatever error the driver returns, but that does indeed seem strange.

However I can see a couple of other things wrong with your URI - maybe if you fix those the issues will go away.

First, you definitely don't want the host to be 127.0.0.1. From the perspective of the Charts instance running in the Docker container, 127.0.0.1 is the container itself, which doesn't contain a mongod instance. Assuming the mongod is running on the host that owns the Docker containers, you probably want mongodb://host.docker.internal (assuming you're running Docker 18.03 on Windows or Mac), or see the extra info in the install docs at https://docs.mongodb.com/charts/current/installation/#install-charts if you have another configuration.

Also, while it's probably benign to specify a database name after the slash (i.e. the /companies in your URI), note that Charts creates a number of brand new databases, so you can't scope it to a particular named database.

Please try updating the URI as suggested (delete and recreate the secret) and let me know how you go.

Tom

On Saturday, July 14, 2018 at 2:49:56 PM UTC+10, kristian wrote:
Hi Tom,

I am getting a variant of the same error. When I run:

docker exec -it \ $(docker container ls --filter name=_charts -q) \ charts-cli add-user --first-name "<First>" --last-name "<Last>" \ --email "<us...@example.com>" --password "<Password>" \ --role "<UserAdmin|User>"

I get:

add-user command error: An error occurred creating a user: An error occurred setting up the StitchMongoDBService: request to http://localhost:8080/api/admin/v3.0/auth/providers/local-userpass/login failed, reason: connect ECONNREFUSED 127.0.0.1:8080


And when I check using:
sudo docker service logs mongodb-charts_charts

I get:

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ encryptionKeyPath 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ tokens 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ stitchConfigTemplate 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ stitchConfig 

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✔ stitchConfigWritten (true)

mongodb-charts_charts.1.v4c54g93fdpm@user     |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://admin:password@127.0.0.1:27017/companies. Too many failed attempts. Last error: Password contains an illegal unescaped character


However, I don't have any illegal characters in the password.... 


I also used the following commands when installing:

sudo docker swarm init
echo "mongodb://admin:password@127.0.0.1:27017/companies" | docker secret create

Any ideas? 


Nikhil Shetty

unread,
Jul 17, 2018, 10:27:02 PM7/17/18
to mongodb-user
Hi All,

Getting below error in logs while trying to access mongodb charts:

mongodb-charts_charts.1.ur9owo84238p@mongo1    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.ur9owo84238p@mongo1    |  ✔ tokens
mongodb-charts_charts.1.ur9owo84238p@mongo1    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.ur9owo84238p@mongo1    |  ✔ stitchConfig
mongodb-charts_charts.1.ur9owo84238p@mongo1    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.ur9owo84238p@mongo1    |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://192.168.184.151:27100,192.168.184.150:27101/?replicaSet=r1. Too many failed attempts. Last error: failed to connect to server [mongo1:27100] on first connect [MongoNetworkError: getaddrinfo ENOTFOUND mongo1 mongo1:27100]

Used below command for docker secret:
echo "mongodb://192.168.184.151:27100,192.168.184.150:27101/?replicaSet=r1" | docker secret create charts-mongodb-uri -

Any help?

Thanks and Regards,
Nikhil

Tom Hollander

unread,
Jul 17, 2018, 10:31:46 PM7/17/18
to mongodb-user
Hi Nikhil -

I suspect the error is occurring as you are using IP addresses in the connection URI, but the replica set members were added with the hostname. These need to be consistent. I presume you are using IP addresses because the hostnames are not routable from within the container. In this case you could either configure the replica set members by their IP addresses, or you could manually add the IP/hostname mappings to your docker-compose file as described in step 4 of the install docs (https://docs.mongodb.com/charts/current/installation/#install-charts)

HTH
Tom

Nikhil Shetty

unread,
Jul 18, 2018, 1:30:02 AM7/18/18
to mongod...@googlegroups.com
HI Tom,

Added below lines in docker-compose file but still getting error:

    extra_hosts:
      - "mongo1:198.168.184.151"
      - "mongo2:192.168.184.150"

[root@mongo1 mongodb-charts]# docker service logs 2te3zvgvta8q
mongodb-charts_charts.1.1y46av4uu26c@mongo1    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.1y46av4uu26c@mongo1    |  ✔ tokens
mongodb-charts_charts.1.1y46av4uu26c@mongo1    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.1y46av4uu26c@mongo1    |  ✔ stitchConfig
mongodb-charts_charts.1.1y46av4uu26c@mongo1    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.1y46av4uu26c@mongo1    |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://192.168.184.151:27100,192.168.184.150:27101/?replicaSet=r1. Too many failed attempts. Last error: failed to connect to server [mongo1:27100] on first connect [MongoNetworkError: connect ECONNREFUSED 198.168.184.151:27100]

Don't know why it is giving same error again.Also, during replica set creation. which is the best method, using hostname or ip-address?

Thanks and Regards,
Nikhil


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tom Hollander

unread,
Jul 18, 2018, 5:44:47 AM7/18/18
to mongodb-user
Hi Nikhil -

With this change, your hostnames should now resolve in the container. But you still have the issue that the URI uses IP addresses while the replica set uses hostnames. Can you please try deleting your URI secret and recreating to use the hostnames, therefore resulting in the URI and replica set config matching. 

The replica set will work with either setup, but you should use whatever is more stable and informative, which in most cases will be the hostnames. Unfortunately in some environments Docker has trouble with name resolution, which adds some complexity to this scenario.

Let me know how you go.
Tom

diego....@ibliss.com.br

unread,
Jul 28, 2018, 1:03:13 AM7/28/18
to mongodb-user
I'm having the same problem:

mongodb-charts_charts.1.vxiuyy6j4ke8@linuxkit-025000000001    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.vxiuyy6j4ke8@linuxkit-025000000001    |  ✔ tokens
mongodb-charts_charts.1.vxiuyy6j4ke8@linuxkit-025000000001    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.vxiuyy6j4ke8@linuxkit-025000000001    |  ✔ stitchConfig
mongodb-charts_charts.1.vxiuyy6j4ke8@linuxkit-025000000001    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.vxiuyy6j4ke8@linuxkit-025000000001    |  ✖ mongoDBReachable failure: Can't connect to MongoDB at mongodb://127.0.0.1:27017/db_test. 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 tried using localhost and using my machine hostname too, but the error is the same!


To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.

To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.

Tom Hollander

unread,
Jul 28, 2018, 6:49:34 PM7/28/18
to mongodb-user
Hi Diego -

Since Charts runs in a Docker container, "localhost" or "127.0.01" refers to the container, not the host running the container. To access services running directly on your host, there are special hostnames you can use - the correct one depends on your Docker version and OS:

  Docker Version   Host OS            Hostname to use
  -------------------------------------------------------------
  18.03            Windows or MacOS   host.docker.internal
  17.06-17.12      MacOS              docker.for.mac.localhost
  17.06-17.12      Windows            docker.for.win.localhost
  17.06-18.03      Linux              172.17.0.1

Please try using the relevant entry from this list and try again. Note you'll need to delete the Docker secret and recreate it with the new URI.

thanks
Tom

Rafael Ramirez Lee

unread,
Oct 26, 2018, 8:21:41 PM10/26/18
to mongodb-user

Hi Tom I am trying to deploy on linux red hat 

and I am having problems trying to connect to the mongo, but the ping seems to work as you can see below, any ideas? 

[root@master mongodb-charts]# docker run --rm quay.io/mongodb/charts:v0.10.0 charts-cli test-connection mongodb://172.17.0.1
Unable to connect to MongoDB using the specified URI.

The following error was returned while attempting to connect: 
MongoNetworkError: failed to connect to server [172.17.0.1:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 172.17.0.1:27017]

The result from pinging the specified server "172.17.0.1" from within the container is:
PING 172.17.0.1 (172.17.0.1) 56(84) bytes of data.
64 bytes from 172.17.0.1: icmp_seq=1 ttl=64 time=0.028 ms

--- 172.17.0.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.028/0.028/0.028/0.000 ms

Tom Hollander

unread,
Oct 28, 2018, 6:43:32 PM10/28/18
to mongodb-user
Hi Rafael -

Sorry to hear you're having troubles installing Charts. The error log shows that you do have connectivity to the host through that IP address, but MongoDB isn't reachable on the default port. Have you confirmed that MongoDB is indeed running on your host using that port? Could there be anything like a local firewall blocking the connection?

Tom

Astro

unread,
Dec 8, 2018, 4:14:59 AM12/8/18
to mongodb-user


Tabular views of data is not supported in beta but it's something we'll be starting work on very soon.

 @Tom: I need to do a simple group by query in chart:
   
db.survey_results_public.aggregate([{$group:{_id:"$IDE", count:{$sum:1}}}, {$sort:{count:-1}}])

Can this be achieved in mongodb charts?


Thanks!

   
    


Astro

unread,
Dec 13, 2018, 2:19:49 AM12/13/18
to mongodb-user
I could do a groupby in charts.

However, presenting the data in the tabular view is one of the frequently used use cases which is not present in charts.


Thanks!

Tom Hollander

unread,
Dec 16, 2018, 9:07:22 PM12/16/18
to mongodb-user
We do actually have a table view now. As of today it's only in the new Atlas release of Charts, but we'll release an update to the on-prem version very soon which will also have this.

Tom

Hashim Maliakkal Ebrahim

unread,
Feb 19, 2019, 11:04:20 AM2/19/19
to mongodb-user
Dear Tom,

I am getting an error like below

 ✖ stitchUnconfigured failure: app "mongodb-charts-uavpy" not found.

I am trying to access using localhost only. Mongo and Docker is running on my local machine

Regards,
Hashim 

Tom Hollander

unread,
Feb 19, 2019, 5:49:12 PM2/19/19
to mongodb-user
Hi Hashim -

Was this a fresh install of Charts, or did you take an existing copy of Charts and point it to a new database?
Charts uses a docker volume called mongodb-charts_keys which stores some key data specific to your current installation. If you change databases, the keys will no longer be valid. If you don't have any Charts data that you need to retain, the simplest approach is usually to delete the volume using docker volume rm mongodb-charts_keys and try deploying again.

If this doesn't help, I may need more info on the steps you followed during installation.
Tom

Sergey Yaroshevskiy

unread,
Mar 7, 2019, 3:57:02 PM3/7/19
to mongodb-user
Hi Tom

Why dose it need ReadWrite access to any database? That worries me.


понедельник, 2 июля 2018 г., 2:39:57 UTC+3 пользователь Tom Hollander написал:

Tom Hollander

unread,
Mar 7, 2019, 6:24:18 PM3/7/19
to mongodb-user
Hey Sergey -

Charts is built on top of MongoDB Stitch, which always creates a user with this role. However for Charts we have rules in place that prevent any writes to the database.
But to mitigate your valid concern we are planning on changing the auto-generated user to only require the readAnyDatabase role.

Tom

Sergey Yaroshevskiy

unread,
Mar 8, 2019, 1:07:57 AM3/8/19
to mongodb-user
That would be great. I'd also suggest you do not require read _any_ database and show the error when user will try to access prohibited gatabase.

Duc Nguyen

unread,
Apr 3, 2019, 5:53:52 PM4/3/19
to mongodb-user

Screenshot 2019-04-03 at 4.18.02 PM.png

Hi Tom,
I did as what the tutorial told and had this error in the image which told me to provide a valid email address.
I dont know how to solve this because I had tried multiple times. Hope you can help
Thank you

Tom Hollander

unread,
Apr 3, 2019, 7:02:22 PM4/3/19
to mongodb-user
Hi Duc -

Looking at your screenshot, I think you are using curly quotes as parameters to the command. Please make sure you are using regular straight quotes by typing them directly into the terminal rather than copy/pasting from another editor.

Tom

Tien Duc Ngyuen

unread,
Apr 3, 2019, 10:01:25 PM4/3/19
to mongod...@googlegroups.com
I managed to overcome that issue. However after I created user successfully, I could not access to the mongodb charts web application.

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
Screenshot 2019-04-04 at 8.59.49 AM.png

Tom Hollander

unread,
Apr 3, 2019, 11:53:17 PM4/3/19
to mongodb-user
Hi - yes we've had a few people report that. I'm guessing you're running MongoDB 3.4? If so please note the following from the install docs:

If you run Charts with MongoDB version 3.4 as the metadata database, be sure to start mongod with the enableMajorityReadConcern option enabled. Later versions have this option enabled by default, but in version 3.4 you must set it manually or add it to a configuration file.

We plan on modifying the installer to detect this situation in future versions, but if you follow this step it should work OK.

Tom


On Thursday, April 4, 2019 at 1:01:25 PM UTC+11, Duc Nguyen wrote:
I managed to overcome that issue. However after I created user successfully, I could not access to the mongodb charts web application.

On Thu, 4 Apr 2019 at 06:02, 'Tom Hollander' via mongodb-user <mongod...@googlegroups.com> wrote:
Hi Duc -

Looking at your screenshot, I think you are using curly quotes as parameters to the command. Please make sure you are using regular straight quotes by typing them directly into the terminal rather than copy/pasting from another editor.

Tom

On Thursday, April 4, 2019 at 8:53:52 AM UTC+11, Duc Nguyen wrote:

Screenshot 2019-04-03 at 4.18.02 PM.png

Hi Tom,
I did as what the tutorial told and had this error in the image which told me to provide a valid email address.
I dont know how to solve this because I had tried multiple times. Hope you can help
Thank you

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.

Tien Duc Ngyuen

unread,
Apr 9, 2019, 12:42:38 AM4/9/19
to mongod...@googlegroups.com
Hi Tom,
It's me again. I was trying to link a new data source from my local database which is running on port 27017. And I have the following problem.
Screenshot 2019-04-09 at 11.36.06 AM.png

I also tried 
Screenshot 2019-04-09 at 11.40.36 AM.png
Please help me with this. I was running a standalone MongoDB deployment.
Thank you!

On Thu, 4 Apr 2019 at 10:53, 'Tom Hollander' via mongodb-user <mongod...@googlegroups.com> wrote:
Hi - yes we've had a few people report that. I'm guessing you're running MongoDB 3.4? If so please note the following from the install docs:

If you run Charts with MongoDB version 3.4 as the metadata database, be sure to start mongod with the enableMajorityReadConcern option enabled. Later versions have this option enabled by default, but in version 3.4 you must set it manually or add it to a configuration file.

We plan on modifying the installer to detect this situation in future versions, but if you follow this step it should work OK.

Tom

On Thursday, April 4, 2019 at 1:01:25 PM UTC+11, Duc Nguyen wrote:
I managed to overcome that issue. However after I created user successfully, I could not access to the mongodb charts web application.

On Thu, 4 Apr 2019 at 06:02, 'Tom Hollander' via mongodb-user <mongod...@googlegroups.com> wrote:
Hi Duc -

Looking at your screenshot, I think you are using curly quotes as parameters to the command. Please make sure you are using regular straight quotes by typing them directly into the terminal rather than copy/pasting from another editor.

Tom

On Thursday, April 4, 2019 at 8:53:52 AM UTC+11, Duc Nguyen wrote:

Screenshot 2019-04-03 at 4.18.02 PM.png

Hi Tom,
I did as what the tutorial told and had this error in the image which told me to provide a valid email address.
I dont know how to solve this because I had tried multiple times. Hope you can help
Thank you

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.

To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.

Tom Hollander

unread,
Apr 9, 2019, 12:58:19 AM4/9/19
to mongodb-user
Because Charts is running in a Docker container, "localhost" will refer to the container, not the host running the container. To get access to MongoDB on the host, try mongodb://host.docker.internal (if running Windows or Mac), or mongodb://172.17.0.1 if running Linux.

Tom
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@googlegroups.com.

sheng li bao

unread,
Jul 18, 2019, 6:55:34 AM7/18/19
to mongodb-user
Hello Tom,

A google search got me here: "add-user command error: clientAppId not found. No Charts apps configured to add user to."

I have so far followed the guide at https://docs.mongodb.com/charts/onprem/installation/ successfully, but now I am completely stuck. I read through this thread, but I am no wiser. Maybe I did not understand the big hint here, since I am not very familiar with Docker.

Here is what I have tried so far and also where exactly I got stuck:

docker exec -it   $(docker container ls --filter name=_charts -q)   mongodb://host.docker.internal add-user --first-name "MyName" --last-name "MyLastName"   --email "myCorrectEmail" --password "PassWithoutSpecialChars"   --role "UserAdmin"

I have tried all sorts of variants instead of mongodb://host.docker.internal, the docker container ID etc. I guess the "charts-cli" part mentioned in the documentation is wrong and would never work?

I have of course also tried the original variant, as mentioned in the first question here by Astro (using charts-cli).

When I do a "docker service logs mongodb-charts_charts", I find:

mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ parsedArgs
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ installDir ('/mongodb-charts')
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ log
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ salt
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ productNameAndVersion ({ productName: 'MongoDB Charts', version: '1.4.1' })
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ gitHash ('16c068a2')
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ supportWidgetAndMetrics ('on')
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ tileServer (undefined)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ tileAttributionMessage (undefined)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ rawFeatureFlags (undefined)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ stitchMigrationsLog ({ completedStitchMigrations: [] })
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ featureFlags ({})
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ lastAppJson ({})
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ existingInstallation (false)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ tenantId ('9263bb33-f20d-49bc-8a95-b16464fc5c6f')
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ chartsMongoDBUri
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ tokens
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ encryptionKeyPath
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ stitchConfigTemplate
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ stitchConfig
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ libMongoIsInPath (true)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ stitchConfigWritten (true)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ mongoDBReachable (true)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ stitchMigrationsExecuted ([ 'stitch-1332',  'stitch-1897',  'stitch-2041',  'migrateStitchProductFlag',  'stitch-2041-local',  'stitch-2046-local',  'stitch-2055',  'multiregion',  'dropStitchLogLogIndexStarted' ])
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ stitchChildProcess
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✔ indexesCreated (true)
mongodb-charts_charts.1.2991uoacni9p@linuxkit-025000000001    |  ✖ stitchServerRunning failure: Can't connect to Stitch Server at http://localhost:8080. Too many failed attempts. Last error: connect ECONNREFUSED 127.0.0.1:8080

I guess the problem here is with the attempted connection @ localhost which should be "mongodb://host.docker.internal", I guess? How to define this? I tried to Google info. about how to "configure the CHARTS_MONGODB_URI environment variable within the container" but no success.

"docker network inspect bridge" yields the following
[
    {
        "Name": "bridge",
        "Id": "eb2889a5e82318581ea3111a1ed3086e8e8c3b1849d31d81b83ac0322d18f13e",
        "Created": "2019-07-17T09:37:38.229336754Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

When I enter mongodb://host.docker.internal in my browser it is interpreted as a search string.

I am trying to run this on MACOS 10.14.5 and Docker 18.09.2

Any thoughts?

Many thanks in advance,

ShengLi

Tom Hollander

unread,
Jul 18, 2019, 8:04:24 PM7/18/19
to mongodb-user
Hi ShengLi -

So the issue here is with Charts starting, not with the `add-user` command. The `add-user` command simply failed because the server did not start successfully.
The mongodb://host.docker.internal URI will only work within the container, not from your host, and since it's a MongoDB URI you can't use it from a web browser anyway.

From here I suggest you do the following:
  1. Stop the container using `docker stack rm mongodb-charts`
  2. Test that the URI is correct using `docker run --rm quay.io/mongodb/charts:19.06.1 charts-cli test-connection mongodb://host.docker.internal`
  3. Once you have a URI that works, delete the old secret using `docker secret rm charts-mongodb-uri` and recreate it using `echo "mongodb://host.docker.internal" | docker secret create charts-mongodb-uri -` (substituting whatever URI is known to be good)
  4. Start the Charts server again using `docker stack deploy -c charts-docker-swarm-19.06.1.yml mongodb-charts`
  5. Check that Charts has started successfully using `docker service ls` and `docker service logs <serviceId>`
  6. Once it is running, run the `add-user` command as you attempted earlier.
Let me know how you go
Tom

sheng li bao

unread,
Jul 19, 2019, 4:03:14 AM7/19/19
to mongodb-user
Hello Tom,

Many thanks for the quick reply, I see it's quite busy on here.

I have followed your steps without changing anything and it worked. I also did not see anything different from what I did in the very beginning. Maybe the container just needed a restart?

I was surprised that I could access the DB on my localhost. I thought that would not work. Anyways, it seems to work fine now. Next steps will be to learn more about Charts and how to properly structure my data.

Thanks again for your help!

ShengLi
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages