Skip to content

Error on visualization on backup #28

@tanganellilore

Description

@tanganellilore

Hi team,

i notice that after two weeks of used, I receive some error on UI and core api under api/task/backup .

Checking on the log I notice that there are some error on cleanArgs function, due to the fact that object retrieved from flower is not a complete tuple and include some ... at the end of args.

Ref code:

def cleanArgs(args):
argument = str(args)
if ", 'displayvm': True" in argument :
argument = argument[:argument.index(", 'displayvm': True")] + "})"
print(f"[cleanArgs] {sys.version}")
print(f"[cleanArgs] {sys.version_info}")
argumentLen = len(argument)
for _ in range(0, argumentLen):
print(f"[cleanArgs] Trying to eval argument “{argument}”.")
try:
obj = eval(argument)
print("[cleanArgs] Argument evaluated successfuly.")
break
except SyntaxError as e:
column = e.offset
print(f"[cleanArgs] Argument evaluating error “{e}” at {column}.")
if column == 0:
argument = argument[1:]
elif column == len(argument) - 1:
argument = argument[:column]
else:
argument = argument[:column-1] + argument[column:]
except Exception as e:
print("[cleanArgs] Argument fixing failed.")
raise ValueError(f"Failed to fix argument “{args}”.")
if isinstance(obj,dict):
return json.dumps(obj, default=_typeAsString)
elif isinstance(obj,tuple) or isinstance(obj,list):
return json.dumps(obj[0], default=_typeAsString)

As workaround i simpli add a "replace" of ... at line 91 and all works fine.

I think that error is how task is added on celery, because is added as a string and retrieved as string, and string will be cropped (rif: https://stackoverflow.com/questions/53888127/advanced-task-formatting-in-flower-celery-monitoring and https://stackoverflow.com/questions/57973649/flower-doesnt-display-complete-result-string).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions