Depenency fails to start due to exiting

G’day,

I’ve started work on a project that started in 2023 and was somewhat abandoned for a while. There are multiple problems due to bitrot, but I’m looking for help with the following error running the build script, which uses docker compose:

dependency failed to start: container elasticsearch_setup exited (0)

I think that exiting is normal in this case. The logs seem to agree:

jr@JR25:~/Code/elastic-bilara$ docker logs --tail 8 elasticsearch_setup 
Setting file permissions
Waiting for Elasticsearch availability
Setting kibana_system password
All done!
Setting file permissions
Waiting for Elasticsearch availability
Setting kibana_system password
All done!

Any help is greatly appreciated.

Well, share your Docker compose file.

Sure:

Did it work before? How about you ask on Github? We don’t know their setup and logic.

Unfortunately the original developers are no longer involved and there’s no one to ask. There is one developer trying to get it finished but I suspect it only works on his machine due to the cache.

Put simply: the elasticsearch_setup container seems to be required to run once for a new install.

Here’s the script it runs:

You can see from the logs that it runs through to the end of the script and exits normally. Here’s the full output of the build script:

jr@JR25:~/Code/elastic-bilara$ make build
WARN[0000] /home/jr/Code/elastic-bilara/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Building 5.1s (22/22) FINISHED                                                                                                                                                                                                                                                                                                                                                  
 => [internal] load local bake definitions                                                                                                                                                                                                                                                                                                                                     0.0s
 => => reading from stdin 2.02kB                                                                                                                                                                                                                                                                                                                                               0.0s
 => [bilara-backend internal] load build definition from backend.dockerfile                                                                                                                                                                                                                                                                                                    0.0s 
 => => transferring dockerfile: 588B                                                                                                                                                                                                                                                                                                                                           0.0s 
 => [bilara-backend internal] load metadata for docker.io/library/python:3.11.3                                                                                                                                                                                                                                                                                                1.0s 
 => [worker_pr internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                                0.0s 
 => [worker_pr 1/9] FROM docker.io/library/python:3.11.3@sha256:3a619e3c96fd4c5fc5e1998fd4dcb1f1403eb90c4c6409c70d7e80b9468df7df                                                                                                                                                                                                                                               0.0s 
 => [worker_pr internal] load build context                                                                                                                                                                                                                                                                                                                                    0.7s 
 => => transferring context: 278.93MB                                                                                                                                                                                                                                                                                                                                          0.7s
 => CACHED [bilara-backend 2/9] RUN pip install --upgrade pip &&     pip install poetry==1.8.5                                                                                                                                                                                                                                                                                 0.0s
 => CACHED [bilara-backend 3/9] RUN poetry config virtualenvs.create false                                                                                                                                                                                                                                                                                                     0.0s 
 => CACHED [bilara-backend 4/9] COPY ./pyproject.toml ./poetry.lock* /app/                                                                                                                                                                                                                                                                                                     0.0s 
 => CACHED [bilara-backend 5/9] WORKDIR /app/                                                                                                                                                                                                                                                                                                                                  0.0s 
 => CACHED [bilara-backend 6/9] RUN poetry lock && poetry install --no-interaction --no-ansi --no-root                                                                                                                                                                                                                                                                         0.0s 
 => CACHED [bilara-backend 7/9] RUN apt-get update &&     apt-get install -y git &&     mkdir -p checkouts/                                                                                                                                                                                                                                                                    0.0s 
 => [bilara-backend 8/9] COPY . .                                                                                                                                                                                                                                                                                                                                              1.0s 
 => [worker_commit 9/9] RUN chmod +x /app/scripts/entrypoint.sh                                                                                                                                                                                                                                                                                                                0.3s
 => [worker_sync] exporting to image                                                                                                                                                                                                                                                                                                                                           0.9s
 => => exporting layers                                                                                                                                                                                                                                                                                                                                                        0.7s
 => => writing image sha256:ab048cedddeddb838e3f6d8151c9be7866d3b1d506a0164c447ae79b22c833cc                                                                                                                                                                                                                                                                                   0.0s
 => => naming to docker.io/library/elastic-bilara-worker_sync                                                                                                                                                                                                                                                                                                                  0.0s
 => [worker_pr] exporting to image                                                                                                                                                                                                                                                                                                                                             0.9s
 => => exporting layers                                                                                                                                                                                                                                                                                                                                                        0.7s
 => => writing image sha256:13453e15d8c5a0ebe5365af8badfbf6c61014e6b8970fab72e79516f7776145e                                                                                                                                                                                                                                                                                   0.1s
 => => naming to docker.io/library/elastic-bilara-worker_pr                                                                                                                                                                                                                                                                                                                    0.0s
 => [worker_commit] exporting to image                                                                                                                                                                                                                                                                                                                                         0.9s
 => => exporting layers                                                                                                                                                                                                                                                                                                                                                        0.7s 
 => => writing image sha256:b5ee782d3db6b9e85d8bc34b5c2d18839e99ef7000f2b8df4ecf233b07dbb4b5                                                                                                                                                                                                                                                                                   0.0s 
 => => naming to docker.io/library/elastic-bilara-worker_commit                                                                                                                                                                                                                                                                                                                0.1s
 => [bilara-backend] exporting to image                                                                                                                                                                                                                                                                                                                                        0.9s 
 => => exporting layers                                                                                                                                                                                                                                                                                                                                                        0.7s 
 => => writing image sha256:ce22a4daca20a2fc7f822c522cb4af13f4bc8739e9326c295593f83f973e412c                                                                                                                                                                                                                                                                                   0.0s 
 => => naming to docker.io/library/elastic-bilara-bilara-backend                                                                                                                                                                                                                                                                                                               0.1s 
 => [worker_sync] resolving provenance for metadata file                                                                                                                                                                                                                                                                                                                       0.2s 
 => [bilara-backend] resolving provenance for metadata file                                                                                                                                                                                                                                                                                                                    0.2s 
 => [worker_commit] resolving provenance for metadata file                                                                                                                                                                                                                                                                                                                     0.1s 
 => [worker_pr] resolving provenance for metadata file                                                                                                                                                                                                                                                                                                                         0.0s 
[+] Running 14/14                                                                                                                                                                                                                                                                                                                                                                   
 ✔ elastic-bilara-worker_sync     Built                                                                                                                                                                                                                                                                                                                                        0.0s 
 ✔ elastic-bilara-bilara-backend  Built                                                                                                                                                                                                                                                                                                                                        0.0s 
 ✔ elastic-bilara-worker_commit   Built                                                                                                                                                                                                                                                                                                                                        0.0s 
 ✔ elastic-bilara-worker_pr       Built                                                                                                                                                                                                                                                                                                                                        0.0s 
 ✔ Container redis                Running                                                                                                                                                                                                                                                                                                                                      0.0s 
 ✔ Container elastic-bilara-db-1  Running                                                                                                                                                                                                                                                                                                                                      0.0s 
 ✔ Container nginx                Running                                                                                                                                                                                                                                                                                                                                      0.0s 
 ✔ Container elasticsearch        Running                                                                                                                                                                                                                                                                                                                                      0.0s 
 ✔ Container worker_sync          Recreated                                                                                                                                                                                                                                                                                                                                    0.3s 
 ✔ Container worker_pr            Recreated                                                                                                                                                                                                                                                                                                                                    0.3s 
 ✔ Container worker_commit        Recreated                                                                                                                                                                                                                                                                                                                                    0.3s 
 ✔ Container kibana               Running                                                                                                                                                                                                                                                                                                                                      0.0s 
 ✔ Container bilara-backend       Recreated                                                                                                                                                                                                                                                                                                                                   10.3s 
 ✘ Container elasticsearch_setup  Error                                                                                                                                                                                                                                                                                                                                        1.7s 
dependency failed to start: container elasticsearch_setup exited (0)
make: *** [Makefile:21: build] Error 1

Has anything changed in the past couple of years that would cause this? Like exiting normally becoming an error?

I can actually build the project if I comment out these lines:

  elasticsearch:
#    depends_on:
#      setup:
#        condition: service_healthy

docker compose up then runs, and includes this output:

elasticsearch_setup  | Setting kibana_system password
elasticsearch_setup  | All done!
elasticsearch_setup exited with code 0  

It looks like this is an issue with the shell scripts that generate certificates, not a docker problem.

Thanks again!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.