dutchcoders / slackarchive

Archiver for Slack Teams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having "panic: no reachable servers" error while follow the guide

evil-shrike opened this issue · comments

I'm having difficulties following the guide to run the solution.

I've followed the suggested steps in README:

  • setup tokens (xoxb and api-token)
  • docker network create slackarchive
  • docker-compose run --rm wait_for_dependencies
  • docker-compose run --rm slackarchive-init

then on executing docker-compose up slackarchive it exits with "panic: no reachable servers" error:

C:\Work\R-n-D\SlackArchive\docker>docker-compose up slackarchive
Creating docker_slackarchive_1 ... done
Attaching to docker_slackarchive_1
slackarchive_1           | panic: no reachable servers
slackarchive_1           |
slackarchive_1           | goroutine 1 [running]:
slackarchive_1           | github.com/dutchcoders/slackarchive/api.New(0xc4200b6180, 0x13)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/api/api.go:70 +0x432
slackarchive_1           | main.run(0xc4200ac9a0)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/main.go:44 +0x66
slackarchive_1           | github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli%2ev1.HandleAction(0x9f7cc0, 0xb363d8, 0xc4200ac9a0, 0xc4200a69c0, 0x0)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli.v1/app.go:492 +0x7c
slackarchive_1           | github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli%2ev1.(*App).Run(0xc4200a96c0, 0xc42008e090, 0x3, 0x3, 0x0, 0x0)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli.v1/app.go:264 +0x5ee
slackarchive_1           | main.main()
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/main.go:38 +0x268
docker_slackarchive_1 exited with code 2

Could you suggest what can be wrong?

ENV:
Windows 1803
Docker version 18.03.0-ce, build 0520e24

Hey if you get this installation figured out would you be able to walk me through it?

That's weird, as slackarchive-init should fail then as well. The panic: no reachable servers means it cannot connect to Elasticsearch. Is Elasticsearch still running? (or run the wait_for_dependencies once more).

Could you output your docker -ps?

D:\Work\R-n-D\SlackArchive\docker>docker-compose run --rm wait_for_dependencies
Creating docker_mongodb_1       ... done
Creating docker_elasticsearch_1 ... done
Waiting for mongodb to listen on 27017...
sleeping
sleeping
sleeping
sleeping
nc: bad address 'mongodb'
sleeping
sleeping
sleeping
...
Waiting for elasticsearch to listen on 9200...
sleeping
nc: bad address 'elasticsearch'
sleeping
nc: bad address 'elasticsearch'

that "sleeping" continues to arrive
While it's running I run next docker-compose run --rm slackarchive-init:
It just exists without any output.

Next docker-compose up slackarchive (while wait_for_dependencies is still running) returns the mentioned error.

D:\Work\R-n-D\SlackArchive\docker>docker ps
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                      NAMES
05175fcb94d9        dadarek/wait-for-dependencies   "/usr/local/bin/entr…"   4 minutes ago       Up 3 minutes                                   docker_wait_for_dependencies_run_1
62bb609137f2        mongo                           "docker-entrypoint.s…"   4 minutes ago       Up 4 minutes        0.0.0.0:27017->27017/tcp   docker_mongodb_1
D:\Work\R-n-D\SlackArchive\docker>docker-compose top
docker_mongodb_1
The system cannot find the path specified.
PID    USER   TIME             COMMAND
------------------------------------------------
5047   999    0:02   mongod --auth --bind_ip_all

docker_wait_for_dependencies_run_1
The system cannot find the path specified.
PID    USER   TIME                                          COMMAND
----------------------------------------------------------------------------------------------------------
5325   root   0:00   {entrypoint.sh} /bin/sh /usr/local/bin/entrypoint.sh mongodb:27017 elasticsearch:9200
6544   root   0:00   nc -z elasticsearch 9200

I've stopped docker-compose run --rm wait_for_dependencies and run it again, then slackarchive-init. Now it seems that elacticsearch is running. Then I run docker-compose up slackarchive and it failed with another error:

D:\Work\R-n-D\SlackArchive\docker>docker-compose up slackarchive
Starting docker_slackarchive_1 ... done
Attaching to docker_slackarchive_1
slackarchive_1           | panic: read /config/config.yaml: is a directory
slackarchive_1           |
slackarchive_1           | goroutine 1 [running]:
slackarchive_1           | github.com/dutchcoders/slackarchive/config.MustLoad(0x7ffedfabef20, 0x13, 0x6)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/config/config.go:47 +0x8b
slackarchive_1           | main.run(0xc4201a82c0)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/main.go:42 +0x58
slackarchive_1           | github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli%2ev1.HandleAction(0x9f7cc0, 0xb363d8, 0xc4201a82c0, 0xc42016e7e0, 0x0)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli.v1/app.go:492 +0x7c
slackarchive_1           | github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli%2ev1.(*App).Run(0xc4201549c0, 0xc42001e0c0, 0x3, 0x3, 0x0, 0x0)
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/vendor/gopkg.in/urfave/cli.v1/app.go:264 +0x5ee
slackarchive_1           | main.main()
slackarchive_1           |      /go/src/github.com/dutchcoders/slackarchive/main.go:38 +0x268
docker_slackarchive_1 exited with code 2

After that elasticsearch disappeared:

D:\Work\R-n-D\SlackArchive\docker>docker ps
CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                      NAMES
37e92cf3d7bd        dadarek/wait-for-dependencies   "/usr/local/bin/entr…"   4 minutes ago       Up 4 minutes                                   docker_wait_for_dependencies_run_1
62bb609137f2        mongo                           "docker-entrypoint.s…"   13 minutes ago      Up 13 minutes       0.0.0.0:27017->27017/tcp   docker_mongodb_1

May I ask why that strange wait_for_dependencies container is needed? Why not just run docker-compose up?

I believe the issue with the nc: bad address is that the wait_for_dependencies container calls netcat on mongodb:27017 and elasticsearch:9200, which would obviously fail.

To fix that issue, I just didn’t do the first step, and skipped to the next in the slackarchive-docket repo.

However, that brought up a similar issue to this one, without a server being found.

It would really be nice if this project had clear and working documentation, as no other slack archive projects are open-source.

They'll fail only if Elasticsearch or MongoDB has not been started. We are using the wait_for_dependencies to be sure that all dependencies has been started, before starting both the bot and website. Otherwise they'll fail to start. Just running docker-compose up will start all components at almost the same time, where Elasticsearch takes a while to start.

@jaredthecoder I'll be happy to accept pull requests for clear and working documentation. The readme I've written is working on my setup, I expect the issues you're experiencing are issues with starting Elasticsearch, not with starting SlackArchive. As always, check the logs and see why it is failing. And I've build and runned SlackArchive for a multiple years, and had my share of money and time spent. You should be happy that everything is opensource now (which costed me again quite some time) and now it is time for a community to be created and pick up improvement. I'll be very happy to help and accept pull requests, but it is time for the community to give something back.

It seems I understand what's wrong in my case - it's Mongo in Docker can't work with folder volumes on Windows (docker/for-win#138).
I've used a container volume instead of folder volume and mongo started.
I started elastic and mongo explicitly by hand:
docker-compose run --rm elasticsearch and docker-compose run --rm mongodb
Mongo seems ok:
2018-05-05T23:02:22.340+0000 I NETWORK [initandlisten] waiting for connections on port 27017
but I'm not sure about Elastic,
It outputs same lines every 1.5 minutes:

[2018-05-05T23:05:18,727][INFO ][o.e.c.r.a.DiskThresholdMonitor] [ct2jf9T] rerouting shards: [high disk watermark exceeded on one or more nodes]
[2018-05-05T23:05:48,760][WARN ][o.e.c.r.a.DiskThresholdMonitor] [ct2jf9T] high disk watermark [90%] exceeded on [ct2jf9TzQKivkJ7XGOANKA][ct2jf9T][/usr/share/elasticsearch/data/nodes/0] free: 11.9gb[8%], shards will be relocated away from this node

docker ps:

C:\Work\R-n-D\SlackArchive\docker>docker ps
CONTAINER ID        IMAGE                                                 COMMAND                  CREATED              STATUS              PORTS
         NAMES
47d676d42dea        mongo                                                 "docker-entrypoint.s…"   About a minute ago   Up About a minute   27017/tcp
         docker_mongodb_run_1
0562a70b1969        docker.elastic.co/elasticsearch/elasticsearch:5.6.4   "/bin/bash bin/es-do…"   27 minutes ago       Up 27 minutes       9200/tcp, 9300/tcp   docker_elasticsearch_run_1

But docker-compose up slackarchive fails with same error "panic: no reachable servers"

@nl5887 Ahh, I didn’t mean to sound combative. I really (and we all do) appreciate you open sourcing it rather than letting it disappear.

It was more of a call to the community to help than use your time.

@evil-shrike: I’ll try to reproduce that and get back to you.