Troubleshooting: Difference between revisions

From CCN Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 25: Line 25:
#*Especially when files are concerned, the program output often displays the name of the file it was told to work on. If you see a message along the lines of "cannot stat such-and-such" or 'file not found', look to see what file it was looking for, and what files exist.
#*Especially when files are concerned, the program output often displays the name of the file it was told to work on. If you see a message along the lines of "cannot stat such-and-such" or 'file not found', look to see what file it was looking for, and what files exist.
#*Could be a typo in the file name; could be that the program was supposed to be run from a specific directory (this happens often)
#*Could be a typo in the file name; could be that the program was supposed to be run from a specific directory (this happens often)
#Missing variables?https://ccn-wiki.caset.buffalo.edu/index.php?title=Troubleshooting&action=edit
#Missing variables?
#*For FREESURFER processing, half the time I forget to set <code>SUBJECTS_DIR</code>, causing the scripts to fail to find the subject whose folder is staring me right in the face.
#*For FREESURFER processing, half the time I forget to set <code>SUBJECTS_DIR</code>, causing the scripts to fail to find the subject whose folder is staring me right in the face.
#*Many of the MATLAB scripts have been poorly written (by yours truly) to require a fixed set of arguments in a fixed order. Missing or incorrectly-specified parameters to these programs are likely to cause errors.
#*Many of the MATLAB scripts have been poorly written (by yours truly) to require a fixed set of arguments in a fixed order. Missing or incorrectly-specified parameters to these programs are likely to cause errors.

Latest revision as of 16:25, 16 June 2022

Have you tried turning it on and off again?

Common Software Problems

Matlab

There's a couple known bugs involving MATLAB and recent versions of Ubuntu. The first is an error message about failing to load canberra-gtk. This doesn't cause any problems, but if this annoys you, here is the solution:

export GTK_PATH=/usr/lib/x86_64-linux-gnu/gtk-2.0

Add this to your .bashrc or something.

Another problem is a libGL error. This can be remedied by creating a ~/.drirc file:

.dlrc file

<driconf>
 <device driver="loader" kernel_driver="i915">
   <option name="dri_driver" value="i965" />
 </device>
</driconf>

Protips

Having computer problems? Here's a few things to try

  1. Can you replicate the problem?
    • If the problem comes and goes randomly, it's going to be amazingly more difficult to diagnose. Try and figure out the conditions under which the problem occurs and fails to occur. This will be a clue
  2. Are you using the most up-to-date versions of any scripts or functions?
    • You will find updated copies in the ubfs folder. Maybe you're experiencing a bug that has since been fixed.
    • Be in the habit of keeping your ~/bin and ~/Documents/MATLAB folders updated
  3. Typo?
    • Many of the commands you will type in will involve long file names and parameter sets. You're probably 99.9% certain you typed the command in correctly. Be 100% certain.
    • Especially when files are concerned, the program output often displays the name of the file it was told to work on. If you see a message along the lines of "cannot stat such-and-such" or 'file not found', look to see what file it was looking for, and what files exist.
    • Could be a typo in the file name; could be that the program was supposed to be run from a specific directory (this happens often)
  4. Missing variables?
    • For FREESURFER processing, half the time I forget to set SUBJECTS_DIR, causing the scripts to fail to find the subject whose folder is staring me right in the face.
    • Many of the MATLAB scripts have been poorly written (by yours truly) to require a fixed set of arguments in a fixed order. Missing or incorrectly-specified parameters to these programs are likely to cause errors.
  5. Hidden files?
    • This is a new one. All operating systems have a mechanism for hiding files, and on a Mac and Linux, that mechanism is to have a file or folder name starting with a '.' (period) character. I assume there's a good reason for it, but Mac OSX, in particular, makes all sorts of hidden shadow files when copying files around. For example, copying My_File.txt might also create a second hidden file called ._My_File.txt. Even though it might not show up when looking in a file directory, your shell or MATLAB scripts might detect these files. I just wasted a whole bunch of time because an SPM script was detecting both orig.nii and the hidden ._orig.nii files in the same directory. Moral of the story: if you have copied a bunch of files to/from a Mac, you might want to recursively delete any hidden files:
for file in `find ./ -name "._*"`; do rm $file; done