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

Exceeding quota after ocis_max_size_quota set gives 500 status code #6414

Closed
SagarGi opened this issue May 31, 2023 · 6 comments · Fixed by #6469
Closed

Exceeding quota after ocis_max_size_quota set gives 500 status code #6414

SagarGi opened this issue May 31, 2023 · 6 comments · Fixed by #6469
Assignees
Labels

Comments

@SagarGi
Copy link
Member

SagarGi commented May 31, 2023

Description

Configuring and running ocis with env OCIS_SPACES_MAX_QUOTA, when a space is created exceeding the quota. The status code is 500.

Steps to reproduce:

  1. Run ocis with env OCIS_SPACES_MAX_QUOTA=50
  2. And try to create a space project with quota size 51.

curl command to create space with quota with admin user:

curl -XPOST -k -uadmin:admin https://localhost:9200/graph/v1.0/drives -H 'Content-Type: application/json' --data-raw '{"Name": "testQuota", "description": "This is a test quota", "quota": {"total": 51}}' -v

Expected Behaviour:

The status code should be 507 insufficient storage.

Actual Behaviour

< HTTP/1.1 500 Internal Server Error
< Content-Length: 157
< Content-Security-Policy: frame-ancestors 'none'
< Content-Type: application/json; charset=utf-8
< Date: Wed, 31 May 2023 08:42:19 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< X-Graph-Version: 3.0.0-rc.4+3bbed2fc7
< 
{"error":{"code":"generalException","innererror":{"date":"2023-05-31T08:42:19Z","request-id":"desktop/gWCjfgA4bL-000516"},"message":"error creating space"}}
@saw-jan
Copy link
Member

saw-jan commented Jun 5, 2023

CC @micbar @ScharfViktor

@ScharfViktor
Copy link
Contributor

You cannot create space with certain quota in the real life (first we create space with default quota)
and if you have correct configuration GRAPH_SPACES_DEFAULT_QUOTA < OCIS_SPACES_MAX_QUOTA You will never have this problem.

my settings: OCIS_SPACES_MAX_QUOTA=2000000000 GRAPH_SPACES_DEFAULT_QUOTA=1000000000

you cannot change quota more than MAX_QUOTA via web
image

@SagarGi
Copy link
Member Author

SagarGi commented Jun 6, 2023

You cannot create space with certain quota in the real life (first we create space with default quota) and if you have correct configuration GRAPH_SPACES_DEFAULT_QUOTA < OCIS_SPACES_MAX_QUOTA You will never have this problem.

my settings: OCIS_SPACES_MAX_QUOTA=2000000000 GRAPH_SPACES_DEFAULT_QUOTA=1000000000

you cannot change quota more than MAX_QUOTA via web image

From UI it might not be possible but giving 500 status code with API seems not be feasible IMO.

@phil-davis
Copy link
Contributor

From UI it might not be possible but giving 500 status code with API seems not be feasible IMO.

I don't understand the sentence.

IMO it is possible to send an API request to create a space, specifying a quota that is too large, and a 500 status is returned.

Even if the web UI does not make a request like that, some other client might one day. Any API request that can result in a 500 response is a bug, by definition, and should be fixed.

@ScharfViktor
Copy link
Contributor

I would suggest another expected result, like when we set a quota higher than the max quota

400

{
    "error": {
        "code": "notAllowed",
        "innererror": {
            "date": "2023-06-06T07:51:08Z",
            "request-id": "Viktors-Air.local/S5s3y8xnwl-015573"
        },
        "message": "decompsedFS: requested quota is higher than allowed"
    }
}

@2403905
Copy link
Contributor

2403905 commented Jun 7, 2023

The related issue #5050
Both can be fixed together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants