Skip to content

Ansible fails to stop monitoring: 'NoneType' object has no attribute 'read' #1089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
php-coder opened this issue Jul 20, 2019 · 11 comments
Open
Assignees
Labels
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Jul 20, 2019

TASK [Stopping monitoring] *****************************************************
fatal: [my-stamps.ru]: FAILED! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "Traceback (most recent call last):\r\n File "/tmp/ansible_08uSCH/ansible_module_uptimerobot.py", line 168, in \r\n main()\r\n File "/tmp/ansible_08uSCH/ansible_module_uptimerobot.py", line 146, in main\r\n check_result = checkID(module, params)\r\n File "/tmp/ansible_08uSCH/ansible_module_uptimerobot.py", line 97, in checkID\r\n result = req.read()\r\nAttributeError: 'NoneType' object has no attribute 'read'\r\n", "msg": "MODULE FAILURE", "parsed": false}

Seen there: https://travis-ci.org/php-coder/mystamps/jobs/561482192

At this moment, deploy to production is blocked by this error.

@php-coder
Copy link
Owner Author

Here is a workaround: resest UPTIMEROBOT_APIKEY env variable, so this part will be skipped.

@php-coder
Copy link
Owner Author

There is a theory that it could be related to version change of requests library.

php-coder added a commit that referenced this issue Jul 21, 2019
annazarubina pushed a commit to annazarubina/mystamps that referenced this issue Jul 23, 2019
@php-coder php-coder modified the milestones: 0.4.1, 0.4.2 Sep 8, 2019
@php-coder
Copy link
Owner Author

Might be solved after Ansible update (#1142)

@php-coder php-coder pinned this issue Dec 2, 2019
php-coder added a commit that referenced this issue Dec 2, 2019
…n error during deploy."

This reverts commit ef4abbb.

Part of #1089
php-coder added a commit that referenced this issue Dec 2, 2019
This is another workaround for #1089 but this time we execute code and just ignore possible errors.
This allows us to check whether the issue is still reproduceable because we've already updated
Ansible for a couple of versions and it also possible that it was something related to uptimerobot
site. If the error won't happend for a couple of deploys, I'll treat it as fixed and revert this
commit.

Relate to #1089
@php-coder
Copy link
Owner Author

It didn't fail now: https://travis-ci.org/php-coder/mystamps/jobs/619864609

I'll try more times and if it doesn't break, I'll assume that the issue is fixed.

@php-coder
Copy link
Owner Author

php-coder added a commit that referenced this issue Dec 28, 2019
@php-coder
Copy link
Owner Author

It have never fallen since the first Ansible update so I'm closing it.

@php-coder php-coder added the resolution/gone Non-reproducible, obsolete, outdated issues label Dec 28, 2019
@php-coder
Copy link
Owner Author

/spent 6m

@php-coder php-coder unpinned this issue Dec 28, 2019
@php-coder php-coder removed the resolution/gone Non-reproducible, obsolete, outdated issues label Jan 24, 2020
@php-coder php-coder modified the milestones: 0.4.2, 0.4.3 Jan 24, 2020
@php-coder
Copy link
Owner Author

php-coder commented Jan 24, 2020

It has happened again: https://travis-ci.org/php-coder/mystamps/jobs/641141457:

TASK [Stopping monitoring] *****************************************************

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'read'

fatal: [my-stamps.ru]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "module_stderr": "Shared connection to my-stamps.ru closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File "/data/mystamps/.ansible/tmp/ansible-tmp-1579858278.32-251061803888530/AnsiballZ_uptimerobot.py", line 102, in \r\n _ansiballz_main()\r\n File "/data/mystamps/.ansible/tmp/ansible-tmp-1579858278.32-251061803888530/AnsiballZ_uptimerobot.py", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File "/data/mystamps/.ansible/tmp/ansible-tmp-1579858278.32-251061803888530/AnsiballZ_uptimerobot.py", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible.modules.monitoring.uptimerobot', init_globals=None, run_name='main', alter_sys=True)\r\n File "/usr/lib/python2.7/runpy.py", line 188, in run_module\r\n fname, loader, pkg_name)\r\n File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code\r\n mod_name, mod_fname, mod_loader, pkg_name)\r\n File "/usr/lib/python2.7/runpy.py", line 72, in _run_code\r\n exec code in run_globals\r\n File "/tmp/ansible_uptimerobot_payload_wdF6O6/ansible_uptimerobot_payload.zip/ansible/modules/monitoring/uptimerobot.py", line 151, in \r\n File "/tmp/ansible_uptimerobot_payload_wdF6O6/ansible_uptimerobot_payload.zip/ansible/modules/monitoring/uptimerobot.py", line 131, in main\r\n File "/tmp/ansible_uptimerobot_payload_wdF6O6/ansible_uptimerobot_payload.zip/ansible/modules/monitoring/uptimerobot.py", line 82, in checkID\r\nAttributeError: 'NoneType' object has no attribute 'read'\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

@php-coder php-coder reopened this Jan 24, 2020
@php-coder
Copy link
Owner Author

Perhaps it the same as ansible/ansible#66242

@php-coder php-coder added the ADR/needed A decision has been made and it needs to be documented label Feb 9, 2020
@php-coder php-coder modified the milestones: 0.4.3, 0.5 Mar 13, 2020
@php-coder php-coder modified the milestones: 0.5, next Apr 3, 2020
@php-coder
Copy link
Owner Author

@php-coder
Copy link
Owner Author

After commit b4e5123, the failure is more readable now (https://app.travis-ci.com/github/php-coder/mystamps/jobs/582050337):

TASK [Stopping monitoring] *****************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'read'
fatal: [my-stamps.ru]: FAILED! => {
    "changed": false,
    "rc": 1
}

MSG:

MODULE FAILURE
See stdout/stderr for the exact error


MODULE_STDOUT:

Traceback (most recent call last):
  File "/data/mystamps/.ansible/tmp/ansible-tmp-1662526163.8195474-187952116238811/AnsiballZ_uptimerobot.py", line 102, in <module>
    _ansiballz_main()
  File "/data/mystamps/.ansible/tmp/ansible-tmp-1662526163.8195474-187952116238811/AnsiballZ_uptimerobot.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/data/mystamps/.ansible/tmp/ansible-tmp-1662526163.8195474-187952116238811/AnsiballZ_uptimerobot.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.monitoring.uptimerobot', init_globals=None, run_name='__main__', alter_sys=True)
  File "/usr/lib/python2.7/runpy.py", line 188, in run_module
    fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_uptimerobot_payload_VNjiwb/ansible_uptimerobot_payload.zip/ansible/modules/monitoring/uptimerobot.py", line 151, in <module>
  File "/tmp/ansible_uptimerobot_payload_VNjiwb/ansible_uptimerobot_payload.zip/ansible/modules/monitoring/uptimerobot.py", line 131, in main
  File "/tmp/ansible_uptimerobot_payload_VNjiwb/ansible_uptimerobot_payload.zip/ansible/modules/monitoring/uptimerobot.py", line 82, in checkID
AttributeError: 'NoneType' object has no attribute 'read'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant