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 update or delete Cache Groups with null latitude and longitude #6378

Closed
ocket8888 opened this issue Nov 24, 2021 · 4 comments
Closed
Assignees
Labels
bug something isn't working as intended high impact impacts the basic function, deployment, or operation of a CDN low difficulty the estimated level of effort to resolve this issue is low Traffic Ops related to Traffic Ops

Comments

@ocket8888
Copy link
Contributor

This Bug Report affects these Traffic Control components:

  • Traffic Ops

Current behavior:

The API does not require a latitude and longitude when creating a Cache Group. Omitting those properties (or setting them to null explicitly) in the POST request to create a Cache Group does not result in an underlying "coordinate" being created for the Cache Group. A further PUT request to change, e.g. the Name of the Cache Group will cause a segmentation fault as Traffic Ops tries to dereference the null ID of the coordinate associated with the Cache Group during the update process. The request then fails even if otherwise well-formed, with a 500 Internal Server Error response.

Expected behavior:

If coordinates are to be required in requests, then omitting them (or setting them to null) in requests should return a client error code and an appropriate alert. If coordinates are not intended to be required, then the handler for PUT requests should not assume they exist and appropriately handle the case that they don't.

Steps to reproduce:

  1. topost -k cachegroups '{"name": "test", "shortName": "test", "typeId": 23 (replace 23 with the ID of any Type that has a useInTable value of cachegroup)
  2. toput -k cachegroups/10 '{"name": "test", "shortName": "test", "typeId": 23}' (replace 10 with the ID of the Cache Group created in step 1. and replace 23 with the ID of any Type that has a useInTable value of cachegroup)

Note that changing anything is unnecessary to encounter the bug.

It's unclear (to me) if this is a regression or not.

@ocket8888 ocket8888 added bug something isn't working as intended Traffic Ops related to Traffic Ops low impact affects only a small portion of a CDN, and cannot itself break one low difficulty the estimated level of effort to resolve this issue is low labels Nov 24, 2021
@ocket8888 ocket8888 changed the title Cannot update Cache Groups with null latitude and longitude Cannot update or delete Cache Groups with null latitude and longitude Nov 24, 2021
@ocket8888
Copy link
Contributor Author

Even more annoyingly, I can't even get rid of the Cache Group, because DELETE requests fail for the same reason. Combined with being unable to update it to add coordinates, a Cache Group created with no coordinates is both immortal and immutable.

@ocket8888 ocket8888 added high impact impacts the basic function, deployment, or operation of a CDN and removed low impact affects only a small portion of a CDN, and cannot itself break one labels Dec 1, 2021
@ocket8888
Copy link
Contributor Author

For the reasons stated in #2566, this is high impact, at least until #2566 is closed (either by making latitude and longitude required, which would also fix #2566, or by changing it such that null/undefined is a synonym for 0, which would close #2566 as "wontfix")

@srijeet0406
Copy link
Contributor

@ocket8888 I can take this one.

@ocket8888
Copy link
Contributor Author

This was closed by #6442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working as intended high impact impacts the basic function, deployment, or operation of a CDN low difficulty the estimated level of effort to resolve this issue is low Traffic Ops related to Traffic Ops
Projects
None yet
Development

No branches or pull requests

2 participants