This document describes known limitations, edge cases, and potential pitfalls when using chell. These are important for users and developers to understand to avoid data loss or unexpected behavior.
CRITICAL: Renaming a directory that contains files will orphan those files in the ChRIS backend.
When you rename a directory using mv, the directory path is updated in the ChRIS database, but the paths of all files and subdirectories inside it are not automatically updated. This causes the contents to become inaccessible.
# Initial state: directory with files
$ ls uploads/
file1.txt file2.txt subdir/
# Move/rename the directory
$ mv uploads backup
# Contents are now orphaned!
$ cd backup
$ ls
# Shows nothing - files still have path /home/user/uploads/file1.txt
# but directory is now /home/user/backupThis is a ChRIS backend limitation, not a chell bug. The ChRIS filesystem stores absolute paths for all resources. When a directory is renamed:
-
The directory resource path is updated:
/home/user/uploads→/home/user/backup -
File resources inside still reference old path:
/home/user/uploads/file1.txt -
Files become orphaned because their parent path no longer exists
If you accidentally rename a directory with contents:
# Rename back to original name
$ mv backup uploads
# Files should reappear
$ cd uploads
$ ls -f # Force cache refresh
file1.txt file2.txt subdir/Important: Recovery only works if you remember the exact original name.
Instead of renaming the directory, move the files inside:
# Create new directory
$ mkdir backup
# Move files (not the directory)
$ mv uploads/* backup/
# Remove empty directory
$ rm -rf uploadsFiles and directories with spaces in their names require special handling in chell, just like Unix shells.
# Wrong - treats as multiple arguments
$ mv uploads/Feed for file.dcm backup/
# Correct - use quotes
$ mv "uploads/Feed for file.dcm" backup/
# Also correct - use single quotes
$ mv 'uploads/Feed for file.dcm' backup/
# Also correct - escape spaces
$ mv uploads/Feed\ for\ file.dcm backup/The cd command has a special workaround - it joins all arguments with spaces:
# This works without quotes for cd
$ cd Feed for file directory
# But other commands still need quotes
$ rm "Feed for file directory"Recommendation: Always use quotes for paths with spaces to be consistent.
# This fails - thinks --file is a flag
$ rm --filename
# Correct - use -- to mark end of options
$ rm -- --filename
# Also works with paths
$ rm ./--filename
$ rm /full/path/--filenameIf files are modified outside chell (web UI, API, another chell session), you may see stale data:
# Another user/session adds files...
# You see old data
$ ls
# Force refresh
$ ls -fDirectories with thousands of files may be slow:
# First ls is slow (API call)
$ ls huge_directory/ # 2-5 seconds
# Subsequent ls is fast (cached)
# cache will invalidate after timeout
# and after any fs operations that change
# files (cp/mv/etc)
$ ls huge_directory/ # < 100msGeneric "Internal server error" from ChRIS backend can mean:
-
Invalid path
-
Permission denied
-
Directory doesn’t exist
-
File already exists
-
Backend bug
Workaround: Check operation carefully and retry. Use ls -f to refresh state.
# Best practice of all is just don't put spaces in file or dir names
mv "source with spaces" "dest with spaces"# BAD - will orphan files
$ mv uploads backup
# GOOD - move contents first
$ mkdir backup
$ mv uploads/* backup/
$ rm -rf uploadsIf you encounter bugs or unexpected behavior:
-
Note exact command sequence
-
Check current directory with
pwd -
Try
ls -fto refresh cache -
Report to: https://github.com/FNNDSC/chell/issues