dokku / dokku-elasticsearch

an elasticsearch plugin for dokku
MIT License
94 stars 35 forks source link

Problem when creating an elasticsearch service #70

Closed templth closed 5 years ago

templth commented 5 years ago

Hello,

I try to create a service but got this error:

dokku elasticsearch:create myesservice
=====> Extracting config files
12e5e8f167f5df1b7fa6c60701d8782a3f322e697b63e52d7993442ed9e80f39
docker: Error response from daemon: endpoint with name dokku.elasticsearch.myesservice already exists in network bridge.

I did previously:

$ dokku elasticsearch:destroy myesservice

After run the create command, I have the following within Docker:

$ docker ps -a

CONTAINER ID        IMAGE                                           COMMAND                  CREATED             STATUS                     PORTS               NAMES
30ef765a1ed6        elasticsearch:6.7.1                             "/usr/local/bin/do..."   3 seconds ago       Created                                        dokku.elasticsearch.myesservice

I wonder if the service is correctly created...

Thanks for your help!

josegonzalez commented 5 years ago

Did the container removal fail? We run tests for this in CI, but if you can file a failing test for this, I can take a closer look.

templth commented 5 years ago

Thans for your answer!

With the command dokku elasticsearch:destroy myesservice, the container in docker is removed successfully...

Antoher strange thing, I link this service with my app and I got this error when deploying:

remote: docker: Error response from daemon: Cannot link to a non running container: /dokku.elasticsearch.myesservice AS /musing_pasteur/dokku-elasticsearch-myesservice.

How can I debug things to detect what is broken?

josegonzalez commented 5 years ago

Is the container created and running when you run that link command?

templth commented 5 years ago

In fact, the container for the elasticsearch service isn't running because of the error:

Error response from daemon: endpoint with name dokku.elasticsearch.myesservice already exists in network bridge
Error: failed to start containers: 5f2b9678de67
templth commented 5 years ago

@josegonzalez I removed the endpoint from the network bridge:

docker network disconnect bridge dokku.elasticsearch.myesservice

and now I can start the elasticsearch service.

But when deploying now, I have this error:

docker: Error response from daemon: Cannot link to /dokku.elasticsearch.tripigo, as it does not belong to the default network.

but I have one in the bridge network:

docker network inspect bridge
[
    {
        "Name": "bridge",
        "Id": "bc80f86fb55a8d007dbbe5cc97e1408e5b42f285f9325d69716fafac74bbc66a",
        "Created": "2018-03-19T19:28:33.57304145Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "Containers": {
            "2bc51cc4c8803766672766d95be2187bd743cc7245db2144f6b670d996cab72f": {
                "Name": "dev.web.1",
                "EndpointID": "cf38398a9c61bda8257eaf4d2eb48b84ada1684b558f730f0fdc66e3c5a26e30",
                "MacAddress": "02:42:ac:11:00:05",
                "IPv4Address": "172.17.0.5/16",
                "IPv6Address": ""
            },
            "3d0916f63fe5887eeabff2650d1966530fb1f909ab583e314f5419973f9d624e": {
                "Name": "api.web.1",
                "EndpointID": "0d5f9c0d01c87dfe7e444c4ef58c1918f33d6026c760dabd1e1f261927fa8fdf",
                "MacAddress": "02:42:ac:11:00:08",
                "IPv4Address": "172.17.0.8/16",
                "IPv6Address": ""
            },
            "63ffbcce0c1d9e4b6ae516b18116a73ec1a57dbeaf425d6b253576ce83c7ec09": {
                "Name": "dokku.elasticsearch.myesservice",
                "EndpointID": "b6eb80760001e28d2df88a3a1d4b5cd90c10ba6b522b5455bc12baf77628f59b",
                "MacAddress": "02:42:ac:11:00:06",
                "IPv4Address": "172.17.0.6/16",
                "IPv6Address": ""
            },
            "96db44dc86781f1ec07cf2b8c97dc734226f828cbbfed07e679071850e375b13": {
                "Name": "api.dev.web.1.1556294186",
                "EndpointID": "02471830c3f7b94f77a6b1e9a25eaa6efe812188ebefe28f384837dc2ca18561",
                "MacAddress": "02:42:ac:11:00:04",
                "IPv4Address": "172.17.0.4/16",
                "IPv6Address": ""
            },
            "e48d821df78d102c7fd1790707e4e247a003fb148750f16ebc61d01c16098b45": {
                "Name": "dokku.mongo.mydb",
                "EndpointID": "e03b4825888477b563f7f31b67e53cde7687f663e6f3d8ee6e90ab889063d343",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": ""
            },
            "f45641a87c0dfc4b3f68642e5e80f20dac84d46961015e39f00afd0cd240883c": {
                "Name": "dokku.elasticsearch.myesservice1",
                "EndpointID": "b14619a97e0d41883cc3fc01432c30ee3d0b4650d2442536a22a532a24dab56f",
                "MacAddress": "02:42:ac:11:00:03",
                "IPv4Address": "172.17.0.3/16",
                "IPv6Address": ""
            },
            "ffab08f3b2cc0b5c95fd1a0f2caa70784192b0b9a3a030588122144d3fe85377": {
                "Name": "bo.dev.web.1",
                "EndpointID": "70753fa58f21ad66db1cd67933ded61885a906aad7631d3978b7fefa2fe24a23",
                "MacAddress": "02:42:ac:11:00:07",
                "IPv4Address": "172.17.0.7/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

I finally make the application start with a dokku ps:restart api.dev.web but the ELASTICSEARCH_URL configured during the linking doesn't seem to be reachable:

ConnectionError: getaddrinfo ENOTFOUND dokku-elasticsearch-myesservice dokku-elasticsearch-myesservice:9200
josegonzalez commented 5 years ago

Are you using a custom network of some sort? The plugins almost certainly won't support that, at least without manual editing, and since the core Dokku project doesn't support that out of the box, I don't think I'll have time to debug this issue.

josegonzalez commented 5 years ago

If you want to file a test in this repository as a pull request for replicating this issue, I can maybe dig further, but otherwise I don't have time to dig into this at the moment.

templth commented 5 years ago

No, I don't use a custom network...

josegonzalez commented 5 years ago

Oh I see what you mean.

You'll need to delete the currently existing/created container and then start your service.

templth commented 5 years ago

Yes I finally started the service and app (with the link), but the value in the ELASTICSEARCH_URL isn't a reachable address...

josegonzalez commented 5 years ago

You'll need to unlink and relink.

templth commented 5 years ago

@josegonzalez it works now! thanks for your help!