External Email - Use Caution
Hi all,
I’m running recon-all inside a Docker container, but it fails with the following error when launched programmatically through an SDK:
ERROR: Invalid FreeSurfer license key found in license file /usr/local/freesurfer/license.txt If you are outside the NMR-Martinos Center, go to http://secure-web.cisco.com/1caZqJPIIzERnX6myZfn7lHvJljbS0zsXzR6nmSo47CLhLQR... to get a valid license file (it's free). If you are inside the NMR-Martinos Center, make sure to source the standard environment.
The command used by the SDK looks like this: docker run -v /usr/local/lib/python3.10/dist-packages/xxxx/execution/communication.patch:/usr/local/lib/python3.11/dist-packages/xxxx/sdk/communication.py:ro \ --cap-drop=NET_RAW -dt --name analysis_1420668 --entrypoint /bin/bash \ --cpus=4 --memory=16384m \ europe-west3-docker.pkg.dev/xxxx/freesurfer_530:dev-1.0 \ /xxxx/entrypoint.sh --project 2289 --analysis 1420668 \ --token xxxx --url https://secure-web.cisco.com/1_ZG55biN3BILRStBLxIfao5TAMons8aRRsmdYirMJ90OwD... \ --tool-path tool:run
However, when I start the container manually (e.g., docker run -it ... /bin/bash) and run recon-all inside it directly, the license is detected and validated correctly. So the license.txt file at /usr/local/freesurfer/license.txt itself appears to be valid. This suggests the issue is related to *how the container is executed by the SDK or entrypoint*, possibly involving the entrypoint script /xxx/entrypoint.sh altering the environment before recon-all starts.
The Docker container has: Ubuntu 22.04 Python 3.11
Has anyone seen a similar issue where FreeSurfer fails to validate the license only when invoked non-interactively?
Are there specific environment variables or checks that recon-all performs which might differ when running under /bin/bash -c or through an SDK wrapper?
Any insights or debugging suggestions would be greatly appreciated.
Thanks!