Failed to parse servicenow.yml with auto plugin: [Errno 111] Connection refused

amoeed78
Giga Contributor

I am running Ansible automation platform 2.4. I integrated AAP with servicenow instance. It was running fine last week. My task is to build the ansible inventory from servicenow CMDB. 

 

itsm collection version: 2.7.0

 

starting yesterday, my instance is not working from AAP or ansible-core. getting following warning messages in AAP log. 

 

host_list declined parsing /runner/project/myservicenow.yml as it did not pass its verify_file() method
script declined parsing /runner/project/myservicenow.yml as it did not pass its verify_file() method
Using inventory plugin 'ansible_collections.servicenow.itsm.plugins.inventory.now' to process inventory source '/runner/project/myservicenow.yml'
toml declined parsing /runner/project/myservicenow.yml as it did not pass its verify_file() method
[WARNING]:  * Failed to parse /runner/project/myservicenow.yml with auto
plugin: [Errno 111] Connection refused
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/auto.py", line 59, in parse
    plugin.parse(inventory, loader, path, cache=cache)
  File "/runner/requirements_collections/ansible_collections/servicenow/itsm/plugins/inventory/now.py", line 697, in parse
    records = fetch_records(
.....
[WARNING]:  * Failed to parse /runner/project/myservicenow.yml with yaml
plugin: Plugin configuration YAML file, not YAML inventory
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/yaml.py", line 114, in parse
    raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
[WARNING]:  * Failed to parse /runner/project/myservicenow.yml with ini plugin:
Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this
character is reserved to provide a port.
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 293, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/ini.py", line 137, in parse
    raise AnsibleParserError(e)
[WARNING]: Unable to parse /runner/project/myservicenow.yml as an inventory
source
ERROR! No inventory was parsed, please check your configuration and options.

 

1 REPLY 1

AndresG
Tera Contributor

I'm having a similar issue. The ending part is exactly the same, I'm getting the 'plugin:' pattern warning and the "ERROR! No inventory was parsed" message,

[WARNING]:  * Failed to parse /runner/project/inventories/snow/now.yaml with ini plugin:
Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this
character is reserved to provide a port.

 
But in my case, I'm not getting the Errno 111 Connection refused message. Instead, I'm getting the following

Failed to parse /runner/project/inventories/snow/now.yaml 
with auto plugin: 'NoneType' object has no attribute 'rstrip'

 

My yaml is really simple, I'm just looking for 1 device, just for testing purposes. When I run this locally from the command line, it works fine, but then from AAP I'm getting that error message and couldn't get it to work.

 

plugin: servicenow.itsm.now

query:
    - name: = devicename