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

unsupported operand type(s) for *: 'NoneType' and 'float' #458

Closed
speedydreser opened this issue Oct 5, 2023 · 8 comments
Closed

unsupported operand type(s) for *: 'NoneType' and 'float' #458

speedydreser opened this issue Oct 5, 2023 · 8 comments
Labels
bug Something isn't working triaged Has been triaged by solutions team

Comments

@speedydreser
Copy link

I am currently having problems when exporting a diagram to Drawio I get the following error:
unsupported operand type(s) for *: 'NoneType' and 'float'

And I have not been able to find the origin of said err

@speedydreser speedydreser added the bug Something isn't working label Oct 5, 2023
@svozza
Copy link
Contributor

svozza commented Oct 5, 2023

What version of the solution are you using? We did add a fix to this for the new version (2.1.0) released a few weeks ago.

@lajtosadam
Copy link

I use a Version: v2.1.0, but i have the same issue.

@speedydreser
Copy link
Author

I use a Version: v2.0.3.

@svozza
Copy link
Contributor

svozza commented Oct 31, 2023

So it looks like the fix released in v2.1.0 only partially fixed this bug. We will have to investigate what other edge cases are causing the problem. I have noticed that it is more likely to occur if multiple resources have been deleted from the canvas before export.

@morjoan morjoan added the triaged Has been triaged by solutions team label Oct 31, 2023
@JacobReynolds
Copy link

JacobReynolds commented Dec 6, 2023

One thing I've noticed is that if I import a VPC, and then use the filters to remove some subset of resources, export always breaks.

I've made a little more progress and I think (?) the bug is here https://github.com/aws-solutions/workload-discovery-on-aws/blob/main/source/backend/functions/drawio/main.py#L188-L189. If the order of the incoming JSON results in a child being before a parent, that child never gets added to the children array of its parent. An ugly solution is commenting out those two lines and following up with a subsequent for loop of:

    for node in nodes:
        parent = node.get('parent')
        if parent:
            node_dict[parent].add_child(node_dict[node.get('id')])

@omri-shilton
Copy link

omri-shilton commented Jan 1, 2024

we are using v2.1.3 and also experiencing this, is there any updates on this issue?

@svozza
Copy link
Contributor

svozza commented Feb 9, 2024

@JacobReynolds is correct and so is the fix posted. I have tidied up the lambda function a bit and added steps on how to patch in this comment.

@svozza
Copy link
Contributor

svozza commented Apr 12, 2024

This was fixed in v2.1.6.

@svozza svozza closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged Has been triaged by solutions team
Projects
None yet
Development

No branches or pull requests

6 participants