linshare icon indicating copy to clipboard operation
linshare copied to clipboard

BUG: shared space quota

Open matdemb opened this issue 6 years ago • 23 comments

Hi, I have something strange on my linshare. I specified 20GB of sharedspace on it and it indicate that the quota is full used and show an error message if we try to had more document on it. But if I look at my disk space, it only have 6GB used for all (users and shared space). I have deleted all workspaces on my test platform but it doesn't change anything. Is there a problem with the sharedspace quota. Tested on 3.2.0 and 3.3.1 on my test server. Thanks.

matdemb avatar Dec 26 '19 11:12 matdemb

Hi, yesterday the management ui indicate 20GB of used space for shared space. I have deleted all shared groups, today it indicates 29GB of used space (for a limitation of 20GB)... And there is no user on this server. On disk space, nothing change still around 9GB dispite the groups deletion. There is definitly an issue with that. Regards,

matdemb avatar Dec 27 '19 10:12 matdemb

Hi, If I look at the work_group_nodes table in mongo DB, I can see there is no file ( db.work_group_nodes.find({ _class : "org.linagora.linshare.mongo.entities.WorkGroupDocument" });) . Far from 29GB shown in admin UI... Regards,

Mathieu

matdemb avatar Jan 07 '20 16:01 matdemb

Hi, few more example about the quota issue: linshare=> select sum(ls_size) from document; sum

9581613300 (1 ligne)

image

It should be the same isn't it?

matdemb avatar Jan 15 '20 10:01 matdemb

hi matdemb, i've got the same issue here (core 2.2.3 ui 2.2.3 adm 3.2.1) I will update to latest version (3.3.2 on test server) without great hope that this would be solved according to what you already tested.

aroussel62 avatar Feb 11 '20 11:02 aroussel62

somehow it seems to be an issue with "usedSpace" calculation. According to "/webservice/rest/admin/quotas/domains/{id}" api call that returns a "bad" (if we could say so) usedSpace value. It results in exception caught in log : "container quota has been reached" that can be linked to :

BusinessException(BusinessErrorCode.QUOTA_CONTAINER_FORBIDDEN_NO_MORE_SPACE_AVALAIBLE, "The container quota has been reached.");

in this java source file : https://github.com/linagora/linshare-core/blob/3d95f32bdd54f8de6ae837b4ba0212fe17338c1b/src/main/java/org/linagora/linshare/core/service/impl/QuotaServiceImpl.java

But dunno if it can help developers of the project to solve this issue ... :/

aroussel62 avatar Feb 17 '20 10:02 aroussel62

Hi, on 2.3.4/3.3.3 the issue is still present. Now I have a remaining quota of -1.45Go... On a workgroup quota of 30Go it shows full , I have 13Go on the disk for both userspace and workgroup space.... On the Mongo base, if I do the sum of all document and revision (which is more than the reality) I have only 13Go (so probably 6.5Go or less). Very annoying this bug if when the shared space is empty it's see as full... Any information from Linshare team?

Thanks.

matdemb avatar Jul 22 '20 07:07 matdemb

Hi, Same issue after migrated to 4.0. Even when I have 0 document, the shared space quota is 26GB. Is there a way to reinitialize the counter? I probably have some errors in database that can explain my problem. Thanks for any help.

matdemb avatar Aug 07 '20 10:08 matdemb

New test, new result.

In fact event after "waiting" next day (in fact I play with dates/hours of the server to trigger batches), the calculation is wrong

New test with quota and statistic tables view:

fresh install

id | uuid | quota_type | maintenance | quota | quota_override | default_quota | default_quota_override | quota_warning | current_value | last_value | current_value_for_subdomains | max_file_size | max_file_size_override | default_max_file_size | default_max_file_size_override | default_account_quota | default_account_quota_override | account_quota | account_quota_override | creation_date | modification_date | batch_modification_date | container_type | shared | domain_shared | domain_shared_override | default_domain_shared | default_domain_shared_override | account_id | domain_id | domain_parent_id | quota_domain_id | quota_container_id ------+--------------------------------------+-----------------+-------------+----------------+----------------+---------------+------------------------+----------------+---------------+------------+------------------------------+---------------+------------------------+-----------------------+--------------------------------+-----------------------+--------------------------------+---------------+------------------------+----------------------------+----------------------------+-------------------------+----------------+--------+---------------+------------------------+-----------------------+--------------------------------+------------+-----------+------------------+-----------------+-------------------- 11 | 26323798-a1a8-11e6-ad47-0800271467bb | CONTAINER_QUOTA | f | 400000000000 | | 400000000000 | | 400000000000 | 0 | 0 | | 100000000000 | | 10000000000 | | 100000000000 | | 100000000000 | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | USER | f | | | | | | 1 | | 1 | 12 | 63de4f14-a1a8-11e6-a369-0800271467bb | CONTAINER_QUOTA | f | 400000000000 | | 400000000000 | | 400000000000 | 0 | 0 | | 10000000000 | | 10000000000 | | 400000000000 | | 400000000000 | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | WORK_GROUP | t | | | | | | 1 | | 1 | 13 | 815e1d22-49e0-4817-ac01-e7eefbee56ba | ACCOUNT_QUOTA | f | 100000000000 | t | | | 100000000000 | 0 | 0 | | 100000000000 | t | | | | | | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | | f | t | | | | 1 | 1 | | | 11 1015 | a6569a0b-c988-4908-8f80-3edf6368a980 | DOMAIN_QUOTA | f | 1000000000000 | f | | | 10000000000000 | 0 | 0 | 0 | | | | | | | | | 2020-08-13 12:05:07.267 | 2020-08-13 12:05:07.267 | 2020-08-13 12:05:07.267 | | | f | f | | | | 1014 | 1008 | | 1016 | d93eca09-af7d-4983-9893-356df6b95c7c | CONTAINER_QUOTA | f | 400000000000 | f | | | 400000000000 | 0 | 0 | | 10000000000 | f | 10000000000 | f | 100000000000 | f | 100000000000 | f | 2020-08-13 12:05:07.294 | 2020-08-13 12:05:07.294 | 2020-08-13 12:05:07.294 | USER | f | | | | | | 1014 | 1008 | 1015 | 1022 | 6717bdd8-0538-4163-bf14-b378a0acb675 | ACCOUNT_QUOTA | f | 100000000000 | f | | | 400000000000 | 0 | 0 | | 10000000000 | f | | | :

next day, upload a 300MB file

id | uuid | quota_type | maintenance | quota | quota_override | default_quota | default_quota_override | quota_warning | current_value | last_value | current_value_for_subdomains | max_file_size | max_file_size_override | default_max_file_size | default_max_file_size_override | default_account_quota | default_account_quota_override | account_quota | account_quota_override | creation_date | modification_date | batch_modification_date | container_type | shared | domain_shared | domain_shared_override | default_domain_shared | default_domain_shared_override | account_id | domain_id | domain_parent_id | quota_domain_id | quota_container_id ------+--------------------------------------+-----------------+-------------+----------------+----------------+---------------+------------------------+----------------+---------------+------------+------------------------------+---------------+------------------------+-----------------------+--------------------------------+-----------------------+--------------------------------+---------------+------------------------+----------------------------+----------------------------+-------------------------+----------------+--------+---------------+------------------------+-----------------------+--------------------------------+------------+-----------+------------------+-----------------+-------------------- 1009 | 5ae56c8a-fc99-429e-80eb-681097198406 | DOMAIN_QUOTA | f | 1000000000000 | f | 1000000000000 | f | 10000000000000 | 307437568 | 0 | 0 | | | | | | | | | 2020-08-13 12:04:44.932 | 2020-08-16 00:00:00.896 | 2020-08-16 00:00:00.849 | | | f | f | f | f | | 1008 | 1 | | 1 | 2a01ac66-a279-11e5-9086-5404a683a462 | DOMAIN_QUOTA | f | 10000000000000 | | 1000000000000 | | 10000000000000 | 0 | 0 | 307437568 | | | | | | | | | 2020-08-13 11:55:10.262872 | 2020-08-16 00:00:00.91 | | | | t | | f | | | 1 | | | 11 | 26323798-a1a8-11e6-ad47-0800271467bb | CONTAINER_QUOTA | f | 400000000000 | | 400000000000 | | 400000000000 | 0 | 0 | | 100000000000 | | 10000000000 | | 100000000000 | | 100000000000 | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | USER | f | | | | | | 1 | | 1 | 12 | 63de4f14-a1a8-11e6-a369-0800271467bb | CONTAINER_QUOTA | f | 400000000000 | | 400000000000 | | 400000000000 | 0 | 0 | | 10000000000 | | 10000000000 | | 400000000000 | | 400000000000 | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | WORK_GROUP | t | | | | | | 1 | | 1 | 13 | 815e1d22-49e0-4817-ac01-e7eefbee56ba | ACCOUNT_QUOTA | f | 100000000000 | t | | | 100000000000 | 0 | 0 | | 100000000000 | t | | | | | | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | | f | t | | | | 1 | 1 | | | 11 1015 | a6569a0b-c988-4908-8f80-3edf6368a980 | DOMAIN_QUOTA | f | 1000000000000 | f | | | 10000000000000 | 0 | 0 | 0 | | | | | :

id | statistic_type | creation_date | statistic_date | operation_count | delete_operation_count | create_operation_count | create_operation_sum | delete_operation_sum | diff_operation_sum | actual_operation_sum | account_id | domain_id | domain_parent_id ------+-----------------------+-------------------------+-------------------------+-----------------+------------------------+------------------------+----------------------+----------------------+--------------------+----------------------+------------+-----------+------------------ 1037 | WORK_GROUP_DAILY_STAT | 2020-08-16 00:00:00.676 | 2020-08-15 23:59:59.999 | 1 | 0 | 1 | 307437568 | 0 | 307437568 | 307437568 | 1023 | 1008 | 1 1039 | DOMAIN_DAILY_STAT | 2020-08-16 00:00:00.87 | 2020-08-15 23:59:59.999 | 1 | 0 | 1 | 307437568 | 0 | 307437568 | 307437568 | | 1008 | 1 (2 lignes)

next day, deletion of the file

id | uuid | quota_type | maintenance | quota | quota_override | default_quota | default_quota_override | quota_warning | current_value | last_value | current_value_for_subdomains | max_file_size | max_file_size_override | default_max_file_size | default_max_file_size_override | default_account_quota | default_account_quota_override | account_quota | account_quota_override | creation_date | modification_date | batch_modification_date | container_type | shared | domain_shared | domain_shared_override | default_domain_shared | default_domain_shared_override | account_id | domain_id | domain_parent_id | quota_domain_id | quota_container_id ------+--------------------------------------+-----------------+-------------+----------------+----------------+---------------+------------------------+----------------+---------------+------------+------------------------------+---------------+------------------------+-----------------------+--------------------------------+-----------------------+--------------------------------+---------------+------------------------+----------------------------+----------------------------+-------------------------+----------------+--------+---------------+------------------------+-----------------------+--------------------------------+------------+-----------+------------------+-----------------+-------------------- 11 | 26323798-a1a8-11e6-ad47-0800271467bb | CONTAINER_QUOTA | f | 400000000000 | | 400000000000 | | 400000000000 | 0 | 0 | | 100000000000 | | 10000000000 | | 100000000000 | | 100000000000 | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | USER | f | | | | | | 1 | | 1 | 12 | 63de4f14-a1a8-11e6-a369-0800271467bb | CONTAINER_QUOTA | f | 400000000000 | | 400000000000 | | 400000000000 | 0 | 0 | | 10000000000 | | 10000000000 | | 400000000000 | | 400000000000 | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | WORK_GROUP | t | | | | | | 1 | | 1 | 1024 | 0b39c53a-4050-4df8-b271-11644f8ad099 | ACCOUNT_QUOTA | f | 400000000000 | f | | | 400000000000 | 614875136 | 307437568 | | 10000000000 | f | | | | | | | 2020-08-13 12:06:10.296 | 2020-08-13 12:06:10.296 | 2020-08-17 00:00:00.397 | | t | f | f | | | 1023 | 1008 | 1 | | 1011 13 | 815e1d22-49e0-4817-ac01-e7eefbee56ba | ACCOUNT_QUOTA | f | 100000000000 | t | | | 100000000000 | 0 | 0 | | 100000000000 | t | | | | | | | 2020-08-13 11:55:10.262872 | 2020-08-13 11:55:10.262872 | | | f | t | | | | 1 | 1 | | | 11 1015 | a6569a0b-c988-4908-8f80-3edf6368a980 | DOMAIN_QUOTA | f | 1000000000000 | f | | | 10000000000000 | 0 | 0 | 0 | | | | | | | | | 2020-08-13 12:05:07.267 | 2020-08-13 12:05:07.267 | 2020-08-13 12:05:07.267 | | | f | f | | | | 1014 | 1008 | | 1016 | d93eca09-af7d-4983-9893-356df6b95c7c | CONTAINER_QUOTA | f | 400000000000 | f | | | 400000000000 | 0 | 0 | | 10000000000 | f | 10000000000 | f | :

id | statistic_type | creation_date | statistic_date | operation_count | delete_operation_count | create_operation_count | create_operation_sum | delete_operation_sum | diff_operation_sum | actual_operation_sum | account_id | domain_id | domain_parent_id ------+------------------------+-------------------------+-------------------------+-----------------+------------------------+------------------------+----------------------+----------------------+--------------------+----------------------+------------+-----------+------------------ 1037 | WORK_GROUP_DAILY_STAT | 2020-08-16 00:00:00.676 | 2020-08-15 23:59:59.999 | 1 | 0 | 1 | 307437568 | 0 | 307437568 | 307437568 | 1023 | 1008 | 1 1039 | DOMAIN_DAILY_STAT | 2020-08-16 00:00:00.87 | 2020-08-15 23:59:59.999 | 1 | 0 | 1 | 307437568 | 0 | 307437568 | 307437568 | | 1008 | 1 1046 | WORK_GROUP_DAILY_STAT | 2020-08-17 00:00:00.402 | 2020-08-16 23:59:59.999 | 1 | 1 | 0 | 0 | 307437568 | 307437568 | 614875136 | 1023 | 1008 | 1 1048 | DOMAIN_DAILY_STAT | 2020-08-17 00:00:00.451 | 2020-08-16 23:59:59.999 | 1 | 1 | 0 | 0 | 307437568 | 307437568 | 614875136 | | 1008 | 1 1049 | WORK_GROUP_WEEKLY_STAT | 2020-08-17 00:00:00.58 | 2020-08-16 23:59:59.999 | 2 | 1 | 1 | 307437568 | 307437568 | 614875136 | 922312704 | 1023 | 1008 | 1 1050 | DOMAIN_WEEKLY_STAT | 2020-08-17 00:00:00.608 | 2020-08-16 23:59:59.999 | 2 | 1 | 1 | 307437568 | 307437568 | 614875136 | 922312704 | | 1008 | 1 (6 lignes)

image

It seems to do the sum and not the substraction with deletion sum...

matdemb avatar Aug 14 '20 09:08 matdemb

delete_operation_sum is stored in negative value for "normal" users but in positive value for "workgroup" user. And the calculation is probably done by the same script (StatisticDailyUserBatchImpl.java?) Probably the reason of the bug.

matdemb avatar Aug 14 '20 10:08 matdemb

Hello, still no news from linshare team for this bug? Annoying...

matdemb avatar Sep 01 '20 12:09 matdemb

up! Any information from Linagora Team?

matdemb avatar Sep 28 '20 10:09 matdemb

Hello, Can we have a workaround to manually calculate the used space and have a correct value? PLEEEEEEAASSSSEEEEE.

matdemb avatar Oct 14 '20 08:10 matdemb

Sorry, we are very busy right now. The bug is complicated to reproduce and to understand. I don't know when we will have more time to work on this. I hope at the beginning of November I should be able to have some time to look at it. I will keep you posted.

fmartin-linagora avatar Oct 15 '20 08:10 fmartin-linagora

Thank you for this information. If you need any information about my configuration or whatever, don't hesitate.

matdemb avatar Oct 15 '20 08:10 matdemb

Hi, 💡 another thing I found about this bug. The operation_history is wrong too That can explain wrong statistics.

image

Here what I did:

  • I put a file in a workgroup, then in a user psace.
  • I delete the file in the workgroup and in the user space.

You can see that the operation_value is always positive for workgroup actions, but the deletion is negative for user group. 😕

matdemb avatar Nov 04 '20 15:11 matdemb

Hi, any news for this issue? Kind regards,

matdemb avatar Jan 18 '21 08:01 matdemb

@fmartin-linagora Still no news for the correction?

matdemb avatar Feb 15 '21 10:02 matdemb

Hi, Sorry, I was not working during the last month of 2020 (injured) and I'am very busy this begin of year. We will try to have a look.

fmartin-linagora avatar Feb 15 '21 10:02 fmartin-linagora

Hello, Thanks @matdemb and @aroussel62 for your inputs. Indeed, the quota was not correct when deleting files inside work groups. You can profit from the bugfix with the last v4.1.1 LinShare version. We are now working on the next LinShare release that will contain scripts and upgrade tasks recalculating the quota.

To sum up, 1) please upgrade your LinShare v4.1.1 version to prevent this bug to happen. 2) Please upgrade to the LinShare v4.2.0 for the quota recalculation. If your already had this bug before v4.1.1, all will be fixed after this upgrade.

Regards, Alvin

alamartiniere-Linagora avatar Mar 29 '21 13:03 alamartiniere-Linagora

Hello, it's better thanks. I will check with the 4.2 when it will be online. Regards,

Mat

matdemb avatar Apr 02 '21 09:04 matdemb