Disk Usage calculation stuck
-
When I click the "Details" button under Server > Disk Usage it gets stuck at about 25%. The logs show it's hanging at the following line:
box:shell system: /usr/bin/sudo --non-interactive /home/yellowtent/box/src/scripts/du.sh /srv/[redacted]This
/srv/[redacted]directory is configured as a filesystem volume which contains various symlinks, of which:productspoints toproducts_s3fs(this symlink is here as an 'entry point' so i can quickly switch to another target when necessary)products_s3fspoints to/media/path_to_s3fs- a lot of symlinks within subdirectories which point to paths relative to
/app/data/public
I know s3fs isn't officially supported by Cloudron, but in theory
dushould simply skip/ignore these symlinks because they shouldn't resolve anywhere, as these paths only exist at app level. Maybe it gets stuck because of some recursion issue at the first symlink.Maybe the solution is to simply never follow symlinks during disk usage calculation.
Any ideas? Thanks!
-
Hi @joseph,
I've tried:du -DB1 /srv/[redacted]: removed thesto see output, takes a while (it's a lot of symlinks) but it does completedu -B1 /srv/[redacted]: removed theDto no longer follow symlinks, much faster, same end result, does complete as well
Context: SSH session, logged in as root. Tried to log in as 'yellowtent' to retry using sudo but I got 'This account is currently not available.'
-
Since cloudron here just runs the very same
ducommand https://git.cloudron.io/platform/box/-/blob/master/src/scripts/du.sh?ref_type=heads I wonder if there might be some more information in error logs like in/home/yellowtent/platformdata/logs/box.logor maybe some timeouts seen in the browser, which would probably be bugs to fix? -
@nebulon I think I'm seeing where it fails now. I have s3fs mounts set up and the Disk Usage Calculation seems to include these:
Jan 22 12:16:08 box:shell df: df -B1 --output=source,fstype,size,used,avail,pcent,target /mnt/[path_to_s3fs]That will obviously fail (or at least take ages) because
duwill try to navigate my s3fs mounts.Suggestion for a fix:
- Consider removing
Dbecause it slows things down a lot when there's lots of symlinks - In case of mountpoints, instead of
du -DsB1 /mnt/pathyou coulddu -DxB1 /mntwith some additional filtering/grouping, or justdu -DxB1 /mnt | grep /mnt/path(less efficient obviously).
- Consider removing
-
-D only dereferences links in the command line and not inside the filesystem. I guess you want -P which the default.
-D, --dereference-args follow only symlinks that are listed on the command line -P, --no-dereference don't follow any symbolic links (this is the default)Can you please check again if -D is the one which makes such a big difference?