cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
623
Views
1
Helpful
4
Replies

DNAC API Create site time out

klerb
Level 1
Level 1

Hello,

I'm attempting to create a building using the API.

Here is my POST request:

```json
{
"type": "building",
"site": {
"area": {
"name": "Dan api test",
"parentName": "Global"
},
"building": {
"name": "The Dursleys",
"address": "Privet Drive 4",
"parentName": "Dan api test",
"latitude": "1337",
"longitude": "1338"
}
}
}
```

I receive an HTTP 202 response, but when I check the job, I get the following message:

"{\n \"bapiErrorResponse\" : {\n \"bapiKey\" : \"50b5-89fd-4c7a-930a\",\n \"bapiName\" : \"Create Site\",\n \"bapiErrorCode\" : \"\",\n \"bapiErrorMessage\" : \"\"\n },\n \"componentErrorResponse\" : [ {\n \"compId\" : \"uuid4b784701\",\n \"compName\" : \"GET Location info\",\n \"compErrorCode\" : \"500\",\n \"compErrorMessage\" : \"Connection Timed Out. Please check if proxy is configured. Cause : processAsyncFailureResponse(): Rest execution failed with error; exception details: connect timed out\",\n \"componentType\" : \"REST_CLIENT\"\n } ]\n}",
"runtimeInstanceId": "DNACP_Runtime_64876fdf-70fd-4a4e-98b2-86bbfeba4950"

 

No new building is added and i dont know where to go from here. I can add that I succesfully added the "Area" using the API but cant add buildings. 

 

1 Accepted Solution

Accepted Solutions

 

Thank you once more!

I managed to get it working by specifying the country option. It seems it had difficulty pinpointing the address correctly without the country information, hence the GET Location operation.

 

View solution in original post

4 Replies 4

Not sure this is the 'same' issue https://community.cisco.com/t5/controllers/cisco-dna-center-api-problems-creating-buildings-sites/td-p/4478190

Just based on your error, HTTP 202 response says that the request has been accepted for processing, but the job status message suggests that there's an error. then the 500, suggests that there's a connection timeout, which led me down the bug path... due to the componentErrorResponse section, however, indicates that there's an issue with the GET Location info component, which is a REST client. 
 
I am not 100% sure how much this matters, in payload has address as "Privet Drive 4", which is a valid address, but it's missing the city, state, and country information. The example in the documentation shows a full address with city, state, and country. https://developer.cisco.com/docs/dna-center/creates-a-building/
 
Hope this helps.
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

klerb
Level 1
Level 1

Thank you for the response.

I have also attempted using an actual address with the correct longitude and latitude, but the outcome remains the same.

The DNA server is not directly connected to the internet. Could the GET Location operation be related to the timing out issue? For instance, is the DNA server attempting to download some map data from the internet?

@klerb good call, that make sense, as the error "Connection Timed Out. Please check if proxy is configured. Cause : processAsyncFailureResponse(): Rest execution failed with error; exception details: connect timed out" suggests that your server is trying to make an external connection to retrieve location information, but it's unable to do so due to the lack of internet connectivity.

Thus the server is attempting to download map data or access an external geocoding service to validate the address and retrieve the latitude and longitude coordinates. If the server is not able to access the internet, this operation would indeed time out.

A bit of google fu https://www.cisco.com/c/en/us/td/docs/cloud-systems-management/network-automation-and-management/dna-center/2-2-3/admin_guide/b_cisco_dna_center_admin_guide_2_2_3/b_cisco_dna_center_admin_guide_2_2_3_chapter_010.html

About System Settings
To start using Cisco DNA Center, you must first configure the system settings so that the server can communicate outside the network, ensure secure communications, authenticate users, and perform other key tasks. Use the procedures described in this chapter to configure the system settings.

 There is also a mention of external connection in the docs.

That looks like the issue.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

 

Thank you once more!

I managed to get it working by specifying the country option. It seems it had difficulty pinpointing the address correctly without the country information, hence the GET Location operation.