Open flckv opened 5 months ago
Hi @flckv,
Thanks for the issue!
I haven't been able to reproduce this quickly (though I'll keep trying), but in the meantime, you could try the following steps to diagnose the issue:
Open an interactive shell in the api
container:
docker exec -it <container-id> /bin/bash
Check GROBID service response, to see if it is reachable from the api
container.
curl -v http://grobid:8070/api/version
Check docker network configuration:
docker network ls # ID for 'figura11y-default'
docker network inspect <network-id>
Ensure that the grobid
container is on the same network as the api
container.
Let me know what you find; glad to help debug further.
Thank you, @nikhilsinghmus
docker network ls
NETWORK ID NAME DRIVER SCOPE
27642bad6499 bridge bridge local
0d84bfa12447 figura11y_default bridge local
24285f91f8d9 host host local
f97d5204b0d7 none null local
docker network inspect 0d84bfa12447
[ { "Name": "figura11y_default", "Id": "0d84bfa12447f3b734dcb0f0842a70affef9b2e52cf466b973900f03b8d0acf1", "Created": "2024-06-08T13:58:58.702392502Z", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.19.0.0/16", "Gateway": "172.19.0.1" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": { "36b7284bfca535e779d099c7173c50ac953e6b98e76a4296f217e90f382380de": { "Name":
"figura11y-ui-1",
"EndpointID": "0a5cb7f7df8de563d211ae7417cf5a63153fbd5f21dd282705a9d1c1c666accc", "MacAddress": "02:42:ac:13:00:04", "IPv4Address": "172.19.0.4/16", "IPv6Address": "" }, "3e001f128dd8054d2168a313083317fb8af36964111d804250828ac67047a642": { "Name":"figura11y-db-1"
, "EndpointID": "ed03ccfcf14004148a2b70311afeecc8c74b872447dc9b9758c55e45c2b6e98f", "MacAddress": "02:42:ac:13:00:03", "IPv4Address": "172.19.0.3/16", "IPv6Address": "" }, "76644cc8a8bee5da86d12c113bfba2d02fae3d496c7d85309d19839bba04e942": { "Name":"figura11y-api-1",
"EndpointID": "727bbdcb03d48cb21c593b29312d38e981eff528fbb236443dc1cc2cf01b18da", "MacAddress": "02:42:ac:13:00:02", "IPv4Address": "172.19.0.2/16", "IPv6Address": "" }, "92048cacbab52f9a59262d3cc7b17ce764e1b61126bdfc8462be96879080df75": { "Name":"figura11y-proxy-1",
"EndpointID": "f48547c4f60b887530475e391d137fa73061b3d97ffdc49ba3768fa9bec04b82", "MacAddress": "02:42:ac:13:00:06", "IPv4Address": "172.19.0.6/16", "IPv6Address": "" } }, "Options": {}, "Labels": { "com.docker.compose.network": "default", "com.docker.compose.project": "figura11y", "com.docker.compose.version": "2.27.0" } } ]
GROBID STILL RUNNING but no connection:
GROBID STOPPED:
Thank you for the update, @flckv! I wonder if the GROBID container is running out of memory, perhaps? Could you try increasing the memory for Docker, and seeing if that resolves it?
Thank you @nikhilsinghmus, I switched to a larger RAM (24GB) hardware. I am using the same figura11y repo setup, but face different issue: I face issue with the the db and sqlalchemy:
podman start -a figura11y_db_1
2024-06-23 14:37:35.766 UTC [1] LOG: starting PostgreSQL 15.7 (Debian 15.7-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
2024-06-23 14:37:35.767 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2024-06-23 14:37:35.767 UTC [1] LOG: listening on IPv6 address "::", port 5432
2024-06-23 14:37:35.768 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-06-23 14:37:35.771 UTC [24] LOG: database system was shut down at 2024-06-23 14:37:26 UTC
2024-06-23 14:37:35.782 UTC [1] LOG: database system is ready to accept connections
podman start -a figura11y_api_1
Error: Could not import 'api.db'.
podman start -a figura11y_grobid_1
Error: unable to start container 47115bdcaad81c8b1462865db84a2499fcf7fb18f7ab7995fe74000a8d0f5233: generating dependency graph for container 47115bdcaad81c8b1462865db84a2499fcf7fb18f7ab7995fe74000a8d0f5233: container aa79618ce092122dddfeec9b97259295146b14c951de24e5b2f064ab36fef562 depends on container 396de865c1e8ed1ed96cd5014090652544ed3db20df2da88b87c5a80475b8786 not found in input list: no such container exit code: 1 exit code: 125 Neither CUDA nor MPS are available - defaulting to CPU. Note: This module is much faster with a GPU.
[Wapiti] Loading model: "/opt/grobid/grobid-home/models/citation/model.wapiti"
[2024-06-23 14:38:07 +0000] [5] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py",
line 145, in init
self._dbapi_connection = engine.raw_connection()
^^^^^^^^^^^^^^^^^^^^^^^
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker worker.init_process()
sqlalchemy.exc.OperationalError:
(psycopg2.OperationalError) could not translate host name "db" to address: Name or service not known
(Background on this error at: https://sqlalche.me/e/20/e3q8)
[2024-06-23 14:38:07 +0000] [5] [INFO] Worker exiting (pid: 5) [2024-06-23 14:38:10 +0000] [1] [ERROR] Worker (pid:5) exited with code 3 [2024-06-23 14:38:10 +0000] [1] [ERROR] Shutting down: Master [2024-06-23 14:38:10 +0000] [1] [ERROR] Reason: Worker failed to boot. exit code: 3 2024-06-23 14:42:35.863 UTC [22] LOG: checkpoint starting: time 2024-06-23 14:42:35.870 UTC [22] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.001 s, sync=0.002 s, total=0.008 s; sync files=2, longest=0.002 s, average=0.001 s; distance=0 kB, estimate=0 kB
Hi @flckv, thanks for the update! It looks like there's a difference in our setups; the project is designed and tested using Docker with docker compose up --build
, but it looks like you're using podman
and starting containers individually?
I think this difference is likely causing the problems. To resolve this, if possible, could you try installing Docker and Docker Compose, then run docker compose up --build
?
Or alternatively, it might work with Podman Compose with podman-compose up --build
; I did a quick test of this, and found that it worked.
Let me know if this might resolve it, or if I might have misinterpreted something.
Thank you @nikhilsinghmus.
True I run the podman-compose(rootless setup) in combination with podman(root setup) file with podman-compose that initiates command e.g.:podman create --name=figura11y_db_1 ...
The setup is because of:
Hi @flckv, thanks for following up! Would you mind running the network checks I mentioned initially, here in podman? E.g. podman network ls
and podman network inspect <network-id>
. Another thing you could try is podman exec figura11y_api_1 getent hosts db
to see if it's able to resolve the db hostname.
I'm not able to reproduce the issue with podman==5.1.1
and podman-compose==1.0.6
. Can you confirm what versions you are using?
Thank you @nikhilsinghmus,
podman-compose ps
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.5.1
podman network ls
podman network inspect figura11y_default
"subnet": "10.89.0.0/24", "gateway": "10.89.0.1"
podman inspect figura11y_api_1
figura11y_api_1 EXITED (left)
figura11y_api_1 RUNNING for few second (right)
figura11y_api_1 getent hosts db
Thank you, @flckv! I tried testing with that version of Podman, but ran into some issues on my machine (though I'll try again). Would you be able to try upgrading and testing with a newer version?
Additionally, one other thing to check might be your installation of netavark (default network stack) and aardvark-dns (DNS server). I think podman-compose will rely on these for name resolution between containers (e.g. db
, where the issue seems to be). I'm still getting familiar with the Podman ecosystem, so I appreciate your patience while working through this!
Thank you @nikhilsinghmus,
I noticed that figura11y_proxy_1
exists immediately:
right after few second later the figura11y_api_1 exists too
I also noticed that upon command:
podman images
podman inspect <image id>
there the proxy is on port 80 that is less than 1024:
butsonar
exposes ports:
"3000/tcp": {},
"8000/tcp": {},
"8080/tcp": {}
because I added lines:
" Podman can not create containers that bind to ports < 1024." from rootless.md
ports 3000, 8000 and 8080 do not seem to be accessible by proxy only 5432 and 8070 :
How is it possible that the figura11y_db_1 keeps running on port 0.0.0.0:5432->5432/tcp but the error is related to db ?
Is unprivileged ping needed for this project I saw the sonar was using command ping.py
?
I have run it on a third computer and I noticed that the very first issue is the api.db
is not imported. Then I rerun it in the previous two machines and I noticed that I overlooked that that is the first issue on those machines too.
Do you also see this error log on your end ?
Hi @flckv, sorry for the slow response! Re: the api.db issue, I think that's related to the flask-migrate
commands in dev.sh
/start.sh
. I think you may not need them, so if you comment out the lines beginning with flask db
, it should avoid that. The flask server and db connection should still run either way though, so I'm not sure it will resolve the main issue!
Did you find that the whole setup runs on the third machine, or are you running into the same issue?
great work, thank you for sharing.
I think the grobid is running :
but the
api-1 | File "/api/app/api/document.py", line 41, in get_figures api-1 |
paragraphs, metadata = PDF2TextService().parse_paragraphs(pdf_path)
api-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ api-1 |File "/api/app/services/pdf2text.py", line 105, in parse_paragraphs
api-1 | response = requests.post(url, files=files)File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send api-1 | raise ConnectionError(e, request=request) api-1 | requests.exceptions.###
ConnectionError: HTTPConnectionPool(host='grobid', port=8070):
More
Max retries exceeded with url: /api/processFulltextDocument (Caused by NewConnectionError('any suggestions on this?