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

DS creation - behaviour should be consistent when an associated field is deleted before DSR fulfillment #3723

Open
lbathina opened this issue Jul 15, 2019 · 5 comments
Labels
bug something isn't working as intended Traffic Ops related to Traffic Ops

Comments

@lbathina
Copy link

Scenario1:

  1. Create a new Type for Delivery Service
  2. Create a new DS choosing the type created in step1, submit it for DSR
  3. delete the type created in step1 while the request is pending in DSR
  4. go to DSR and click on fulfill (assign it to yourself first)
    Expected: some kind of error that type doesn't exist
    Actual: Nothing happened!!!

On discussion with team it seem to be a static type that user is not supposed to create. In such case, the appropriate thing would be to restrict creation of types only to allowed ones.

Scenario2:

  1. create a DS_Profile
  2. Create a DS , choose DS_Profile created in step 1, submit for DSR
  3. click on fullfil page that DS_Profile is reflected, It is. Do not change anything. Go to step4
  4. delete the DS_Profile created in step1 , while the DSR is still pending
  5. click on fullfil page that DS_Profile is reflected
    Expected: Some kind of error that associated DS_Profile doesn't exist should be displayed
    Actual: DS_Profile is unassociated from the DS and no notification/message is displayed. Able to fullfil the DSR
@mitchell852
Copy link
Member

mitchell852 commented Jul 15, 2019

For scenario 1 these are the delivery service types:

image

and although TP and the TO api allows you to create new delivery service types, you really shouldn't because without other code changes, your new "type" will have no effect. These types are static in nature.

Can you check in the browser's dev console to ensure that an error isn't being returned and maybe the UI is simply failing to display it because fulfilling a ds without a type (because you deleted it) should DEFINITELY return an error.

^^ really, an issue here (in addition to the missing error message) is that TP/TO API should not let you create/edit/delete "static" types. On the other hand, creating/editing/deleting "dynamic" types is mostly OK. i.e. creating EDGE_FOO or MID_FOO is fine because creating anything that starts with EDGE or MID are the only 2 types that you can create dynamically. i'll created an issue for that - #3728

@mitchell852
Copy link
Member

mitchell852 commented Jul 16, 2019

@lbathina - i tried scenario 1 -

  1. created a DNS_FOO type
  2. created a new DS of type=DNS_FOO (which created a ds request)
  3. deleted DNS_FOO

and when i try to fulfill the ds request, i'm getting this error in the browser's dev console:

TypeError: Cannot read property 'name' of undefined at TableDeliveryServiceRequestsController.js:254

https://github.com/apache/trafficcontrol/blob/master/traffic_portal/app/src/common/modules/table/deliveryServiceRequests/TableDeliveryServiceRequestsController.js#L254

that is why "nothing" is happening. the error is preventing the UI from navigating to the fulfill page but the error is silent. I'll get a PR in for this.

@mitchell852 mitchell852 self-assigned this Jul 16, 2019
@mitchell852
Copy link
Member

mitchell852 commented Jul 16, 2019

re: scenario 2.

  1. created an AAA DS_profile
  2. created a DS with profile=AAA (which created a ds request)
  3. deleted AAA profile
  4. checked ds request and profile is now blank

the real problem here is that the system should have never allowed you to delete a profile (AAA) that is associated with something. in this case the AAA is associated with an active ds request. the issue is really that you should not be able to delete any of these things (type, profile, cdn, tenant) if they are attached to an active (state=draft or submitted) ds request.

@mitchell852 mitchell852 removed their assignment Jul 16, 2019
@mitchell852 mitchell852 added Traffic Ops related to Traffic Ops bug something isn't working as intended labels Jul 16, 2019
@lbathina
Copy link
Author

Sure. Will spin a new ticket for #2

@lbathina
Copy link
Author

Scenario 1 -> tracked in #3728
this ticket for scenario 2

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 Traffic Ops related to Traffic Ops
Projects
None yet
Development

No branches or pull requests

2 participants