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

deliveryservices/id/capacity gives Internal Server Error #4237

Closed
2 of 16 tasks
ericholguin opened this issue Dec 27, 2019 · 6 comments · Fixed by #4999
Closed
2 of 16 tasks

deliveryservices/id/capacity gives Internal Server Error #4237

ericholguin opened this issue Dec 27, 2019 · 6 comments · Fixed by #4999
Labels
regression bug a bug in existing functionality introduced by a new version Traffic Ops related to Traffic Ops

Comments

@ericholguin
Copy link
Contributor

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 making a GET request to /deliveryservices/{{id}}/capacity where the deliverservice id pertains to a delivery service that was recently created and has no server assignments, the response returned is:

HTTP/1.1 500 Internal Server Error
{
    "alerts": [
        {
            "text": "Internal Server Error",
            "level": "error"
        }
    ]
}

Expected / new behavior:

If there is no capacity that can be obtained it should return:

HTTP/1.1 200 OK
{
    "response": {
        "availablePercent": 0,
        "unavailablePercent": 0,
        "utilizedPercent": 0,
        "maintenancePercent": 0
    }
}

Minimal reproduction of the problem with instructions:

Anything else:

error.log shows: getting delivery service capacity: capacity was zero!

@mitchell852 mitchell852 added Traffic Ops related to Traffic Ops bug something isn't working as intended labels Dec 30, 2019
@ocket8888
Copy link
Contributor

Is this a regression? How did Perl handle that situation?

@ericholguin
Copy link
Contributor Author

Looks like it is a regression. The Perl returned:

HTTP/1.1 200 OK
{
    "response": {
        "availablePercent": 0,
        "unavailablePercent": 0,
        "utilizedPercent": 0,
        "maintenancePercent": 0
    }
}

@ocket8888 ocket8888 added the regression bug a bug in existing functionality introduced by a new version label Jan 2, 2020
@ocket8888 ocket8888 assigned ocket8888 and unassigned ocket8888 Jan 2, 2020
@mitchell852 mitchell852 removed the bug something isn't working as intended label Aug 13, 2020
@rimashah25
Copy link
Contributor

@ocket8888 @mitchell852 Same issue was reported and resolved.
Issue Reported: #4848
Solution: #4892

This bug has been fixed and needs to be closed.

@ocket8888
Copy link
Contributor

No, that was a different endpoint. That was /cdns/capacity, this is a similar bug in /deliveryservices/{{ID}}/capacity. I just looked at the code and it would seem the issue still exists.

@mitchell852
Copy link
Member

@rimashah25 - remove all servers from ds then snapshot and see what the result of /deliveryservices/{{ID}}/capacity is...

@rimashah25
Copy link
Contributor

rimashah25 commented Aug 18, 2020

Thanks @ocket8888 @mitchell852. I stand corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression bug a bug in existing functionality introduced by a new version Traffic Ops related to Traffic Ops
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants