Skip to content

Unknown model item type on 'element' #298

@kristofdepypere

Description

@kristofdepypere

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions