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

"Traceback" of datasources is a string but not list #3578

Closed
xiangce opened this issue Nov 2, 2022 · 0 comments · Fixed by #3579
Closed

"Traceback" of datasources is a string but not list #3578

xiangce opened this issue Nov 2, 2022 · 0 comments · Fixed by #3579

Comments

@xiangce
Copy link
Contributor

xiangce commented Nov 2, 2022

When storing the Tracebacks of datasources to the meta_data, the result looks like:

# cat insights-20221101031603/meta_data/insights.specs.datasources.dir_list.du_dir_list.json
{"name": "insights.specs.datasources.dir_list.du_dir_list", "exec_time": 2.0188887119293213, 
"errors": ["T", "r", "a", "c", "e", "b", "a", "c", "k", " ", "(", "m", "o", "s", "t", " ", "r", "e", "c", "e", "n", "t", " ", "c", "a", "l", "l", " ", "l", "a", "s", "t", ")", ":", "\n", " ", " ", "F", "i", "l", "e", " ", "\"", "/", "r", "o", "o", "t", "/", "i", "n", "s", "i", "g", "h", "t", "s", "/", "i", "n", "s", "i", "g", "h", "t", "s", "-", "c", "o", "r", "e", "/", "i", "n", "s", "i", "g", "h", "t", "s", ".", "z", "i", "p", "/", "i", "n", "s", "i", "g", "h", "t", "s", "/", "c", "o", "r", "e", "/", "p", "l", "u", "g", "i", "n", "s", ".", "p", "y", "\"", ",", " ", "l", "i", "n", "e", " ", "1", "2", "8", ",", " ", "i", "n", " ", "i", "n", "v", "o", "k", "e", "\n", " ", " ", " ", " ", "w", "h", "i", "l", "e", " ", "n", "o", "t", " ", "_", "r", "e", "a", "d", "y", "(", "t", "i", "m", "e", "o", "u", "t", ",", " ", "q", "u", "e", "u", "e", ",", " ", "p", "r", "o", "c", "e", "s", "s", ",", " ", "m", "s", "g", ")", ":", "\n", " ", " ", "F", "i", "l", "e", " ", "\"", "/", "r", "o", "o", "t", "/", "i", "n", "s", "i", "g", "h", "t", "s", "/", "i", "n", "s", "i", "g", "h", "t", "s", "-", "c", "o", "r", "e", "/", "i", "n", "s", "i", "g", "h", "t", "s", ".", "z", "i", "p", "/", "i", "n", "s", "i", "g", "h", "t", "s", "/", "c", "o", "r", "e", "/", "p", "l", "u", "g", "i", "n", "s", ".", "p", "y", "\"", ",", " ", "l", "i", "n", "e", " ", "1", "1", "3", ",", " ", "i", "n", " ", "_", "r", "e", "a", "d", "y", "\n", " ", " ", " ", " ", "_", "c", "a", "n", "c", "e", "l", "(", "p", "r", "o", "c", "e", "s", "s", ",", " ", "m", "s", "g", ")", "\n", " ", " ", "F", "i", "l", "e", " ", "\"", "/", "r", "o", "o", "t", "/", "i", "n", "s", "i", "g", "h", "t", "s", "/", "i", "n", "s", "i", "g", "h", "t", "s", "-", "c", "o", "r", "e", "/", "i", "n", "s", "i", "g", "h", "t", "s", ".", "z", "i", "p", "/", "i", "n", "s", "i", "g", "h", "t", "s", "/", "c", "o", "r", "e", "/", "p", "l", "u", "g", "i", "n", "s", ".", "p", "y", "\"", ",", " ", "l", "i", "n", "e", " ", "1", "0", "9", ",", " ", "i", "n", " ", "_", "c", "a", "n", "c", "e", "l", "\n", " ", " ", " ", " ", "r", "a", "i", "s", "e", " ", "T", "i", "m", "e", "o", "u", "t", "E", "x", "c", "e", "p", "t", "i", "o", "n", "(", "m", "s", "g", ")", "\n", "i", "n", "s", "i", "g", "h", "t", "s", ".", "c", "o", "r", "e", ".", "p", "l", "u", "g", "i", "n", "s", ".", "T", "i", "m", "e", "o", "u", "t", "E", "x", "c", "e", "p", "t", "i", "o", "n", ":", " ", "T", "i", "m", "e", "d", " ", "O", "u", "t", "\n"], "results": null, "ser_time": 0.00023436546325683594}

It treated the "broker.tracebacks[key]" as a list by mistake,

try:
name = dr.get_name(c)
errors = [t for e in broker.exceptions.get(c, [])
for t in broker.tracebacks[e]]

but in fact, it's a string:

def add_exception(self, component, ex, tb=None):
if isinstance(ex, MissingRequirements):
self.missing_requirements[component] = ex.requirements
else:
self.exceptions[component].append(ex)
self.tracebacks[ex] = tb

e.g.:

tb = traceback.format_exc()
log.warning(tb)
broker.add_exception(component, ex, tb)

xiangce added a commit that referenced this issue Nov 8, 2022
* fix: values of broker.tracebacks should be string

- fix: #3578

Signed-off-by: Xiangce Liu <[email protected]>

* one more test item

Signed-off-by: Xiangce Liu <[email protected]>

* test tracebacks in meta_data file
* move the test to test_serde
* mini update

Signed-off-by: Xiangce Liu <[email protected]>
xiangce added a commit that referenced this issue Nov 8, 2022
* fix: values of broker.tracebacks should be string

- fix: #3578

Signed-off-by: Xiangce Liu <[email protected]>

* one more test item

Signed-off-by: Xiangce Liu <[email protected]>

* test tracebacks in meta_data file
* move the test to test_serde
* mini update

Signed-off-by: Xiangce Liu <[email protected]>
(cherry picked from commit e713e3f)
xiangce added a commit that referenced this issue Sep 6, 2024
* fix: values of broker.tracebacks should be string

- fix: #3578

Signed-off-by: Xiangce Liu <[email protected]>

* one more test item

Signed-off-by: Xiangce Liu <[email protected]>

* test tracebacks in meta_data file
* move the test to test_serde
* mini update

Signed-off-by: Xiangce Liu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant