structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
500 stars 77 forks source link

amazon-web-services example has an error #13

Closed kirkj closed 3 years ago

kirkj commented 3 years ago

Hi,

Congrats on a new release 👍

I'm trying out structurizr-cli for the first time, and thought I'd try rendering the amazon-web-services example model from cli/master/examples/amazon-web-services/workspace.dsl.

This fails on the command line with a rather ugly error:

$ structurizr-cli export -w aws-demo-workspace.dsl -f plantuml -o .
Structurizr CLI v1.4.5
Exporting workspace from aws-demo-workspace.dsl
 - loading workspace from DSL
2020-11-13 10:46:15.801 ERROR 45983 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:798) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:779) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:322) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
    at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:69) ~[classes!/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[structurizr-cli-1.4.5.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:109) ~[structurizr-cli-1.4.5.jar:na]
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[structurizr-cli-1.4.5.jar:na]
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[structurizr-cli-1.4.5.jar:na]
Caused by: com.structurizr.dsl.StructurizrDslParserException: Expected: deploymentEnvironment <name> { at line 10: deploymentEnvironment {
    at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:482) ~[structurizr-dsl-1.0.0.jar!/:na]
    at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:140) ~[structurizr-dsl-1.0.0.jar!/:na]
    at com.structurizr.cli.ExportCommand.run(ExportCommand.java:104) ~[classes!/:na]
    at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:40) ~[classes!/:na]
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:795) ~[spring-boot-2.3.0.RELEASE.jar!/:2.3.0.RELEASE]
    ... 13 common frames omitted

I get the same issue from my brew installed version of the CLI (v1.4.5) and the latest release build (v1.5.0).

By the powers of binary search, I tracked it down to the smallest failing example:

workspace "Amazon Web Services Example" "An example AWS deployment architecture." {
    model {
        deploymentEnvironment  {
        }
    }
}

The error from the CLI tool isn't helpful, but pasting the same model into the Structurizr online demo at https://structurizr.com/dsl gives a better error message:

Error Expected: deploymentEnvironment <name> { at line 3: deploymentEnvironment {

I think my suggestions are:

Thanks!

Kirk

simonbrowndotje commented 3 years ago

Thanks!

kirkj commented 3 years ago

No, thank you! 👍