Closed daviddavo closed 6 months ago
Hi @daviddavo, unfortunately I don't know what docker swarm is and what it does. I currently don't think there is a leak tbh. My own installation is running for more than a year now without this issue. If I remember correctly, docspell opens by default 10 connections per service to postgres. It then uses these to serve all requests, so it should not create more connections than that. But it could be that postgres is configured to not allow so many connections, i.e. if other apps are accessing it?
Yes, it was a configuration problem that made it impossible to connect.
If someone comes here from google search, the problem was that my device had two IP's and it was replying from an IP different that the one the request was being made to.
A docker swarm lets you replicate services into tasks, using multiple servers. When everything is working fine for some time, I'll write a tutorial on how to use it, thank you!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. This only applies to 'question' issues. Always feel free to reopen or create new issues. Thank you!
I tried using a docker swarm to run Docspell, but after a couple of hours I get this error in the postgress container:
My docker-compose.yml is:
```yml version: "3.8" volumes: docspell-postgres_data: docspell-solr_data: networks: overlay_proxy: external: True driver: overlay overlay_docspell: external: True driver: overlay services: # The restserver and joex containers defined here are configured # using env variables. Both must connect to the same database and # solr instance. More information on configuring can be found here: # https://docspell.org/docs/configure # # Please replace the values of the following with a custom secret # string: # # - DOCSPELL_SERVER_ADMIN__ENDPOINT_SECRET # - DOCSPELL_SERVER_AUTH_SERVER__SECRET # - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_HEADER__VALUE # (use the same value at the consumedir container!) # # After creating an account, you may want to set signup mode to # "closed" or to "invite". When using invite, you must also set # DOCSPELL_SERVER_BACKEND_SIGNUP_NEW__INVITE__PASSWORD to some # secret. restserver: image: docspell/restserver:latest container_name: docspell-restserver restart: unless-stopped networks: - overlay_proxy - overlay_docspell ports: - "7880:7880" environment: - TZ=Europe/Berlin - DOCSPELL_SERVER_INTERNAL__URL=http://docspell-restserver:7880 - DOCSPELL_SERVER_ADMIN__ENDPOINT_SECRET=[REDACTED] - DOCSPELL_SERVER_AUTH_SERVER__SECRET= - DOCSPELL_SERVER_BACKEND_JDBC_PASSWORD=[REDACTED] - DOCSPELL_SERVER_BACKEND_JDBC_URL=jdbc:postgresql://db:5432/dbname - DOCSPELL_SERVER_BACKEND_JDBC_USER=dbuser - DOCSPELL_SERVER_BIND_ADDRESS=0.0.0.0 - DOCSPELL_SERVER_FULL__TEXT__SEARCH_ENABLED=true - DOCSPELL_SERVER_FULL__TEXT__SEARCH_SOLR_URL=http://solr:8983/solr/docspell - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_ENABLED=true - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_ENABLED=true - DOCSPELL_SERVER_INTEGRATION__ENDPOINT_HTTP__HEADER_HEADER__VALUE=[REDACTED] - DOCSPELL_SERVER_BACKEND_SIGNUP_MODE=invite - DOCSPELL_SERVER_BACKEND_SIGNUP_NEW__INVITE__PASSWORD=[REDACTED] - DOCSPELL_SERVER_BACKEND_ADDONS_ENABLED=false depends_on: - solr - db joex: image: docspell/joex:latest container_name: docspell-joex ## For more memory add corresponding arguments, like below. Also see ## https://docspell.org/docs/configure/#jvm-options # command: # - -J-Xmx2G restart: unless-stopped networks: - overlay_docspell environment: - TZ=Europe/Berlin - DOCSPELL_JOEX_APP__ID=joex-{{.Node.Hostname}} - DOCSPELL_JOEX_PERIODIC__SCHEDULER_NAME=joex-{{.Node.Hostname}} - DOCSPELL_JOEX_SCHEDULER_NAME=joex-{{.Node.Hostname}} - DOCSPELL_JOEX_BASE__URL=http://docspell-joex:7878 - DOCSPELL_JOEX_BIND_ADDRESS=0.0.0.0 - DOCSPELL_JOEX_FULL__TEXT__SEARCH_ENABLED=true - DOCSPELL_JOEX_FULL__TEXT__SEARCH_SOLR_URL=http://solr:8983/solr/docspell - DOCSPELL_JOEX_JDBC_PASSWORD=[REDACTED] - DOCSPELL_JOEX_JDBC_URL=jdbc:postgresql://db:5432/dbname - DOCSPELL_JOEX_JDBC_USER=dbuser - DOCSPELL_JOEX_ADDONS_EXECUTOR__CONFIG_RUNNER=docker,trivial - DOCSPELL_JOEX_CONVERT_HTML__CONVERTER=weasyprint # - DOCSPELL_JOEX_TEXT-ANALYSIS__NLP__MODE=regexonly - DOCSPELL_JOEX_SCHEDULER__POOL-SIZE=2 ports: - "7878:7878" depends_on: - solr - db deploy: mode: replicated replicas: 3 placement: max_replicas_per_node: 1 constraints: - node.labels.transcode_worker == true resources: limits: cpus: '2' ## Uncomment when using the "docker" runner with addons # volumes: # - /var/run/docker.sock:/var/run/docker.sock # - /tmp:/tmp # Use the following command to check number of connections # psql -U dbuser dbname -c 'select COUNT(*) from pg_stat_activity' db: image: postgres:16.2 container_name: postgres_db restart: unless-stopped networks: - overlay_docspell volumes: - docspell-postgres_data:/var/lib/postgresql/data/ environment: - POSTGRES_USER=dbuser - POSTGRES_PASSWORD=[REDACTED] - POSTGRES_DB=dbname deploy: placement: constraints: - node.labels.has_docspell_db == true healthcheck: test: ["CMD-SHELL", "pg_isready -ddbname -U dbuser"] interval: 10s timeout: 5s retries: 5 solr: image: solr:9 container_name: docspell-solr restart: unless-stopped networks: - overlay_docspell volumes: - docspell-solr_data:/var/solr command: - bash - -c - 'precreate-core docspell; exec solr -f -Dsolr.modules=analysis-extras' healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8983/solr/docspell/admin/ping"] interval: 1m timeout: 10s retries: 2 start_period: 30s ```The overlay_docspell network was created to be able to run containers and access the integrations without publishing the docspell port, which will be hidden behind a reverse proxy.