Closed alyssadai closed 8 months ago
Some issues encountered:
the node API-graph stack needs to be explicitly launched as a non-root user, to be able to write to our shared FS (otherwise, files are written as the nobody
user, which causes permission errors):
CURRENT_UID=$(id -u):$(id -g) docker compose up -d
the f-API in a container/compose network cannot reach the n-API inside its own network using the host.docker.internal
syntax
when compose networks (for local node and federation) are spun up with default network settings, sometimes the resulting IP range used by the subnet conflicts with the one used by the network FS (/data/origami
)
Check out:
See new Docker/Docker Compose troubleshooting tips documented here, based on encountered problems that were resolved: https://github.com/neurobagel/documentation/wiki/Docker#troubleshooting-dockerdocker-compose-recipes
Some things learned about our own tools/machines:
neurobagel-node
and st-viateur
:(Query tool)
local_federation
Compose recipe is used, the resulting query tool cannot access the f-API when API_QUERY_URL
is set to localhost:<fAPI port on host>
, even though this is the default recommended in https://neurobagel.org/federate/#fedenv
federation
with the internal port, or host.docker.internal
with the published portAPI_QUERY_URL
must be set to the public IP of the machine on which the f-API is running (followed by the <fAPI port on host>
), or the subdomain for the f-API if NGINX is set up on the machinelatest
image has not been updated following the breaking change https://github.com/neurobagel/query-tool/pull/343, and as a result cannot fetch the node list from the f-API -> solution is to switch to using nightly
imagelatest
f-API imagelatest
version includes support for the new mixed-response structure for cohort queries (/query/
), but not for /attributes/{data_element_URI}
queries (which was added after we switched the default tag to nightly
) - consequently, it looks like the /attributes/{data_element_URI}
route in the image doesn't know how to handle responses of the now-async CRUD function which is used by both endpoints/attributes/{data_element_URI}
endpoint already stopped working)(f-API)
/attributes/{data_element_URI}
endpoint not working (Internal Server Error
) for latest
image, due to same issue as in 3 above
/usr/local/lib/python3.10/site-packages/httpx/_client.py:1481: RuntimeWarning: coroutine 'send_get_request' was never
awaited for pattern, transport in self._mounts.items():
...
File "/usr/src/./app/api/crud.py", line 159, in get_terms for term in list_of_terms[data_element_URI]:
TypeError: 'coroutine' object is not subscriptable
neurobagel-node
only:(UNRESOLVED)
local_federation
recipe) cannot access services on host.docker.internal
local_nb_nodes.json
workshost.docker.internal
successfully resolves to whatever the bridge network IP address is, but services with published ports on the host still can't be reachedThanks a lot @alyssadai for digging through all of these issues / debugging the docker networking problems we encountered with this deployment! This will likely be very useful for some users!
Check out:
502 Bad Gateway
502 Bad Gateway
I think NGINX for the query and federate API is not feeling well.
Within the node API, all query endpoints work correctly - datasets are shown in protected mode as expected!
Thanks very much also for documenting these problems. I think we should start collecting some of these things that are more edge cases / problems that we are not going to build generic solutions for, and then put them in the user docs - e.g. in a FAQ or "Common Problems" section.
@alyssadai, could you please
host.docker.internal
issue - ideally with a minimally reproducible description. Goal isn't to fix, but to have as reference for when we encounter again in the near futureAnd then let's close with excitement (our Douglas friends are already inquiring when we're ready for them) -> 🧑🍳
Thanks Seb!
The query tool and federate API should be working now - I think you tested it the other night just as I was playing around with the .env variables and relaunching containers (which probably wasn't smart timing on my part haha).
Here are the new issues:
/etc/nginx
- maybe there's a way to grant permissions just for this folder?/data/origami/neurobagel_root
rwx
permissions forneurobagel
group automaticallyneurobagel/recipes
->bic_pd
Need root:
[x] restart nginx service
[x] set up HTTPS
[ ] add new subdomains to uptime robot -> maybe not for now since the node is not meant to be public?