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

Node to Code__Crashes Dynamo 2.0.1.555___ #8981

Closed
EmCru opened this issue Jul 6, 2018 · 12 comments
Closed

Node to Code__Crashes Dynamo 2.0.1.555___ #8981

EmCru opened this issue Jul 6, 2018 · 12 comments
Labels
2.x Issues related to 2.x versions of Dynamo. crash Related to a crash. engine Issues related to the engine driving Dynamo. error/warning/crash Issues mentioning a Dynamo error, warning or crash message priority Related to a release. tracked

Comments

@EmCru
Copy link

EmCru commented Jul 6, 2018

If this issue is with Dynamo for Revit, please post your issue on the Dynamo for Revit Issues page.

If this issue is not a bug report or improvement request, please check the Dynamo forum, and start a thread there to discuss your issue.

Dynamo version

2.0.1

Operating system

windows 10

What did you do?

Placed the current doc node and tried to translate it to code.....

***Update: I thought at first this was only when translating Current Document but it is anytime I invoke node to code

What did you expect to see?

code

What did you see instead?

Crash!

@EmCru EmCru changed the title Current Document Node Crashes when translated with Node to Code Node to Code__Crashes Dynamo 2.0.1.555___ Jul 6, 2018
@mjkkirschner
Copy link
Member

can you post the stack trace?

@dimven
Copy link
Contributor

dimven commented Jul 16, 2018

I experienced something similar a while back when translating the Document.Current node to DS and it seemed the issue was an older version of the Rhythm package. I think it had a Document class or similar that was creating a namespace conflict...

@smangarole
Copy link
Contributor

@EmCru @mjkkirschner @dimven I cannot reproduce the crash on Sandbox and in D4R 2.0.1.5055

@smangarole
Copy link
Contributor

Please re-open if it's reproducible. It would be great if you can provide:

  • the .dyn file
  • steps to reproduce

@dimven
Copy link
Contributor

dimven commented Jul 19, 2018

Steps to reproduce:

  • Have a recent version of Rhythm installed
  • Place a Document.Current and any other node that needs a document as input. I use Document.FilePath in the example below.
  • Select them, right click on canvas, pick Node to Code
  • You get the below stack trace and then Dynamo terminates

Object reference not set to an instance of an object.

at ProtoCore.Utils.CoreUtils.CreateNodeFromString(String name)
at Dynamo.Engine.NodeToCode.ShortestQualifiedNameReplacer.CreateNodeFromShortName(String className, String qualifiedName)
at Dynamo.Engine.NodeToCode.ShortestQualifiedNameReplacer.RewriteNodeWithShortName(IdentifierListNode node)
at Dynamo.Engine.NodeToCode.ShortestQualifiedNameReplacer.VisitIdentifierListNode(IdentifierListNode node)
at ProtoCore.SyntaxAnalysis.AstReplacer.VisitBinaryExpressionNode(BinaryExpressionNode node)
at Dynamo.Engine.NodeToCode.NodeToCodeCompiler.ReplaceWithShortestQualifiedName(ClassTable classTable, IEnumerable`1 asts, ElementResolver resolver)
at Dynamo.Graph.Workspaces.WorkspaceModel.ConvertNodesToCodeInternal(EngineController engineController, INamingProvider namingProvider)
at Dynamo.Models.DynamoModel.ConvertNodesToCodeImpl(ConvertNodesToCodeCommand command)
at Dynamo.Models.DynamoModel.ExecuteCommand(RecordableCommand command)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

This is all simply happening because Rhythm has a Document class and the CreateNodeFromShortName method throws a null and the following code doesn't check for null returns...

revit_2018-07-19_09-00-52

I am sure there are other similar and unpredictable cases like this one. The Solid class in Lunchbox comes to mind. You can't expect package managers to foresee these weird cases and should instead implement a more rigorous process when importing external namespaces. Maybe have a notification warns when this happens, similar to how the current notification system warns about duplicate assemblies?

@mjkkirschner
Copy link
Member

@dimven thanks for the writeup.

@mjkkirschner mjkkirschner reopened this Jul 19, 2018
@aparajit-pratap
Copy link
Contributor

aparajit-pratap commented Jul 20, 2018

@smangarole I can take a look at this. Could you file a bug with the above details? Thanks.

@johnpierson
Copy link
Member

Is there anything I can do as a package author to help mitigate this? I created my nodes following the same structure present in Dynamo. 😬

@johnpierson
Copy link
Member

johnpierson commented Sep 19, 2018

Rhythm version 2018.9.19 should resolve these issues.
image
I just made my categories the plural version of the word. So category became categories, etc.
image

Let me know if this helps with these kinds of clashes (with Rhythm at least), I cannot speak for other package authors.

@aparajit-pratap
Copy link
Contributor

Tracked internally: https://jira.autodesk.com/browse/QNTM-5426

@johnpierson johnpierson added priority Related to a release. 2.x Issues related to 2.x versions of Dynamo. tracked and removed 2.1 Release labels Sep 26, 2018
@johnpierson johnpierson added engine Issues related to the engine driving Dynamo. and removed DesignScript labels Oct 3, 2018
@johnpierson
Copy link
Member

Related to #8576

@aparajit-pratap
Copy link
Contributor

Fixed in #9255. Closing.

@horatiubota horatiubota added the error/warning/crash Issues mentioning a Dynamo error, warning or crash message label Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues related to 2.x versions of Dynamo. crash Related to a crash. engine Issues related to the engine driving Dynamo. error/warning/crash Issues mentioning a Dynamo error, warning or crash message priority Related to a release. tracked
Projects
None yet
Development

No branches or pull requests

7 participants