trafficcontrol: To: INternal server error when server capability associated with Server/ds is deleted

I’m submitting a …

  • bug report
  • new feature / enhancement request
  • improvement request (usability, performance, tech debt, etc.)
  • other

Traffic Control components affected …

  • CDN in a Box
  • Documentation
  • Grove
  • Traffic Control Client
  • Traffic Monitor
  • Traffic Ops
  • Traffic Ops ORT
  • Traffic Portal
  • Traffic Router
  • Traffic Stats
  • Traffic Vault
  • unknown

Current behavior:

When a server capability associated with a server is deleted, we get internal server error

Expected / new behavior:

Should return error Server capability <name> cannot be deleted when servers are associated to it.

Minimal reproduction of the problem with instructions:

  1. create server capability
  2. Associate it to a server
  3. delete the server capability created in step1

Anything else:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

yep. I will raise a new issue for that.

looks like this bug has been fixed. however, the error message is less than ideal and that is because of the nature of the shared handlers used to implement these apis.

image

I’d like to close this issue as fixed and open another one to address the poor nature of error messages globally throughout the API.

It likely doesn’t check both and that error message isn’t strictly wrong. It’s just not as correct as it could be.

The actual error message comes from a generic interface meaning it effects numerous endpoints and should be handled separately.

that’s what i figured. it’s a pretty bad error message but not sure it is blocking this bug from being closed. what do you think @lbathina ? imo however, maybe we need a new issue to address these poor, unfriendly error messages. maybe with the info that @mhoppa has, he can create that issue with the necessary info and we can mark it as tech debt and/or improvement or maybe even api 2.x.

also the message displayed for api is partially correct {“alerts”:[{“text”:“cannot delete server_capability because it is being used by a server_server_capability”,“level”:“error”}]} it could be server_server_capability or required capability - can this be updated to user friendly message without exposing db tables?

this is a bug, not an improvement. deleting a server capability that is assigned to a server or a ds should result in a 400 Bad Request (i think this is normal functionality) or a 409 like @ocket8888 suggested if you want to do it better.

Error code should be 409 Conflict IMO.