I think it is related to this issue - https://github.com/freesurfer/freesurfer/issues/892
The bug has been fixed since FS 7.3.2. See this PR to fix your local recon-all - https://github.com/freesurfer/freesurfer/pull/886/changes
I think you can also workaround the bug by setting FREESURFER environment variable to FREESURFER_HOME before submitting recon-all.
From: Wales, Ryan ryan.wales@mssm.edu Sent: Monday, March 2, 2026 5:16 PM To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Re: FREESURFER: undefined variable
External Email - Use Caution For some reason, the error didn’t show up in the log. When I ran the command in my terminal, the very next line (after the end of the log) said “FREESURFER: undefined variable”.
From: Huang, Yujing <YHUANG43@mgh.harvard.edumailto:YHUANG43@mgh.harvard.edu> Date: Monday, March 2, 2026 at 4:41 PM To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: [Freesurfer] Re: FREESURFER: undefined variable I don’t see the error in the recon-all.log.
From: Wales, Ryan <ryan.wales@mssm.edumailto:ryan.wales@mssm.edu> Sent: Monday, March 2, 2026 2:13 PM To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: [Freesurfer] Re: FREESURFER: undefined variable
External Email - Use Caution Hi Yujing,
It is attached. Let me know if there’s any other data I can provide. Thanks!
Ryan
From: Huang, Yujing <YHUANG43@mgh.harvard.edumailto:YHUANG43@mgh.harvard.edu> Date: Monday, March 2, 2026 at 12:12 PM To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Subject: [Freesurfer] Re: FREESURFER: undefined variable USE CAUTION: External Message. It is not clear which command caused that error. Can you send your recon-all.log?
From: Wales, Ryan <ryan.wales@mssm.edumailto:ryan.wales@mssm.edu> Sent: Sunday, March 1, 2026 7:26 PM To: freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] FREESURFER: undefined variable
External Email - Use Caution Hi,
I’m trying to run FreeSurfer (v. 7.2.0) longitudinally, first creating the base template for my sample subject across both timepoints, using: recon-all -base sub_01-tp sub-01_ses-01_t1 -tp sub-01_ses-02_t1 -all
Both cross-sectional timepoints were previously run separately. Just after ‘mri_pretess’ finishes, I encounter the error: “FREESURFER: Undefined variable”.
I’m running FreeSurfer on my organization’s HPC, and I’ve ensured that SUBJECTS_DIR and FREESURFER_HOME are both set appropriately.
I found another post with the same error, but they also had “nu_correct: Command not found”, unlike me. Both of us are using v. 7.2.0. https://www.mail-archive.com/freesurfer@nmr.mgh.harvard.edu/msg76646.htmlhttps://secure-web.cisco.com/1O8k9p6IS7uLUjZ06OABt9WCVWBkTWN6l288ThbE0v8H0j33-Av_RSD_eSjsrdt3JFbWPFxAn3Q7fMm2_E1vzV74nxtaUy3pWWz8i2lCo10ZmC6URbblWmWZEf1Eq18sxrRzYbj3vpWcOCcauRhNEZGXzs6Hzu6EFOntK9Xm0LubHtmDv_kVgh70RjzlDC55iTIsv42Dn9BT2mUcPp2oRBpar6Ql_aAOZZ5qAMBApjte1ol0CO5cecD_osAXsX-cDs3aCqBVFyZzcRSYO_HYwti_Uju1ST1B-JVEFltgfa6-U-tucHPExhbPwMEuWhlPNweuL_jiQykUWQ71cOVMDcA/https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-3A__secure-2Dweb.cisco.com_1KfETP9AssoehTvJ3VhjCNZJJg3rReFE0UsHzbxBF1de4xGTUNpeFsLLK0GXlkaifVOAnnjXP0RnwLdnVzXal-2D00na-5Figsf3pd-5FmENhSfiNV2NeGJlYN-2Df0DD4r8-2DGTdC39N-5FoG5VkfkSLSNl-5FrhI94SLOcuPw5e-2D3MDd6nXX3tHD-5FV3dmGPIweVJ7eiTIOGwW-5F3BP3ygjuI48GKHZe-5F0d4zCv9yhCD-2Dt5G9-5FnF0ytz8bONPAgHgqLrNUnIztQwMa2-5FwKmmIQCbQxQUM7VpximrARTImzgMX35-2DizOLs-2DE-2DluWfEVmgGCw-2DQyBOOFCgsm8Ubeb2pslf8pCfWVkzKqpA_https-253A-252F-252Fwww.mail-2Darchive.com-252Ffreesurfer-2540nmr.mgh.harvard.edu-252Fmsg76646.html%26d%3DDwMFAg%26c%3DshNJtf5dKgNcPZ6Yh64b-ALLUrcfR-4CCQkZVKC8w3o%26r%3Dda1OysULLVt4-104__5UCZgndjKV6BfO7U4feeDo510%26m%3DGAasydl5JCuok5N_tiIPDcQhX6tD3IrZoHdntNliGdbkwkv-WBXJBGIR8E8267pf%26s%3DozoO8sSI8mberJJurnpV-b5SXvCWw5BRZqdFgpnravM%26e%3D
Can’t figure this one out. Thanks all!
Best, Ryan Wales ________________________________ Confidentiality Notice: This electronic mail transmission and any documents, files, or previous email messages attached to it may contain confidential information and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, or a person responsible for delivering such information to the intended recipient, you are hereby notified that any further review, disclosure, copying, dissemination, distribution, or use of any of the information contained in or attached to this email transmission is strictly prohibited. If you have received this message in error, please notify the sender immediately by email, discard any paper copies, and delete all electronic files of the message. Thank you for your cooperation.