Report for nextcloud

Hi! I think I’ve found a bug in the way that Report (nethesisdante) counts users in nextcloud.
I have 2 users (3 with the admin), configured by local LDAP.
On nextcloud the admin user (default) can see 4 users as expected:


But in the report I can see only 2 users, one of wich is the internal admin. The missing user (fry) is the one that uses the most of space.
Any idea on why?

The 3rd account, the admin account you see, is probably a local nextcloud account.

Yes, I understand, but my problem is in the report:
57
(I was not able to upload the screenshot in the first post because of the rules of this forum)
As you can see there are only two users in the report (not in nextcloud but in dante), the user “fry” is missing!

Thank you for reporting, could you please paste the output of the following command?

/usr/share/dante/miners/nextcloudsize-list

Ciao Giacomo la risposta è la seguente:
/usr/share/dante/miners/nextcloudsize-list

{"aggregationType":"snapshot","unit":"bytes","anonymizable":true,"data":[{"count":659480627,"name":"Maria Pia (mpia)"},{"count":13011031,"name":"admin"}],"type":"list","minerId":"nextcloudsize-list"}

Analizzando il codice ho visto che tutto si basa su questa query fatta su occ:
su - apache -s /bin/bash -c "source /opt/rh/rh-php72/enable; cd /usr/share/nextcloud/; php occ --output=json user:list" 2>/dev/null

{"3d8a87a2-bde9-1039-99b3-35621bd263cc":"Maria Pia (mpia)","98a67fd2-a576-1039-9497-29e3eade07eb":"Francesco (fry)","admin":"admin","cb8cb43a-a575-1039-9494-29e3eade07eb":"admin (admin)"}

Ho provato anche ad eseguire il comando per vedere la dimensione delle cartelle ed il risultato è questo:
du -b --max-depth=1 -c /var/lib/nethserver/nextcloud/ 2>/dev/null| sort -n -r
3626504855 /var/lib/nethserver/nextcloud/
3626504855 total
1536174580 /var/lib/nethserver/nextcloud/98a67fd2-a576-1039-9497-29e3eade07eb
1417541172 /var/lib/nethserver/nextcloud/appdata_oc1r6wch1jjr
659480627 /var/lib/nethserver/nextcloud/3d8a87a2-bde9-1039-99b3-35621bd263cc
13011031 /var/lib/nethserver/nextcloud/admin
221390 /var/lib/nethserver/nextcloud/files_external

Secondo me l’errore è alla riga 50
next if ($i <= 3); # skip total lines
commentando quella tutto funziona. Mi pare sbagliata perchè i totali occupano 2 righe e non 3, inoltre non capisco tanto a cosa serva visto che dopo l’array viene intersecato con gli utenti e quindi le righe dei totali vengono comunque saltate.
Che ne dici?

Thank you @frazei but let’s switch back to English so anyone can understand! :wink:

I think you’ve found the issue and the fix! :clap:

I’ve opened an issue for it: https://github.com/NethServer/dev/issues/6034
There is already a fix to try (I’ve just implemented your suggestion): https://github.com/nethesis/dante/pull/13

The issue is already in testing, to try it:

yum --enablerepo=nethserver-testing update dante

Oops… I’m sorry I’ve started writing thoughtlessly!

1 Like

@frazei did you try the fix, does it work for you? :slight_smile:

Yes, I’ve updated from nethserver-testing and now it’s working as expected.

1 Like

Thank you, released!

1 Like

Hi Giacomo, I think that a new bug appeared after the last update (NethServer 7.8.2003):

malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /usr/share/dante/miners/nextcloudsize-list line 40.

If I manually execute the command that I found at line 40 I get this:

[root@neth miners]# /usr/local/sbin/occ --output=json user:list
{"3d8a87a2-bde9-1039-99b3-35621bd263cc":"Maria Pia (mpia)","98a67fd2-a576-1039-9497-29e3eade07eb":"Francesco (fry)","admin":"admin","b04a1212-3cce-103a-9d5d-833de5643d29":"Ettore (ettore)","cb8cb43a-a575-1039-9494-29e3eade07eb":"admin (admin)"}

Sorry, I found another discussion about the same problem:
https://community.nethserver.org/t/cron-daemon-reports-error-on-bin-ciacco-via-email

1 Like