You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/08/14 21:53:46 UTC
[GitHub] dangogh opened a new issue #2682: TO Go POST /api/1.3/servers
database access error
dangogh opened a new issue #2682: TO Go POST /api/1.3/servers database access error
URL: https://github.com/apache/trafficcontrol/issues/2682
a `POST` to `/api/1.3/servers` results in a database access error if the profile indicated by the `profileId` has `cdn` entry that is null. The `global` profile is one example. Granted, a profile associated with a CDN should be required, but a sensible error message needs to be returned rather than "database access error".
The error in the traffic ops log is this:
```
ERROR: servers.go:128: could not scan cdnID from profile: sql: Scan error on column index 0: converting driver.Value type <nil> ("<nil>") to a int: invalid syntax
```
Here's a sample JSON for a server. In this case, profileId 1 is the global profile which has no cdn associated with it:
```
{
"cachegroupId": 1,
"cdnId": 1,
"hostName": "ahost",
"ipAddress": "192.168.1.99",
"physLocationId": 1,
"profileId": 1,
"statusId": 6,
"tcpPort": 443,
"typeId": 19,
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services