Error with MIQ-PHPIPAM-v1.2

Hi All,

I am trying to get IPM working (against PHPIPAM v 1.3) and I get the following error at the reserveFirstAddress section. Any ideas?

INFO  PXE PHPIPAM Entering reserveFirstAddress
ERROR  The following error occurred during method evaluation:
ERROR    URI::InvalidURIError: bad URI(is not URI?): https://XXX.XXX.XXX.XXX/api/miq/subnets/["284", "287", "291", "167", "292", "293", "294", "295", "296", "297", "298", "288", "299", "300", "301", "302", "303", "494", "495", "496", "497", "498", "499", "500", "501", "502", "503", "504", "304", "505", "506", "507", "508", "305", "306", "510", "511", "512", "513", "289", "307", "308", "309", "310", "311", "312", "313", "314", "290", "315", "316", "317", "318", "319", "320", "321", "322", "285", "323", "330", "331", "332", "333", "334", "335", "336", "324", "337", "338", "325", "339", "343", "326", "347", "351", "286", "327", "355", "359", "328", "363", "367", "329", "371", "375", "1226", "1227", "1228", "1220", "1222", "489", "1223", "1221", "1224", "1225", "490", "491", "492", "538", "548", "493", "549", "550", "551", "557", "558", "559", "561", "539", "552", "553", "554", "555", "556", "562", "563", "564", "540", "542", "543", "544", "565", "568", "569", "570", "571", "541", "566", "567", "572", "573", "1206", "1216", "1217", "1218", "1219", "740", "487", "485", "486", "488"]/first_free/
ERROR    /usr/local/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in `split'
ERROR Method STDERR: /usr/local/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in `split': bad URI(is not URI?): https://XXX.XXX.XXX.XXX/api/miq/subnets/["284", "287", "291", "167", "292", "293", "294", "295", "296", "297", "298", "288", "299", "300", "301", "302", "303", "494", "495", "496", "497", "498", "499", "500", "501", "502", "503", "504", "304", "505", "506", "507", "508", "305", "306", "510", "511", "512", "513", "289", "307", "308", "309", "310", "311", "312", "313", "314", "290", "315", "316", "317", "318", "319", "320", "321", "322", "285", "323", "330", "331", "332", "333", "334", "335", "336", "324", "337", "338", "325", "339", "343", "326", "347", "351", "286", "327", "355", "359", "328", "363", "367", "329", "371", "375", "1226", "1227", "1228", "1220", "1222", "489", "1223", "1221", "1224", "1225", "490", "491", "492", "538", "548", "493", "549", "550", "551", "557", "558", "559", "561", "539", "552", "553", "554", "555", "556", "562", "563", "564", "540", "542", "543", "544", "565", "568", "569", "570", "571", "541", "566", "567", "572", "573", "1206", "1216", "1217", "1218", "1219", "740", "487", "485", "486", "488"]/first_free/ (URI::InvalidURIError)
ERROR Method STDERR: 	from /usr/local/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in `parse'
ERROR Method STDERR: 	from /usr/local/lib/ruby/2.5.0/uri/common.rb:237:in `parse'
ERROR Method STDERR: 	from /usr/local/lib/ruby/gems/2.5.0/gems/httparty-0.18.1/lib/httparty/request.rb:74:in `path='
ERROR Method STDERR: 	from /usr/local/lib/ruby/gems/2.5.0/gems/httparty-0.18.1/lib/httparty/request.rb:64:in `initialize'
ERROR Method STDERR: 	from /usr/local/lib/ruby/gems/2.5.0/gems/httparty-0.18.1/lib/httparty.rb:594:in `new'
ERROR Method STDERR: 	from /usr/local/lib/ruby/gems/2.5.0/gems/httparty-0.18.1/lib/httparty.rb:594:in `perform_request'
ERROR Method STDERR: 	from /usr/local/lib/ruby/gems/2.5.0/gems/httparty-0.18.1/lib/httparty.rb:508:in `get'
ERROR Method STDERR: 	from /usr/local/lib/ruby/gems/2.5.0/gems/httparty-0.18.1/lib/httparty.rb:627:in `get'
ERROR Method STDERR: 	from /Custom/phpipam-v1.2/PHPIPAM/AcquireIPAddress:88:in `reserveFirstAddress'
ERROR Method STDERR: 	from /Custom/phpipam-v1.2/PHPIPAM/AcquireIPAddress:126:in `<main>'
ERROR Aborting instantiation (unknown method return code) because [Method exited with rc=Unknown RC: [1]]
ERROR State=<PXEGetIPAddress> running  raised exception: <Method exited with rc=Unknown RC: [1]>
WARN Error in State=[PXEGetIPAddress]

Thanks, Andy

Hello!
This is probably because the search function (findSubnetMatch) for a suitable subnet returns multiple matches as an array. But reserveFirstAddress is made so that the only subnet ID that it uses when generating the url is waiting for input.

Depending on the situation, you can try to adjust one of these functions (or attributes in IPAM that are being searched for, so that there is only one match in any case )

Awesome, I’ll look in the morning. Thanks.

That was it. Thanks so much.