Description
Script test_container_autorestart still fails with the fix of PR #2308
The reason is that container snmp would restart after configured autorestart status with command sudo config feature autorestart snmp enabled. After this configuration, the script immediately runs docker exec snmp supervisorctl status. Because the snmp container is restarting, the docker exec command will fail.
admin@str-msn2700-02:~$ sudo config feature autorestart snmp enabled
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
Error response from daemon: Container f18fd9fe805859de749e94974ff89a529f49090d0c11e50a15aedd6365cb59b5 is not running
admin@str-msn2700-02:~$ docker exec snmp supervisorctl status
dependent-startup STARTING
rsyslogd STOPPED Not started
snmp-subagent STOPPED Not started
snmpd STOPPED Not started
start RUNNING pid 17, uptime 0:00:00
supervisor-proc-exit-listener STARTING
Steps to reproduce the issue:
- Run the test_container_autorestart.py script
Describe the results you received:
The script failed with:
if (res.is_failed or 'exception' in res) and not module_ignore_errors:
> raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res)
E RunAnsibleModuleFail: run module shell failed, Ansible Results =>
E {
E "changed": true,
E "cmd": "docker exec snmp supervisorctl status",
E "delta": "0:00:01.424767",
E "end": "2020-10-10 06:04:49.675678",
E "failed": true,
E "invocation": {
E "module_args": {
E "_raw_params": "docker exec snmp supervisorctl status",
E "_uses_shell": true,
E "argv": null,
E "chdir": null,
E "creates": null,
E "executable": null,
E "removes": null,
E "stdin": null,
E "stdin_add_newline": true,
E "strip_empty_ends": true,
E "warn": true
E }
E },
E "msg": "non-zero return code",
E "rc": 2,
E "start": "2020-10-10 06:04:48.250911",
E "stderr": "",
E "stderr_lines": [],
E "stdout": "error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800",
E "stdout_lines": [
E "error: <class 'xmlrpclib.Fault'>, <Fault 6: 'SHUTDOWN_STATE'>: file: /usr/lib/python2.7/xmlrpclib.py line: 800"
E ]
E }
Describe the results you expected:
The script should wait for snmp to restart after changing its autorestart status.
Additional information you deem important:
**Output of `show version`:**
```
(paste your output here)
```
**Attach debug file `sudo generate_dump`:**
```
(paste your output here)
```
Description
Script
test_container_autorestartstill fails with the fix of PR #2308The reason is that container
snmpwould restart after configured autorestart status with commandsudo config feature autorestart snmp enabled. After this configuration, the script immediately runsdocker exec snmp supervisorctl status. Because thesnmpcontainer is restarting, thedocker execcommand will fail.Steps to reproduce the issue:
Describe the results you received:
The script failed with:
Describe the results you expected:
The script should wait for snmp to restart after changing its autorestart status.
Additional information you deem important: