Infoblox-PS / ibx-sdk

Basic Tools and Functions used by other Integrations.
Apache License 2.0
4 stars 0 forks source link

grid_restore method fails when using an IP address for the Grid Manager #61

Closed yeti9990 closed 9 months ago

yeti9990 commented 10 months ago

while implementing tests, i came across an issue with the grid_restore() method in the fileop MixIn. It fails with an HTTP 413 Request Entity too large error:

2023-12-29 12:53:51 [connectionpool.py:546] DEBUG https://192.168.40.60:443 "POST /http_direct_file_io/req_id-UPLOAD-1229195351669162/database HTTP/1.1" 413 388
2023-12-29 12:53:51 [fileop.py:767] DEBUG ('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n'
 '<html><head>\n'
 '<title>413 Request Entity Too Large</title>\n'
 '</head><body>\n'
 '<h1>Request Entity Too Large</h1>\n'
 'The requested resource<br '
 '/>/http_direct_file_io/req_id-UPLOAD-1229195351669162/database<br />\n'
 'does not allow request data with POST requests, or the amount of data '
 'provided in\n'
 'the request exceeds the capacity limit.\n'
 '</body></html>\n')
2023-12-29 12:53:51 [fileop.py:770] ERROR 413 Client Error: Request Entity Too Large for url: https://192.168.40.60/http_direct_file_io/req_id-UPLOAD-1229195351669162/database
2023-12-29 12:53:51 [nios_grid_restore.py:102] ERROR wapi error - 413 Client Error: Request Entity Too Large for url: https://192.168.40.60/http_direct_file_io/req_id-UPLOAD-1229195351669162/database

This ONLY happens when you supply an IP address to the Gift() class grid_mgr property. It doesn't happen if you use an FQDN.

mjsmithkc commented 10 months ago

@yeti9990 - I do believe this has been resolved. Please confirm.

yeti9990 commented 9 months ago

@mjsmithkc Nope - this still exists. It's an artifact in 8.6.x when you install CNA and/or use CAS authentication.

I just ran it:

ppiper@studio ➜  tmp  grid-restore -g 192.168.40.60 -f database.bak
Enter password for [admin]:
2024-02-01 12:47:07 [nios_grid_restore.py:103] INFO connected to Infoblox grid manager 192.168.40.60
2024-02-01 12:47:07 [fileop.py:524] INFO step 1 - Restoring database from database.bak
2024-02-01 12:47:07 [fileop.py:525] INFO step 2 - request uploadinit database.bak
2024-02-01 12:47:07 [fileop.py:541] INFO step 3 - post the files using the upload_url provided
2024-02-01 12:47:07 [fileop.py:769] ERROR 413 Client Error: Request Entity Too Large for url: https://192.168.40.60/http_direct_file_io/req_id-UPLOAD-0201194707659532/database
2024-02-01 12:47:07 [nios_grid_restore.py:112] ERROR wapi error - 413 Client Error: Request Entity Too Large for url: https://192.168.40.60/http_direct_file_io/req_id-UPLOAD-0201194707659532/database
yeti9990 commented 9 months ago

FQDN no problem

ppiper@studio ➜  tmp  grid-restore -g ibx-gm.ddiguru.net -f database.bak
Enter password for [admin]:
2024-02-01 12:48:52 [nios_grid_restore.py:103] INFO connected to Infoblox grid manager ibx-gm.ddiguru.net
2024-02-01 12:48:52 [fileop.py:524] INFO step 1 - Restoring database from database.bak
2024-02-01 12:48:52 [fileop.py:525] INFO step 2 - request uploadinit database.bak
2024-02-01 12:48:52 [fileop.py:541] INFO step 3 - post the files using the upload_url provided
2024-02-01 12:48:52 [fileop.py:550] INFO step 4 - execute the grid restore
2024-02-01 12:49:01 [fileop.py:561] INFO Grid restore successful!
yeti9990 commented 9 months ago

@mjsmithkc i guess we can close this since it's a NIOS thing not ibx-sdk