cskoglun / ciscodnacbackupctl

Other
15 stars 2 forks source link

purge stops on HTTP/1.1 504 Gateway Time-out #25

Closed Ivanszky closed 6 months ago

Ivanszky commented 1 year ago

Quite frequently DNAC's response to a backup DELETE is a "HTTP/1.1 504 Gateway Time-out", which causes an exception in ciscodnacbackupctl and stops the current purge, so further backups are not deleted in that scheduled job.

However, even though DNACs response is HTTP504, the backup deletion is successful in the background. I suggest to ignore HTTP 504, and continue with the deletion of the other scheduled backups.

send: b'DELETE /api/system/v1/maglev/backup/4d7e692e-24b6-4498-afb2-bfec2c393c55 HTTP/1.1\r\nHost: dnac.mvmi.net\r\nUser-Agent: python-requests/2.28.2\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json\r\nConnection: keep-alive\r\nX-Auth-Token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NDJhYjI1NDg1OTk4NjZiNzkyZDAzODIiLCJhdXRoU291cmNlIjoiaW50ZXJuYWwiLCJ0ZW5hbnROYW1lIjoiVE5UMCIsInJvbGVzIjpbIjY0MmFiMjAzODU5OTg2NmI3OTJkMDM1NCJdLCJ0ZW5hbnRJZCI6IjYyNGM3OTUyYWIyMGVhMDc3YmJlNWZjOCIsImV4cCI6MTY4MTQxNDIxNywiaWF0IjoxNjgxNDEwNjE3LCJqdGkiOiI4NWEzZTIxNS1jNDZmLTQ1ZGEtYTU2MC0wMDA0NmU4MTY2M2MiLCJ1c2VybmFtZSI6ImNpc2NvZG5hY2JhY2t1cGN0bCJ9.SV3QumJV3Di3FDZZskM97ubIMyAgp3mAa2zUdV5uP-rzvXpvyh5vxfDznt4loy_nhMz3WJkAo-fcmDGBWzg_1P1pOTWmY5CAs4F3D0IsU24Y2ZVfopGexCYz3RjxHnvdSD0jAESGe2aJXaTBep7PyNJRzAb2O8UzN4l_ySabmFN8T8H0-IrwzRTDCoEC13afoDGOXbYo5dwaCcnMyI-at8MasytO61tfToeTtIbgaRKRnnw4-aDmTCao851WLLOdpGpEvG_DyEkxj-VydY-NER6ZOzugEf5f8qHZKZmo9uoPsGlCPtosJUGQ4TEL2I68c3qb7uxV3YSE_jTnZPhyqA\r\nContent-Type: application/json\r\nContent-Length: 0\r\n\r\n'
reply: 'HTTP/1.1 504 Gateway Time-out\r\n'
header: Date: Thu, 13 Apr 2023 18:31:17 GMT
header: Content-Type: application/json
header: Transfer-Encoding: chunked
header: Connection: keep-alive
header: x-request-id: ccd4ae894a5f900c05770b67d11cc223
header: Vary: Origin
header: Access-Control-Allow-Origin: pa-dnac.mvmi.net
header: Server: kong/0.14.1
header: Cache-Control: no-store
header: Pragma: no-cache
header: Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data:
header: X-Content-Type-Options: nosniff
header: X-XSS-Protection: 1
header: Strict-Transport-Security: max-age=31536000; includeSubDomains
header: X-Frame-Options: SAMEORIGIN
[18:31:17] Cisco DNA Center isn't available - 'response'                     
Ivanszky commented 1 year ago

https://github.com/cskoglun/ciscodnacbackupctl/pull/27

robertcsapo commented 1 year ago

I'm looking at the PR request #27 Is anyone else hitting the same issue?

Did you always face this http status on Cisco DNA Center when deleting backups? Any issues if you try to delete backups in the Web UI?

Ivanszky commented 1 year ago

Not always, but most of the time (90-95%). (this is a DN2-HW-APL-XL with approx. 500 devices in the inventory, so well within the specified scale (5000 devices).)

Errors also happen on the webGUI sometimes when I delete backups.

Ivanszky commented 1 year ago

I have opened a TAC case to verify if this behaviour is by design or a bug on DNAC side.

Ivanszky commented 1 year ago

status update on TAC case: -TAC states that backup API is not supported -but because the same issue can be seen when using the GUI, TAC is looking into it

Ivanszky commented 1 year ago

Cisco opened a bug for this DNAC behaviour (CSCwf61205). I assume that means this should be handled on the DNAC side and not in ciscodnacbackupctl.

robertcsapo commented 7 months ago

https://bst.cisco.com/bugsearch/bug/CSCwf01639

Fixed in 2.3.5.x