Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unknown model item type on 'element' #298

Closed
kristofdepypere opened this issue May 29, 2024 · 1 comment
Closed

Unknown model item type on 'element' #298

kristofdepypere opened this issue May 29, 2024 · 1 comment
Labels

Comments

@kristofdepypere
Copy link

kristofdepypere commented May 29, 2024

Description

I'm having issues using the new Inspect feature.

We are getting a stacktrace running it from cli and in the onpremise webapp we even can make the instance crash. On one of our workspaces we are getting the following error:

java.lang.reflect.InvocationTargetException: null
	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(Unknown Source) ~[?:?]
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Unknown Source) ~[?:?]
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
	at com.structurizr.cli.InspectCommand.findInspector(InspectCommand.java:134) [structurizr-cli.jar:]
	at com.structurizr.cli.InspectCommand.run(InspectCommand.java:83) [structurizr-cli.jar:]
	at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:83) [structurizr-cli.jar:]
	at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:104) [structurizr-cli.jar:]

Caused by: java.lang.IllegalArgumentException: Unknown model item type.
	at com.structurizr.view.Terminology.findTerminology(Terminology.java:139) ~[structurizr-core-2.1.1.jar:2.1.1]
	at com.structurizr.inspection.model.AbstractElementInspection.terminologyFor(AbstractElementInspection.java:23) ~[structurizr-inspection-2.1.1.jar:2.1.1]
	at com.structurizr.inspection.model.ElementNotIncludedInAnyViewsInspection.inspect(ElementNotIncludedInAnyViewsInspection.java:33) ~[structurizr-inspection-2.1.1.jar:2.1.1]
	at com.structurizr.inspection.model.AbstractElementInspection.run(AbstractElementInspection.java:17) ~[structurizr-inspection-2.1.1.jar:2.1.1]
	at com.structurizr.inspection.DefaultInspector.runModelInspections(DefaultInspector.java:74) ~[structurizr-inspection-2.1.1.jar:2.1.1]
	at com.structurizr.inspection.DefaultInspector.<init>(DefaultInspector.java:19) ~[structurizr-inspection-2.1.1.jar:2.1.1]
	... 7 more

After some trial and error I traced it back to the element keyword. validateWorkspace, validateWorkspaceDSL and rendering the workspace all works. There must be something missing in the inspect logic to handle element.

Steps to reproduce

Hit Inspect on a workspace containing element in a group

Screenshot

No response

Code sample

No response

Configuration

No response

Severity

Critical

Priority

I have no budget and there's no rush, please fix this for free

More information

No response

@kristofdepypere kristofdepypere changed the title Unknown model item type Unknown model item type on 'element' May 30, 2024
@simonbrowndotje
Copy link
Contributor

Example to reproduce:

workspace {
    model {
        element "A"
    }
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants