Updating a custom field containing unicode data triggers an internal server error.
jobec opened this issue · 5 comments
When using the code below, an internal server error is triggered in NetMRI:
import infoblox_netmri
netmri = infoblox_netmri.InfobloxNetMRI(
host='infoblox-netmri',
username='xxxxxxx',
password='xxxxxxx',
api_version='3',
ssl_verify=False
)
params = {
'DeviceID': 1234,
'custom_somefield': 'somê tèxt'
}
netmri.api_request("devices/update", params)
Error message:
Encoding::CompatibilityError in Api/devicesController#update incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string
When doing this update via a GET request, it is working:
https://infoblox-netmri/api/3/devices/update?DeviceID=1234&custom_somefield=somê tèxt
I have a case open with Infoblox for this (170322-000033) as I would expect this to be possible via a POST request. But nothing is moving via that channel.
I also do not know the exact implications of changing this line into making a GET request instead. Could be other sorts of requests will fail.
@johnbelamaric Any suggestions on how to fix this?
Fix the issue in NetMRI? Or only make GET requests in this package?
NetMRI API is indifferent to whether it is GET or POST (though apparently there is some issue with the POST). The GET is fine as long as the query string doesn't exceed the limit, which is 2k if I remember correctly.
You should be able to change that to GET, but it could be an issue for very large queries. Ultimately we should fix the issue in NetMRI.
Meanwhile this got fixed with hotfix NETMRI-28761