Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set user quota with uneven values using locales that use a comma as decimal separator #18468

Closed
Anthrazz opened this issue Dec 18, 2019 · 16 comments · Fixed by #42053
Closed
Assignees
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: occ

Comments

@Anthrazz
Copy link

It is not possible to set a decimal user quota with a German locale. The frontend does change the wanted value of e.g "1.5 TB" in the API request to "1,5 TB" which is not correctly interpreted by the backend but still accepted and returns a 200 OK message.

If you try to set "1,5 TB" then is the API request not even sent.

There is no problem if the English locale is activated for the user and it is tried to set "1.5 TB".

Steps to reproduce

  1. Go to User Overview
  2. Try to set a Quota of "1.5 TB" for a user

Expected behaviour

User gets a quota of 1.5 TB quota.

Actual behaviour

Frontend shows "Unlimited" quota and after reload of the page "1 TB".

Server configuration

Operating system: Ubuntu Server 18.04

Web server: Nginx

Database: MariaDB

PHP version: PHP 7.3.11

Nextcloud version: 17.0.1

Updated from an older Nextcloud/ownCloud or fresh install: upgraded from Nextcloud version 16

Where did you install Nextcloud from: Public Nextcloud Docker Image

Signing status:

Signing status No errors have been found.

Are you using external storage, if yes which one: No

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Chromium and Firefox

Operating system: Fedora

Logs

Web server error log

Web server error log No errors

Nextcloud log (data/nextcloud.log)

Nextcloud log No errors

Browser log

Browser log
Client Request:

Path: example.org/ocs/v2.php/cloud/users/Admin
Payload: {key: "quota", value: "1,5 TB"}

Answer:
{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":[]}}
@Anthrazz Anthrazz added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Dec 18, 2019
@rubo77
Copy link
Contributor

rubo77 commented Dec 22, 2019

Confirmed.

There is a workaround for value below 1 GB though: instead of 0.5 GB use 500 MB.

Did you try this?

 occ user:setting USERNAME files quota "1.5 GB"

@Anthrazz
Copy link
Author

Anthrazz commented Jan 3, 2020

Did you try this?
occ user:setting USERNAME files quota "1.5 GB"

This workaround does set the quota correct to 1.5 GB.

@medcloud
Copy link
Contributor

medcloud commented Apr 23, 2020

Hello, I confirm I reproduce also on French local also > same issue.
The workaround works for setting quota below 1 GB (ex : 750 MB)
But no solution above 1 GB > 1,5 GB impossible, neither 1500 MB... must be setted 1 GB or 2 GB

Seemed to work on NC14 because an account created 1 year ago with 1,5 GB is still working well. But if I try to modify the quota now with NC17 , I cannot set back 1,5 GB anymore...

@szaimen

This comment was marked as outdated.

@go2sh go2sh self-assigned this May 31, 2021
@Anthrazz
Copy link
Author

Anthrazz commented Jun 1, 2021

I can still reproduce this issue with a Nextcloud 20.0.9.

@go2sh
Copy link
Contributor

go2sh commented Jun 1, 2021

I can reproduce it as well. Will have a look.

@go2sh go2sh added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap needs info labels Jun 1, 2021
@go2sh
Copy link
Contributor

go2sh commented Jun 1, 2021

Three things happen:

  • It looks like none of the javascript parsing code can handle "," as decimal seperator and validation will fail
  • The php code takes a string of "1,5 GB" and converts it to float as "1.0" 🙈
  • formatFileSize returns a locale dependend file size

Server and javascript code should handle both decimal seperators or it should be clear, that only frontend numbers use the locale dependend decimal seperator. @skjnldsv Any preference?

@skjnldsv
Copy link
Member

skjnldsv commented Jun 1, 2021

@skjnldsv Any preference?

The more versatile the better

@RedFoxPi
Copy link

RedFoxPi commented Sep 1, 2021

#24002 is a duplicate of this issue and it still exists with 22.1.1.
I am using firefox and US local - though my user local was configured in nextcloud to German.

Workaround which worked for me: Set local in nextcloud user settings to US and then enter e.g. "1.5 TB" worked.

@GAS85
Copy link

GAS85 commented Sep 20, 2021

Did you try this?

 occ user:setting USERNAME files quota "1.5 GB"

Somehow didn't work, but this works instead:

occ user:setting USERNAME files quota 1.5GB

@rubo77
Copy link
Contributor

rubo77 commented Oct 4, 2022

This is still a valid bug in NC 24.0.5

@rubo77 rubo77 changed the title Cannot set user quota with decimal values in German locale Cannot set user quota with uneven values using locales that use a comma as decimal separator Oct 4, 2022
@rubo77
Copy link
Contributor

rubo77 commented Oct 4, 2022

If you point me to the PHP file, that computers the value, I could create a pr

@szaimen szaimen added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Oct 10, 2022
@szaimen
Copy link
Contributor

szaimen commented Jan 9, 2023

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 2. developing Work in progress labels Jan 9, 2023
@GAS85
Copy link

GAS85 commented Jan 20, 2023

Nextcloud 24.0.9 set via UI:

  • 1,5 GB does not work
  • 1.5 GB was accepted, but in UI I see now "Unlimited", because of PUT Request that didn't deliver any data:
{"ocs":{"meta":{"status":"ok","statuscode":200,"message":"OK"},"data":[]}}

After page renewal Limit was back to the 1 GB = does not work too.

Check via CLI:

occ user:setting USER
...
  - files:
    - quota: 1 GB
...

Quota was not set.

Also I see that yes - you can set via UI some dotted values, but only the integer part will be accepted. E.g. for 1.5 GB will be 1 GB and from the 10.89 GB will be 10 GB

@szaimen

This comment was marked as resolved.

@rubo77
Copy link
Contributor

rubo77 commented Sep 3, 2023

the problem got worse in 27.0.2:

Now with german Locale, you still cannot set it to broken values, but there is another issue now:

All users seem to have some extra fraction: Users that had 1GB Quota now all have 1.1 GB Quota, users that had 10GB now have 10.7GB. This is the same with english Locale. there the fractioning setting works kind of, although there is also added a few fractions each time, you change it

@rubo77 rubo77 reopened this Sep 3, 2023
marcelklehr added a commit that referenced this issue Dec 6, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
marcelklehr added a commit that referenced this issue Dec 6, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
marcelklehr added a commit that referenced this issue Dec 7, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
backportbot-nextcloud bot pushed a commit that referenced this issue Dec 7, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
marcelklehr added a commit that referenced this issue Dec 12, 2023
marcelklehr added a commit that referenced this issue Dec 12, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
AndyScherzinger pushed a commit that referenced this issue Dec 14, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
AndyScherzinger pushed a commit that referenced this issue Dec 14, 2023
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
zak39 pushed a commit to zak39/server that referenced this issue Dec 19, 2023
…runcated in locales other than english

fixes nextcloud#18468

Signed-off-by: Marcel Klehr <[email protected]>
marcelklehr added a commit that referenced this issue Jan 15, 2024
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
blizzz pushed a commit that referenced this issue Jan 15, 2024
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
marcelklehr added a commit that referenced this issue Jan 18, 2024
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
backportbot bot pushed a commit that referenced this issue Jan 18, 2024
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>

[skip ci]
marcelklehr added a commit that referenced this issue Jan 18, 2024
…runcated in locales other than english

fixes #18468

Signed-off-by: Marcel Klehr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 27-feedback bug feature: occ
Projects
None yet
8 participants