Discussion:
MongoDB Charts installation failed
(too old to reply)
Astro
2018-06-30 19:52:02 UTC
Permalink
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 "<***@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-***@thinkpad | ✔ encryptionKeyPath
mongodb-***@thinkpad | ✔ tokens
mongodb-***@thinkpad | ✔ stitchConfigTemplate
mongodb-***@thinkpad | ✔ stitchConfig
mongodb-***@thinkpad | ✔ stitchConfigWritten
(true)
mongodb-***@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.
--
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 mongodb-***@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/e71a9071-7239-4a1a-9feb-fd2907463860%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-07-01 10:38:33 UTC
Permalink
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.1.m3bgt3z2dunzqwv57e2pzhwma
(true)
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.
--
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 mongodb-***@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/bcb96e42-6cbc-422d-afdf-c31c3fad1784%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Astro
2018-07-01 14:06:18 UTC
Permalink
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!
--
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 mongodb-***@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/1f0eaeed-16bb-4d94-9b79-6c293321f59b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Astro
2018-07-01 14:09:11 UTC
Permalink
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!
--
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 mongodb-***@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/725cf5ba-a9b9-43c8-9910-1398b663bd68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-07-01 23:39:57 UTC
Permalink
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
Post by Astro
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!
--
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 mongodb-***@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/de049e95-3da8-4350-939f-14d7401659f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Astro
2018-12-08 09:14:59 UTC
Permalink
Post by 'Tom Hollander' via 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!
--
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 mongodb-***@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/2be1557e-5b09-47f2-b50d-e5613679408e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Carlos F. Enguix
2018-07-04 17:03:30 UTC
Permalink
This post might be inappropriate. Click to display it.
'Tom Hollander' via mongodb-user
2018-07-04 22:26:27 UTC
Permalink
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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here I
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
(true)
failure: Can't connect to MongoDB at mongodb://host.docker.internal. Too
many failed attempts. Last error: failed to connect to server
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
stitchConfigTemplate
(true)
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.
--
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 mongodb-***@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/3fca5f87-71a9-474b-882d-9365724e945c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
k***@normative.io
2018-07-13 19:10:54 UTC
Permalink
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 "<***@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-***@user | ✔ encryptionKeyPath

mongodb-***@user | ✔ tokens

mongodb-***@user | ✔ stitchConfigTemplate

mongodb-***@user | ✔ stitchConfig

mongodb-***@user | ✔ stitchConfigWritten
(true)

mongodb-***@user | ✖ mongoDBReachable
failure: Can't connect to MongoDB at
mongodb://admin:***@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:***@127.0.0.1:27017/companies" | docker secret
create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here I
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
(true)
failure: Can't connect to MongoDB at mongodb://host.docker.internal. Too
many failed attempts. Last error: failed to connect to server
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
stitchConfigTemplate
stitchConfigWritten (true)
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.
--
*
*
*Meta Mind AB (Normative)*


*The contents of this message are
confidential and are not to be shared with outside parties without prior
permission.*
--
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 mongodb-***@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/684afa7d-d1cf-442e-b7d6-ecfba373ee2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-07-14 06:40:57 UTC
Permalink
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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
(true)
failure: Can't connect to MongoDB at mongodb://
error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here I
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
(true)
failure: Can't connect to MongoDB at mongodb://host.docker.internal. Too
many failed attempts. Last error: failed to connect to server
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
stitchConfigTemplate
stitchConfigWritten (true)
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.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be shared
with outside parties without prior permission.*
--
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 mongodb-***@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/4e003124-a862-469c-90c6-067c92540040%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nikhil Shetty
2018-07-17 16:56:42 UTC
Permalink
Hi All,

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

mongodb-***@mongo1 | ✔ encryptionKeyPath
mongodb-***@mongo1 | ✔ tokens
mongodb-***@mongo1 | ✔ stitchConfigTemplate
mongodb-***@mongo1 | ✔ stitchConfig
mongodb-***@mongo1 | ✔ stitchConfigWritten
(true)
mongodb-***@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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
(true)
failure: Can't connect to MongoDB at mongodb://
error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here I
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
stitchConfigTemplate
stitchConfigWritten (true)
failure: Can't connect to MongoDB at mongodb://host.docker.internal. Too
many failed attempts. Last error: failed to connect to server
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
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.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be shared
with outside parties without prior permission.*
--
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 mongodb-***@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/fd97d619-924a-4843-a247-270fdc9f7a3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-07-18 02:31:45 UTC
Permalink
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
Post by Nikhil Shetty
Hi All,
(true)
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]
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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
(true)
failure: Can't connect to MongoDB at mongodb://
Last error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here I
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
stitchConfigTemplate
stitchConfigWritten (true)
failure: Can't connect to MongoDB at mongodb://host.docker.internal. Too
many failed attempts. Last error: failed to connect to server
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it is
referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be shared
with outside parties without prior permission.*
--
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 mongodb-***@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.
Nikhil Shetty
2018-07-18 05:29:41 UTC
Permalink
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"

[***@mongo1 mongodb-charts]# docker service logs 2te3zvgvta8q
mongodb-***@mongo1 | ✔ encryptionKeyPath
mongodb-***@mongo1 | ✔ tokens
mongodb-***@mongo1 | ✔ stitchConfigTemplate
mongodb-***@mongo1 | ✔ stitchConfig
mongodb-***@mongo1 | ✔ stitchConfigWritten
(true)
mongodb-***@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


On 18 July 2018 at 08:01, 'Tom Hollander' via mongodb-user <
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
Hi All,
(true)
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]
echo "mongodb://192.168.184.151:27100,192.168.184.150:27101/?repl
icaSet=r1" | docker secret create charts-mongodb-uri -
Any help?
Thanks and Regards,
Nikhil
Post by 'Tom Hollander' via 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/ch
arts/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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
(true)
.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....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.1.m3bgt3
z2dunzqwv57e2pzhwma
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it is
referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be shared
with outside parties without prior permission.*
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
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
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
<https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-***@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/CAL8XOaq9x1h9qeo_sVi2PKOihXKJZxF%3DJjc_b7pLbu%2BC5jdpcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-07-18 09:44:47 UTC
Permalink
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
Post by Nikhil Shetty
HI Tom,
- "mongo1:198.168.184.151"
- "mongo2:192.168.184.150"
(true)
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
On 18 July 2018 at 08:01, 'Tom Hollander' via mongodb-user <
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
Hi All,
(true)
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]
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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
stitchConfigTemplate
stitchConfigWritten (true)
failure: Can't connect to MongoDB at mongodb://
Last error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro. Here
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it is
referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be
shared with outside parties without prior permission.*
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
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
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
<https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-***@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/d410eb2e-21a3-4193-8666-bc9bee3349ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
d***@ibliss.com.br
2018-07-27 18:22:10 UTC
Permalink
I'm having the same problem:

mongodb-***@linuxkit-025000000001 | ✔
encryptionKeyPath
mongodb-***@linuxkit-025000000001 | ✔ tokens
mongodb-***@linuxkit-025000000001 | ✔
stitchConfigTemplate
mongodb-***@linuxkit-025000000001 | ✔
stitchConfig
mongodb-***@linuxkit-025000000001 | ✔
stitchConfigWritten (true)
mongodb-***@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!
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
HI Tom,
- "mongo1:198.168.184.151"
- "mongo2:192.168.184.150"
(true)
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
On 18 July 2018 at 08:01, 'Tom Hollander' via mongodb-user <
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
Hi All,
(true)
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]
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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
stitchConfigTemplate
stitchConfigWritten (true)
failure: Can't connect to MongoDB at mongodb://
Last error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro.
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it is
referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be
shared with outside parties without prior permission.*
--
You received this message because you are subscribed to the Google
Groups "mongodb-user"
group.
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
<javascript:>.
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
<https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-***@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/66347ec3-b9ed-42f4-9b16-e7e2680aa11c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-07-28 22:49:34 UTC
Permalink
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
Post by Astro
encryptionKeyPath
stitchConfigTemplate
stitchConfig
stitchConfigWritten (true)
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 ECONNREFUSED 127.0.0.1:27017]
I tried using localhost and using my machine hostname too, but the error
is the same!
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
HI Tom,
- "mongo1:198.168.184.151"
- "mongo2:192.168.184.150"
(true)
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
On 18 July 2018 at 08:01, 'Tom Hollander' via mongodb-user <
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
Hi All,
stitchConfigTemplate
stitchConfigWritten (true)
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]
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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
stitchConfigTemplate
stitchConfigWritten (true)
failure: Can't connect to MongoDB at mongodb://
Last error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro.
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it is
referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be
shared with outside parties without prior permission.*
--
You received this message because you are subscribed to the Google
Groups "mongodb-user"
group.
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
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
<https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-***@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/28faa588-79cf-4e30-af11-cc977ef4d59d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Rafael Ramirez Lee
2018-10-26 17:17:17 UTC
Permalink
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?

[***@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
Post by 'Tom Hollander' via 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 -
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
Post by Astro
encryptionKeyPath
stitchConfigTemplate
stitchConfig
stitchConfigWritten (true)
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 ECONNREFUSED 127.0.0.1:27017]
I tried using localhost and using my machine hostname too, but the error
is the same!
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
HI Tom,
- "mongo1:198.168.184.151"
- "mongo2:192.168.184.150"
(true)
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
On 18 July 2018 at 08:01, 'Tom Hollander' via mongodb-user <
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
Hi All,
stitchConfigTemplate
stitchConfigWritten (true)
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]
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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at mongodb://
attempts. Last error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro.
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it
is referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be
shared with outside parties without prior permission.*
--
You received this message because you are subscribed to the Google
Groups "mongodb-user"
group.
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
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
<https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-***@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/e244ddb6-2dd9-4961-9072-45cd7ba6dc82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
'Tom Hollander' via mongodb-user
2018-10-28 22:43:32 UTC
Permalink
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

On Saturday, October 27, 2018 at 11:21:41 AM UTC+11, Rafael Ramirez Lee
Post by Rafael Ramirez Lee
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?
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.
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
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
Post by 'Tom Hollander' via 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 -
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
Post by Astro
encryptionKeyPath
stitchConfigTemplate
stitchConfig
stitchConfigWritten (true)
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!
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
HI Tom,
- "mongo1:198.168.184.151"
- "mongo2:192.168.184.150"
stitchConfigTemplate
stitchConfigWritten (true)
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
On 18 July 2018 at 08:01, 'Tom Hollander' via mongodb-user <
Post by 'Tom Hollander' via 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
Post by Nikhil Shetty
Hi All,
stitchConfigTemplate
stitchConfigWritten (true)
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]
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
Post by 'Tom Hollander' via 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
Post by Astro
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>" \
--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
sudo docker service logs mongodb-charts_charts
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at mongodb://
attempts. Last error: Password contains an illegal unescaped character
However, I don't have any illegal characters in the password....
sudo docker swarm init
docker secret create
docker pull quay.io/mongodb/charts:v0.9.0
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?
Post by 'Tom Hollander' via 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
Post by Carlos F. Enguix
I cannot run MongoDB charts giving me a similar error to Astro.
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 pull quay.io/mongodb/charts:v0.9.0
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"
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
encryptionKeyPath
stitchConfigTemplate
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
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
Post by Astro
docker exec -it \
$(docker container ls --filter name=_charts -q) \
charts-cli add-user --first-name "<First>" --last-name "<Last>" \
--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
sudo docker service logs mongodb-charts_charts.
1.m3bgt3z2dunzqwv57e2pzhwma
encryptionKeyPath
stitchConfigTemplate
stitchConfig
stitchConfigWritten (true)
mongoDBReachable failure: Can't connect to MongoDB at
mongodb://thinkpad:27017. Too many failed attempts. Last error: failed to
getaddrinfo ENOTFOUND thinkpad thinkpad:27017]
Not sure which 127.0.0.1:8080 and mongodb://thinkpad:27017 it
is referring to.
*Meta Mind AB (Normative)*
*The contents of this message are confidential and are not to be
shared with outside parties without prior permission.*
--
You received this message because you are subscribed to the Google
Groups "mongodb-user"
group.
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,
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
<https://groups.google.com/d/msgid/mongodb-user/36cfda3b-b663-4551-9128-379b6399cc6a%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 mongodb-***@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/235ac434-f324-48e1-95f6-31faec2caad8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Astro
2018-07-04 17:39:43 UTC
Permalink
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
<https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach>
on how to get that ip.

Additionally, you need to enable auth
<https://docs.mongodb.com/manual/tutorial/enable-authentication/> 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
<https://docs.mongodb.com/manual/reference/connection-string/> as:

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


@Tom, please add anything if required.

Thanks!
--
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 mongodb-***@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/56571886-7713-4d20-813a-891cfa75573d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...