Skip to content
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

[collect db dump] Collect DB dump issues on multi ASIC platform #5251

Closed
smaheshm opened this issue Feb 28, 2022 · 2 comments
Closed

[collect db dump] Collect DB dump issues on multi ASIC platform #5251

smaheshm opened this issue Feb 28, 2022 · 2 comments
Assignees
Labels
Bug 🐛 multi-ASIC Multi ASIC platform

Comments

@smaheshm
Copy link
Contributor

Description

There are couple of issues with collect DB dump on multi ASIC.

  • 'redis-dump' output filename matches with the directory name within the same folder

e.g.

admin@svcstr-nmasic-acs-1:/tmp/db_dump/test_techsupport$ find .
.
./test_techsupport[acl-svcstr-nmasic-acs-1]
./test_techsupport[acl-svcstr-nmasic-acs-1]/3
./test_techsupport[acl-svcstr-nmasic-acs-1]/2
  • Getting decode error, not sure if it's related to 201911 release, in which case output can be skipped

admin@svcstr-nmasic-acs-1:~$ redis-dump -d 6 
{"PROCESS_STATS|6481":{"type":"hash","value":{"%MEM":"0.0","UID":"0","TT":"?","CMD":"[process_checker] <defunct>","%CPU":"5.6","STIME":"18:46","TIME":"00:00:00","PPID":"3196"}},"PROCESS_STATS|17762":{"type":"hash","value":{"%MEM":"0.1","UID":"0","TT":"pts/0","CMD":"/usr/bin/python /usr/bin/supervisord","%CPU":"0.0","STIME":"Feb26","TIME":"00:00:47","PPID":"17728"}},"PROCESS_STATS|20455":{"type":"hash","value":{"%MEM":"0.0","UID":"1000","TT":"?","CMD":"/bin/bash /usr/bin/lldp.sh wait 4","%CPU":"0.0","STIME":"Feb26","TIME":"00:00:00","PPID":"1"}},"PROCESS_STATS|18261":{"type":"hash","value":{"%MEM":"0.0","UID":"0","TT":"pts/0","CMD":"/usr/bin/dsserve /usr/bin/syncd --diag -u -p /etc/sai.d/sai.profile","%CPU":"0.0","STIME":"Feb26","TIME":"00:00:01","PPID":"16446"}}Traceback (most recent call last):
  File "/usr/local/bin/redis-dump", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/redisdl.py", line 665, in main
    do_dump(options)
  File "/usr/local/lib/python2.7/dist-packages/redisdl.py", line 586, in do_dump
    dump(output, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/redisdl.py", line 173, in dump
    for key, type, ttl, value in _reader(r, pretty, encoding, keys):
  File "/usr/local/lib/python2.7/dist-packages/redisdl.py", line 283, in _reader
    pretty=pretty, encoding=encoding):
  File "/usr/local/lib/python2.7/dist-packages/redisdl.py", line 340, in _read_keys
    value = reader.handle_response(results[i*3], pretty, encoding)
  File "/usr/local/lib/python2.7/dist-packages/redisdl.py", line 241, in handle_response
    value[k.decode(encoding)] = response[k].decode(encoding)
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 2: invalid start byte

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Additional information you deem important:

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
@sanmalho-git
Copy link
Contributor

Also seeing the following issues:

  • the redis-dump is not collecting the dumps from each asic on a mulit-asic DUT - instead from the global databases.
  • If the test case is parameterized and has a name that has spaces, then the redis-dump command fails. Example parameterized test case name:
    • tests.platform_tests.sfp.test_sfputil/test_check_sfputil_error_status[ixre-egl-board3-0-sudo sfputil show error-status]. For this test case failure get exception:

E RunAnsibleModuleFail: run module shell failed, Ansible Results =>
E {
E "changed": true,
E "cmd": "redis-dump -d 0 -y -o /tmp/db_dump/tests.platform_tests.sfp.test_sfputil/test_check_sfputil_error_status[ixre-egl-board3-0-sudo sfputil show error-status]/0",
E "delta": "0:00:00.127111",
E "end": "2022-03-06 04:55:02.133187",
E "failed": true,
E "invocation": {
E "module_args": {
E "_raw_params": "redis-dump -d 0 -y -o /tmp/db_dump/tests.platform_tests.sfp.test_sfputil/test_check_sfputil_error_status[ixre-egl-board3-0-sudo sfputil show error-status]/0",
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": 4,
E "start": "2022-03-06 04:55:02.006076",
E "stderr": "",
E "stderr_lines": [],
E "stdout": "Usage: redis-dump [options]\n\nDump data from specified or default redis.\n\nIf no output file is specified, dump to standard output.\n\nOptions:\n -h, --help show this help message and exit\n -H HOST, --host=HOST connect to HOST (default localhost)\n -p PORT, --port=PORT connect to PORT (default 6379)\n -s SOCKET, --socket=SOCKET\n connect to SOCKET\n -w PASSWORD, --password=PASSWORD\n connect with PASSWORD\n -d DB, --db=DB dump DATABASE (0-N, default 0)\n -k KEYS, --keys=KEYS dump only keys matching specified glob-style pattern\n -o OUTPUT, --output=OUTPUT\n write to OUTPUT instead of stdout\n -y, --pretty split output on multiple lines and indent it\n -E ENCODING, --encoding=ENCODING\n set encoding to use while decoding data from redis",
E "stdout_lines": [
E "Usage: redis-dump [options]",
E "",
E "Dump data from specified or default redis.",
E "",
E "If no output file is specified, dump to standard output.",
E "",
E "Options:",
E " -h, --help show this help message and exit",
E " -H HOST, --host=HOST connect to HOST (default localhost)",
E " -p PORT, --port=PORT connect to PORT (default 6379)",
E " -s SOCKET, --socket=SOCKET",
E " connect to SOCKET",
E " -w PASSWORD, --password=PASSWORD",
E " connect with PASSWORD",
E " -d DB, --db=DB dump DATABASE (0-N, default 0)",
E " -k KEYS, --keys=KEYS dump only keys matching specified glob-style pattern",
E " -o OUTPUT, --output=OUTPUT",
E " write to OUTPUT instead of stdout",
E " -y, --pretty split output on multiple lines and indent it",
E " -E ENCODING, --encoding=ENCODING",
E " set encoding to use while decoding data from redis"
E ]
E }

@xwjiang-ms
Copy link
Contributor

Fixed in #5326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🐛 multi-ASIC Multi ASIC platform
Projects
None yet
Development

No branches or pull requests

4 participants