PlantUML – Missing Docs

I’ve been using PlantUML for my technical diagrams recently; the ability to include the source for my diagrams along side my projects has been a documentation game changer.

The tool is pretty well documented on their website but a few things are not immediately clear until you stumble with using it a few times.

How do I pick the diagram type?

PlantUML doesn’t have an documented mechanism for defining the type of diagram you are trying to generate. Defining a node type element tells PlantUML to generate a component diagram.

In my use case, I was trying to create a sequence diagram but I accidentally created an element of type component. This caused my diagram to default to a Component diagram, which doesn’t support the group feature; this was present in my diagram’s definition but was causing a syntax error I couldn’t understand until I realized it’s not in the grammar for a Component diagram.

The solution was to replace the node with boundary and control elements.

Refreshing my Windows 10 dev machine

Run Windows Fresh Start to clean up the machine from all of the bloatware either came with the computer or has been installed over time.

This post is a work in progress and will be updated as more tools are identified.

Install chocolatey

Install the dev tools via chocolatey. Make sure you run chocolatey from an elevated (run as Administrator) command prompt.

  • choco install -y visualstudio2019community
  • choco install -y visualstudio2019-workload-netcoretools
  • choco install -y visualstudio2019-workload-netweb
  • choco install -y sql-server-express
  • choco install -y sql-server-management-studio
  • choco install -y firefox

I have since uninstalled SQL Server and am, instead, running it as a docker container. This has simplified things greatly

dotnetcore 2.0 on Linux suffering inotify errors

I am currently writing my first dotnet core 2.0 application deployed to a Linux environment. The development has been on a Mac using a combination of the dotnet cli and Visual Studio for Mac.

In deploying the app to a QA site, we experienced an error I’ve never seen before

An exception occured reading app key DeviceId default value  applied.
System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached.
   at System.IO.FileSystemWatcher.StartRaisingEvents()
   at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
   at app.Shared.Utilities.GetAppConfig[T](String key, T defaultValue) in /var/app/source/app/app.Shared/Utilities.cs:line 33
   at System.IO.FileSystemWatcher.StartRaisingEvents()
   at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
   at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
   at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
   at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()

I didn’t know where to start so I Googled the issue and landed on some StackOverflow questions and GitHub issues associated with the same issue. The most helpful questions and answers came from the following sources.

My solution was to replace the call to WebHost.CreateDefaultBuilder(..) with a modified version of Microsoft’s implementation but with the following changes:

  • Make appsettings.json a required file (this was for my needs, you can change is to not be required)
  • Remove adding appsettings.{env}.json as we don’t use it. I am considering add this back to the gist.
  • Disable reloading the configuration when appsettings.json is modified (this is what instantiates FileSystemWatcher and causes our error)
  • Remove IIS integration (as we are deploying the app on Linux-based docker containers)

The modified method is available as a GitHub gist.