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

Create Organization Quota Definition fails with unlimited routes and zero (default) total_reserved_route_ports #656

Closed
Zteve opened this issue Jul 29, 2016 · 8 comments

Comments

@Zteve
Copy link

Zteve commented Jul 29, 2016

Issue

Create Organization Quota Definition with body fields total_routes : -1 and omitted total_reserved_route_ports (defaulting to 0) fails with:

CF-QuotaDefinitionInvalid(240003): Quota Definition is invalid: total_reserved_route_ports Total reserved ports must be less than or equal to total routes.

Context

I'm using API version: 2.54.0 on the latest PcfDev (0.18.0).

Steps to Reproduce

Issue the following REST call:

POST /v2/quota_definitions

with payload

{   "instance_memory_limit":1024,
    "memory_limit":1024,
    "name":"test-quota-definition-psl3d",
    "non_basic_services_allowed":false,
    "total_routes":-1,
    "total_services":-1
}

Expected result

201 Created, and a payload of a (fully populated) Organization Quota Definition. (See doc.)

Current result

400 Bad Request, and the message payload:

{  "code": 240003,
  "description": "Quota Definition is invalid: total_reserved_route_ports Total reserved ports must be less than or equal to total routes.",
  "error_code": "CF-QuotaDefinitionInvalid"
}     

Possible Fix

Make special comparisons between fields with special values.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/127361335

The labels on this github issue will be updated when the story is started.

@thausler786
Copy link
Contributor

thausler786 commented Aug 10, 2016

@Zteve,

Thanks for bringing this to our attention! I suspect that your problem was taken care of by commit ba7e082 in April. Am I correct in assuming that you are running a Cloud Foundry from before then? We were unable to replicate this error running against the current cloud controller.

Given that this issue appears to have been fixed by a specific commit a few months ago, I'm going to close this issue. Please feel free to reopen it, though, if the problem persists, or if you are running on an updated CF!

Best,

@thausler786
CAPI team member

@Zteve
Copy link
Author

Zteve commented Aug 11, 2016

It is hard for me to run on anything but the latest available PcfDev (18 as reported above) and if that doesn't have the latest Cloud Controller updates, I won't see them. I'm currently running on PcfDev 19 (2.54.0 API) so I may have better luck. Can you please confirm which level of the API this fix went into, so I can be sure to check it when it becomes available?

@Zteve
Copy link
Author

Zteve commented Aug 11, 2016

The code looks wrong to me, but I may not understand x < UNLIMITED when UNLIMITED is -1 and x is (say) 1?

@Zteve
Copy link
Author

Zteve commented Aug 12, 2016

Well, if the fix isn't in 2.54 (currently running in Latest PcfDev 19) then what version is it in? So I don't have to keep testing until it is fixed?

@SocalNick
Copy link
Contributor

@Zteve that commit made it into CF-237 / CC 2.56.0. I'll ask our interrupt pair to look into your comment RE: x < UNLIMITED.

@SocalNick SocalNick reopened this Aug 12, 2016
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/128239719

The labels on this github issue will be updated when the story is started.

@youreddy
Copy link

youreddy commented Aug 12, 2016

Hello @Zteve,

We agree that the logic around this is confusing. We just pushed up a commit that will hopefully improve the readability.

As Nick said above, you should not see this in deployments using CF-237/ CC 2.56.0

If you feel that your issue has been resolved, please go ahead and close it.

Thank you,
@youreddy & @thausler786
CF CAPI Team

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

No branches or pull requests

5 participants