question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Weird "which is not attached to a model" error

See original GitHub issue

log:

java.lang.Error: trying to get model for element package Entity, which is not attached to a model
	at de.peeeq.wurstscript.attributes.AttrImportedPackage.getModel(AttrImportedPackage.java:35)
	at de.peeeq.wurstscript.ast.WPackageImpl.getModel(WPackageImpl.java:380)
	at de.peeeq.wurstscript.attributes.CofigActualDef.getConfigPackage(CofigActualDef.java:51)
	at de.peeeq.wurstscript.attributes.CofigActualDef.calculate(CofigActualDef.java:30)
	at de.peeeq.wurstscript.ast.FuncDefImpl.attrConfigActualNameDef(FuncDefImpl.java:557)
	at de.peeeq.wurstscript.attributes.names.NameLink.withConfigDef(NameLink.java:306)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncs(NameResolution.java:48)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncsShort(NameResolution.java:254)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.lookupFuncs(ExprFunctionCallImpl.java:615)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.searchFunction(PossibleFuncDefs.java:92)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.calculate(PossibleFuncDefs.java:60)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFuncDefs(ExprFunctionCallImpl.java:544)
	at de.peeeq.wurstscript.attributes.AttrPossibleFunctionSignatures.calculate(AttrPossibleFunctionSignatures.java:19)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:452)
	at de.peeeq.wurstscript.attributes.AttrFunctionSignature.calculate(AttrFunctionSignature.java:18)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrFunctionSignature(ExprFunctionCallImpl.java:466)
	at de.peeeq.wurstscript.attributes.AttrExprType.calculate(AttrExprType.java:413)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTypRaw(ExprFunctionCallImpl.java:344)
	at de.peeeq.wurstscript.attributes.AttrExprType.normalizedType(AttrExprType.java:507)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTyp(ExprFunctionCallImpl.java:316)
	at de.peeeq.wurstscript.validation.WurstValidator.visit(WurstValidator.java:1062)
	at de.peeeq.wurstscript.validation.WurstValidator.check(WurstValidator.java:250)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:211)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.validate(WurstValidator.java:59)
	at de.peeeq.wurstscript.WurstChecker.checkProg(WurstChecker.java:43)
	at de.peeeq.wurstio.WurstCompilerJassImpl.checkProg(WurstCompilerJassImpl.java:326)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.doTypeCheckPartial(ModelManagerImpl.java:540)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.syncCompilationUnitContent(ModelManagerImpl.java:428)
	at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$68(LanguageWorker.java:185)
	at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
	at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
	at java.lang.Thread.run(Unknown Source)
Error in request 'de.peeeq.wurstio.languageserver.LanguageWorker$FileReconcile@3d32a6b1' (see log for details): trying to get model for element package Entity, which is not attached to a model
de.peeeq.wurstscript.ast.CyclicDependencyError
	at de.peeeq.wurstscript.ast.FuncDefImpl.attrConfigActualNameDef(FuncDefImpl.java:560)
	at de.peeeq.wurstscript.attributes.names.NameLink.withConfigDef(NameLink.java:306)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncs(NameResolution.java:48)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncsShort(NameResolution.java:254)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.lookupFuncs(ExprFunctionCallImpl.java:615)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.searchFunction(PossibleFuncDefs.java:92)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.calculate(PossibleFuncDefs.java:60)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFuncDefs(ExprFunctionCallImpl.java:544)
	at de.peeeq.wurstscript.attributes.AttrPossibleFunctionSignatures.calculate(AttrPossibleFunctionSignatures.java:19)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:452)
	at de.peeeq.wurstscript.attributes.AttrFunctionSignature.calculate(AttrFunctionSignature.java:18)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrFunctionSignature(ExprFunctionCallImpl.java:466)
	at de.peeeq.wurstscript.attributes.AttrExprType.calculate(AttrExprType.java:413)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTypRaw(ExprFunctionCallImpl.java:344)
	at de.peeeq.wurstscript.attributes.AttrExprType.normalizedType(AttrExprType.java:507)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTyp(ExprFunctionCallImpl.java:316)
	at de.peeeq.wurstscript.validation.WurstValidator.visit(WurstValidator.java:1062)
	at de.peeeq.wurstscript.validation.WurstValidator.check(WurstValidator.java:250)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:211)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.validate(WurstValidator.java:59)
	at de.peeeq.wurstscript.WurstChecker.checkProg(WurstChecker.java:43)
	at de.peeeq.wurstio.WurstCompilerJassImpl.checkProg(WurstCompilerJassImpl.java:326)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.doTypeCheckPartial(ModelManagerImpl.java:540)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.syncCompilationUnitContent(ModelManagerImpl.java:428)
	at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$68(LanguageWorker.java:185)
	at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
	at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
	at java.lang.Thread.run(Unknown Source)
2017-11-29 00:44:41 SEVERE Internal error: de.peeeq.wurstscript.ast.CyclicDependencyError
java.util.concurrent.CompletionException: de.peeeq.wurstscript.ast.CyclicDependencyError
	at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
	at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
	at java.util.concurrent.CompletableFuture.uniApply(Unknown Source)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
	at de.peeeq.wurstio.languageserver.requests.UserRequest.handleException(UserRequest.java:40)
	at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$handle$69(LanguageWorker.java:272)
	at java.util.concurrent.CompletableFuture.uniWhenComplete(Unknown Source)
	at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(Unknown Source)
	at java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
	at de.peeeq.wurstio.languageserver.requests.UserRequest.run(UserRequest.java:34)
	at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$67(LanguageWorker.java:170)
	at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
	at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
	at java.lang.Thread.run(Unknown Source)
Caused by: de.peeeq.wurstscript.ast.CyclicDependencyError
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:455)
	at de.peeeq.wurstscript.attributes.AttrExprExpectedType.expectedType(AttrExprExpectedType.java:129)
	at de.peeeq.wurstscript.attributes.AttrExprExpectedType.calculate(AttrExprExpectedType.java:29)
	at de.peeeq.wurstscript.ast.ExprVarAccessImpl.attrExpectedTypRaw(ExprVarAccessImpl.java:289)
	at de.peeeq.wurstscript.attributes.AttrExprExpectedType.normalizedType(AttrExprExpectedType.java:144)
	at de.peeeq.wurstscript.ast.ExprVarAccessImpl.attrExpectedTyp(ExprVarAccessImpl.java:303)
	at de.peeeq.wurstio.languageserver.requests.GetCompletions.computeCompletionProposals(GetCompletions.java:111)
	at de.peeeq.wurstio.languageserver.requests.GetCompletions.execute(GetCompletions.java:71)
	at de.peeeq.wurstio.languageserver.requests.GetCompletions.execute(GetCompletions.java:31)
	at de.peeeq.wurstio.languageserver.requests.UserRequest.run(UserRequest.java:31)
	... 4 more

[Error - 00:44:41] Request textDocument/completion failed.
  Message: Internal error, please look at the server's logs.
  Code: -32603 
de.peeeq.wurstscript.ast.CyclicDependencyError
	at de.peeeq.wurstscript.ast.FuncDefImpl.attrConfigActualNameDef(FuncDefImpl.java:560)
	at de.peeeq.wurstscript.attributes.names.NameLink.withConfigDef(NameLink.java:306)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncs(NameResolution.java:48)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncsShort(NameResolution.java:254)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.lookupFuncs(ExprFunctionCallImpl.java:615)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.searchFunction(PossibleFuncDefs.java:92)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.calculate(PossibleFuncDefs.java:60)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFuncDefs(ExprFunctionCallImpl.java:544)
	at de.peeeq.wurstscript.attributes.AttrPossibleFunctionSignatures.calculate(AttrPossibleFunctionSignatures.java:19)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:452)
	at de.peeeq.wurstscript.attributes.AttrFunctionSignature.calculate(AttrFunctionSignature.java:18)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrFunctionSignature(ExprFunctionCallImpl.java:466)
	at de.peeeq.wurstscript.attributes.AttrExprType.calculate(AttrExprType.java:413)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTypRaw(ExprFunctionCallImpl.java:344)
	at de.peeeq.wurstscript.attributes.AttrExprType.normalizedType(AttrExprType.java:507)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTyp(ExprFunctionCallImpl.java:316)
	at de.peeeq.wurstscript.validation.WurstValidator.visit(WurstValidator.java:1062)
	at de.peeeq.wurstscript.validation.WurstValidator.check(WurstValidator.java:250)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:211)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.validate(WurstValidator.java:59)
	at de.peeeq.wurstscript.WurstChecker.checkProg(WurstChecker.java:43)
	at de.peeeq.wurstio.WurstCompilerJassImpl.checkProg(WurstCompilerJassImpl.java:326)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.doTypeCheckPartial(ModelManagerImpl.java:540)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.syncCompilationUnitContent(ModelManagerImpl.java:428)
	at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$68(LanguageWorker.java:185)
	at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
	at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
	at java.lang.Thread.run(Unknown Source)
de.peeeq.wurstscript.ast.CyclicDependencyError
	at de.peeeq.wurstscript.ast.FuncDefImpl.attrConfigActualNameDef(FuncDefImpl.java:560)
	at de.peeeq.wurstscript.attributes.names.NameLink.withConfigDef(NameLink.java:306)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncs(NameResolution.java:48)
	at de.peeeq.wurstscript.attributes.names.NameResolution.lookupFuncsShort(NameResolution.java:254)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.lookupFuncs(ExprFunctionCallImpl.java:615)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.searchFunction(PossibleFuncDefs.java:92)
	at de.peeeq.wurstscript.attributes.PossibleFuncDefs.calculate(PossibleFuncDefs.java:60)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFuncDefs(ExprFunctionCallImpl.java:544)
	at de.peeeq.wurstscript.attributes.AttrPossibleFunctionSignatures.calculate(AttrPossibleFunctionSignatures.java:19)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrPossibleFunctionSignatures(ExprFunctionCallImpl.java:452)
	at de.peeeq.wurstscript.attributes.AttrFunctionSignature.calculate(AttrFunctionSignature.java:18)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrFunctionSignature(ExprFunctionCallImpl.java:466)
	at de.peeeq.wurstscript.attributes.AttrExprType.calculate(AttrExprType.java:413)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTypRaw(ExprFunctionCallImpl.java:344)
	at de.peeeq.wurstscript.attributes.AttrExprType.normalizedType(AttrExprType.java:507)
	at de.peeeq.wurstscript.ast.ExprFunctionCallImpl.attrTyp(ExprFunctionCallImpl.java:316)
	at de.peeeq.wurstscript.validation.WurstValidator.visit(WurstValidator.java:1062)
	at de.peeeq.wurstscript.validation.WurstValidator.check(WurstValidator.java:250)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:211)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.walkTree(WurstValidator.java:214)
	at de.peeeq.wurstscript.validation.WurstValidator.validate(WurstValidator.java:59)
	at de.peeeq.wurstscript.WurstChecker.checkProg(WurstChecker.java:43)
	at de.peeeq.wurstio.WurstCompilerJassImpl.checkProg(WurstCompilerJassImpl.java:326)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.doTypeCheckPartial(ModelManagerImpl.java:540)
	at de.peeeq.wurstio.languageserver.ModelManagerImpl.syncCompilationUnitContent(ModelManagerImpl.java:428)
	at de.peeeq.wurstio.languageserver.LanguageWorker.lambda$getNextWorkItem$68(LanguageWorker.java:185)
	at de.peeeq.wurstio.languageserver.LanguageWorker$Workitem.run(LanguageWorker.java:28)
	at de.peeeq.wurstio.languageserver.LanguageWorker.run(LanguageWorker.java:145)
	at java.lang.Thread.run(Unknown Source)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
peqcommented, Nov 29, 2017

After the exception anything could be broken. If you are lucky the error will repair itself with the next source code change, but most likely you’ll have to clean the workspace or restart the server to get back to a consistent state.

0reactions
Frottycommented, Nov 23, 2022

Iirc this only happens when you delete or rename files. Reloading vscode should solve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trainer is not attached to model - Stack Overflow
I am getting the following error: RuntimeError: MemeNet is not attached to a `Trainer`. Note that MemeNet is the name of my model....
Read more >
Error: stale element reference: element is not attached to the ...
I'm very consistently receiving a "Error: stale element reference: element is not attached to the page document" error when using a custom ...
Read more >
What is a misplaced modifier
A misplaced modifier is a word, phrase, or clause that is improperly separated from the word it modifies / describes. Because of the...
Read more >
Live2d】Vtube Studio tutorial - Fix weird eyes and mouth
When i deliver my models, i'm often asked by clients how to set them up in Vtube Studio, so i thought of making...
Read more >
Weird shaking with layer-masked animation (video of the error ...
Hi , i am facing this problem that i've been trying to solve for 2 days now. So i am doing your good...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found