One of my fileshares (Movies) shows an incorrect size in the new UI:
[root@Nethserver ibay]# du -hs *
[root@Nethserver ibay]# find Movies/ -type f | wc -l
I can’t reproduce, but it should be relative to this code: https://github.com/NethServer/nethserver-samba/blob/master/api/lib/samba_functions.pl#L34
I think it’s a bug in duc indexing or in our xml parser.
Could you please post on a gist (or somewhere else) the out of:
- /usr/bin/duc xml -x -d /var/cache/duc/duc.db /var/lib/nethserver/ibay
- du -hs /var/lib/nethserver/ibay/*
Think I found the issue.
One of my fileshares is called Movies. However, there is a subdirectory inside one of the other fileshares also called Movies.
And guess what, that subdirectory has 56 (yep, the duc counts are off by 1) files in it and is around 1.4G. So when traversing the duc output, the data for the top level Movies is then overwritten by the data from the embedded subdirectory.
Thanks, I will try to reproduce!
I’ve tried to create subdirectories with the same name but I didn’t reproduce it.
Can you give me a list of commands to reproduce?
Not a list of commands, but (what I think is) the condition needed.
Run the duc command you posted earlier. Note which ibay is listed first, then make a sub-directory of exactly the same name in one of the subsequent ibays that appear later in the output. Preferably not the only/first sub-directory as I think the parser has to process a child end-tag in the second ibay before it processes the duplicate directory name.
The code attempts to limit the parsing to only the top level directory, but a sub-directory end-tag breaks that. (I think, if I’m reading it correctly).