# Cannot connect to Mikrotik

**URL:** <https://forum.ansible.com/t/cannot-connect-to-mikrotik/1469>\
**Category:** Get Help\
**Tags:** mikrotik, network\
**Created:** [October 6, 2023, 12:44am UTC](https://forum.ansible.com/t/cannot-connect-to-mikrotik/1469 "2023-10-06T00:44:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maysirahza](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@maysirahza](https://forum.ansible.com/u/maysirahza)\
**Post date:** [October 6, 2023, 12:44am UTC](https://forum.ansible.com/t/cannot-connect-to-mikrotik/1469/1 "2023-10-06T00:44:16Z")

</div>

Hello All  
I had this ansible server for almost 2 years and for almost 2 years the ansible work fine , but last month I had problem, the ansible cannot connect to mikrotik  
I got this error

The full traceback is:

```auto
Traceback (most recent call last):
  File "/home/dosen/.ansible/tmp/ansible-local-6498h0vdr2gy/ansible-tmp-1696550165.801094-6503-79510264699825/AnsiballZ_routeros_command.py", line 102, in <module>
    _ansiballz_main()
  File "/home/dosen/.ansible/tmp/ansible-local-6498h0vdr2gy/ansible-tmp-1696550165.801094-6503-79510264699825/AnsiballZ_routeros_command.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/dosen/.ansible/tmp/ansible-local-6498h0vdr2gy/ansible-tmp-1696550165.801094-6503-79510264699825/AnsiballZ_routeros_command.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.network.routeros.routeros_command', init_globals=None, run_name=' __main__', alter_sys=True)
  File "/opt/anaconda3/lib/python3.8/runpy.py", line 207, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/opt/anaconda3/lib/python3.8/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/opt/anaconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/modules/network/routeros/routeros_command.py", line 187, in <module>
  File "/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/modules/network/routeros/routeros_command.py", line 157, in main
  File "/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/network/routeros/routeros.py", line 125, in run_commands
  File "/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/network/routeros/routeros.py", line 55, in get_connection
  File "/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/network/routeros/routeros.py", line 69, in get_capabilities
  File "/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/connection.py", line 185, in __rpc__
ansible.module_utils.connection.ConnectionError: [Errno None] Unable to connect to port 21112 on 72.6.20.122
fatal: [72.26.204.188]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n File \"/home/dosen/.ansible/tmp/ansible-local-6498h0vdr2gy/ansible-tmp-1696550165.801094-6503-79510264699825/AnsiballZ_routeros_command.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/dosen/.ansible/tmp/ansible-local-6498h0vdr2gy/ansible-tmp-1696550165.801094-6503-79510264699825/AnsiballZ_routeros_command.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/dosen/.ansible/tmp/ansible-local-6498h0vdr2gy/ansible-tmp-1696550165.801094-6503-79510264699825/AnsiballZ_routeros_command.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.network.routeros.routeros_command', init_globals=None, run_name=' __main__', alter_sys=True)\n File \"/opt/anaconda3/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/opt/anaconda3/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/opt/anaconda3/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/modules/network/routeros/routeros_command.py\", line 187, in <module>\n File \"/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/modules/network/routeros/routeros_command.py\", line 157, in main\n File \"/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/network/routeros/routeros.py\", line 125, in run_commands\n File \"/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/network/routeros/routeros.py\", line 55, in get_connection\n File \"/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/network/routeros/routeros.py\", line 69, in get_capabilities\n File \"/tmp/ansible_routeros_command_payload_qk35iqza/ansible_routeros_command_payload.zip/ansible/module_utils/connection.py\", line 185, in __rpc__ \nansible.module_utils.connection.ConnectionError: [Errno None] Unable to connect to port 21112 on 72.6.20.122\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

```

Any Idea how to fix this?

---

<div class="post-metadata">

**Author:** ![IPvSean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ipvsean/32/1153_2.png) [@IPvSean](https://forum.ansible.com/u/IPvSean)\
**Post date:** [October 6, 2023, 5:36pm UTC](https://forum.ansible.com/t/cannot-connect-to-mikrotik/1469/2 "2023-10-06T17:36:18Z")

</div>

> [@maysirahza](#):
>
> `Unable to connect to port 21112 on 72.6.20.122`

Does this look right? Any other info you can provide, did you upgrade a content collection, upgrade your Ansible-Core version? etc?
