This repository was archived by the owner on Nov 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 355
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Creating a Delivery Service Request with an ID fails #5014
Copy link
Copy link
Closed
Labels
Traffic Opsrelated to Traffic Opsrelated to Traffic Opsbugsomething isn't working as intendedsomething isn't working as intendedlow impactaffects only a small portion of a CDN, and cannot itself break oneaffects only a small portion of a CDN, and cannot itself break one
Description
I'm submitting a ...
- bug report
Traffic Control components affected ...
- Traffic Ops
Current behavior:
Because of the way workflow transitions are verified, creating a DSR with any non-null value in the id property will cause the request to fail. If id was an integer, though, it will give back the error-level alert: sql: no rows in result set, which is both cryptic and - looking at the code - unnecessary.
Expected / new behavior:
If IDs have special meaning to requests, they should be documented - but it's more likely that the intended behaviour is just to ignore the ID, since it can't reasonably be known before the object is created.
Minimal reproduction of the problem with instructions:
Submit a POST request to /deliveryservice_requests with an integral ID value. The simplest request body to reproduce the error is just {"id": -1} (which should work regardless of extant data).
Anything else:
Full HTTP Stack
POST /api/2.0/deliveryservice_requests HTTP/1.1
User-Agent: python-requests/2.22.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Cookie: mojolicious=eyJhdXRoX2RhdGEiOiJhZG1pbiIsImV4cGlyZXMiOjE1OTkxOTI1ODIsImJ5IjoidHJhZmZpY2NvbnRyb2wtZ28tdG9jb29raWUifQ--2d0e7a169ef17f538d58830ee8451e2113562119
Content-Length: 9
{"id": 2}HTTP/1.1 400 Bad Request
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-Cookie, Cookie
Access-Control-Allow-Methods: POST,GET,OPTIONS,PUT,DELETE
Access-Control-Allow-Origin: *
Content-Encoding: gzip
Content-Type: application/json
Set-Cookie: mojolicious=eyJhdXRoX2RhdGEiOiJhZG1pbiIsImV4cGlyZXMiOjE1OTkxNzQ1ODIsImJ5IjoidHJhZmZpY2NvbnRyb2wtZ28tdG9jb29raWUifQ--88ac7381f3f3d92bb3fd8dc8975be3896a2acc3d; Path=/; Expires=Thu, 03 Sep 2020 23:09:42 GMT; Max-Age=3600; HttpOnly
Vary: Accept-Encoding
Whole-Content-Sha512: kLdrEUgBgalHQ/z01sSUnd5k/TCwjNOnjY6tZWxY88JIhEsiOPoACLxUIGPad+ErIRJ+l2mpC5g8/89l34o0jA==
X-Server-Name: traffic_ops_golang/
Date: Thu, 03 Sep 2020 22:09:42 GMT
Content-Length: 88
{
"alerts": [
{
"text": "sql: no rows in result set",
"level": "error"
}
]
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Traffic Opsrelated to Traffic Opsrelated to Traffic Opsbugsomething isn't working as intendedsomething isn't working as intendedlow impactaffects only a small portion of a CDN, and cannot itself break oneaffects only a small portion of a CDN, and cannot itself break one