bausteinsicht --version
Troubleshooting
The problems are sorted by how often a newcomer meets them. Each one has the same shape: what you see, why, what to do. Words you do not know are in the glossary; how the two files relate is in How sync works.
First steps
bausteinsicht: command not found
Why: the program is not in a directory that your shell searches (the PATH), or it is not installed.
Do: follow Installation (the section on the PATH). Test with:
If you installed with go install, the directory $(go env GOPATH)/bin has to be in your PATH.
no model file found in . (looked for *.jsonc)
Why: you are not in the directory of your model, or there is no model yet. Bausteinsicht looks for a single *.jsonc file in the current directory.
Do: change to the directory with architecture.jsonc, or create a project here:
bausteinsicht init
or point the command at the file: bausteinsicht sync --model path/to/architecture.jsonc. If the message says multiple .jsonc files in <dir>, the directory holds more than one model: name the one you mean with --model. (Use one model per directory; see How sync works.)
parsing architecture.jsonc: invalid character …
Why: the model is not valid JSONC. The message names the character at which the parser gave up; it does not give a line number.
Do: open the file in an editor that checks JSON (VS Code marks the spot and, with the JSON Schema, completes keys), or look near the character that the message names. The usual mistakes:
-
a missing comma between two entries, or a comma where a key must follow (
{,); -
a key without quotes (
title: "x"instead of"title": "x"), single quotes instead of double quotes; -
a missing colon between a key and its value.
These are not errors: // and /* */ comments, and a comma after the last entry. After the fix:
bausteinsicht validate
checks the structure as well (unknown kinds, missing titles, relationships to elements that do not exist).
draw.io shows nothing, or old content
Why: the diagram is only written by sync, and draw.io does not reload a file that it has open by itself. A model without views has no diagram pages.
Do:
-
Run
bausteinsicht syncand read its summary.Already in syncmeans that the file is current. -
Close the file in draw.io and open it again (or reload it).
-
Check that you open the
architecture.drawiothat lies next to the model, not a copy. -
If there are no pages: the model needs at least one view (
bausteinsicht add view context --title "Context" --include customer). -
Relationships are missing: both endpoints must be in the view’s
includelist; otherwise the arrow is drawn to their parent, or not at all.
A shape has a red dashed border
Why: this is intentional. New shapes are marked with a red dashed border (strokeColor=#FF0000;dashed=1) so that you can find them after a sync.
Do: nothing; remove the marker in draw.io (edit the style) once you have arranged the shape.
Sync
Sync ends with exit code 1 and "conflict"
Why: the model and the diagram changed the same thing since the last sync. The model wins; sync writes both files, names the element and field, and ends with exit code 1 so that scripts notice.
Do: look at the warning. If the diagram’s value was the one you wanted, change it in the model and sync again. Details: How sync works.
Sync seems to hang
Why: commands that change the model, and watch, take a lock (<model>.lock). A second command waits up to 30 seconds and then fails with exit code 2 and a message that names the lock file and the process that holds it.
Do: look for a running bausteinsicht watch (or an editor integration that calls sync) and stop it, or wait for it. The lock is released when the process ends.
Sync changed things I did not change
Why: sync carries every change of the diagram to the model, and every change of the model to the diagram. Moving shapes changes nothing in the model, but retitling one, or deleting a shape, does.
Do: look at what changed before you commit:
git diff architecture.jsonc
and restore the file you did not mean to change with git checkout — <file>.
Elements appear twice, or sync recreates everything
Why: the sync state .bausteinsicht-sync is stale or missing, so sync cannot tell which side changed. Without the state it takes the model as the truth: shapes that differ are replaced, and edits that only exist in the diagram are lost.
Do: if the state is stale, delete it and sync again (the model wins). Commit .bausteinsicht-sync together with the model so that every checkout has the matching one. A shape that was copied in draw.io carries the same ID twice: sync warns duplicate bausteinsicht_id "<id>" and turns the copy into an unmanaged shape.
The sync state belongs to another model
Why: two models in one directory share architecture.drawio and .bausteinsicht-sync; the state remembers its model and sync refuses (exit code 2).
Do: give each model its own files, bausteinsicht sync --model b.jsonc --drawio b.drawio --sync-state b.state, or, better, keep one model per directory.
Files and permissions
Permission denied
Why: the model or the diagram cannot be read, or the directory cannot be written (sync writes the diagram, the state and a temporary file in the same directory). A read-only file is refused with file is read-only: <path>.
Do:
ls -l architecture.jsonc architecture.drawio .bausteinsicht-sync # who owns them, can you write?
ls -ld . # the directory needs the w bit
df -h . # free disk space
Export
export-diagram or export-table writes nothing
Why: the model has no views (the command says so on stderr), or the view you asked for selects no elements.
Do: add a view, and check the view with bausteinsicht validate. For one view and one format: bausteinsicht export-diagram --diagram-format mermaid --view context.
PNG/SVG export (bausteinsicht export) fails
Why: export starts the draw.io desktop app in the background. It must be installed, and on a server it needs a virtual screen. A hung draw.io is stopped after --timeout (60 seconds) and what it printed is shown.
Do:
-
Install draw.io from https://www.drawio.com/ or give its path with
--drawio-path. -
On Windows nothing else is needed. Bausteinsicht looks in
%LOCALAPPDATA%\Programs\draw.io,%PROGRAMFILES%\draw.ioand%PROGRAMFILES(X86)%\draw.io. -
On Linux without a screen (Docker, devcontainer, CI, WSL2), see Headless export.
Headless export (Linux, containers, CI, WSL2)
Electron needs a virtual screen and D-Bus:
sudo mkdir -p /run/dbus
sudo dbus-daemon --system --fork
then run the export through xvfb-run -a (the drawio-export wrapper of the devcontainer does that and adds --no-sandbox, which a container without user namespaces needs). Export failed or input file/directory not found without D-Bus is this problem. Messages like Exiting GPU process due to errors during initialization are harmless; draw.io falls back to software rendering.
The pages of the diagram look identical
Why: element IDs on different pages collided. Bausteinsicht scopes the IDs per page (<view>--<element>) to prevent it.
Do: delete .bausteinsicht-sync and architecture.drawio, then bausteinsicht sync (the model wins and the diagram is created again).
Performance
Sync is slow
Why: a large model, or a slow disk or network drive. Sync time grows with the number of elements and relationships: a model of about 3000 elements needs several seconds even when nothing changed.
Do: check the size with bausteinsicht validate --verbose (it prints the number of elements, relationships and views); work on a local disk; remove elements that no view uses. Several teams with their own models can combine them in a workspace (Landscape from several models).
Looking closer
-
--verbose(for examplebausteinsicht sync --verbose) prints the model that is synced and its size. -
bausteinsicht validatechecks the model without syncing. -
The model and the diagram are text:
git log -p — architecture.jsoncshows what changed. -
The sync state is a JSON file; it holds the hashes of both files and what the last sync saw.
Getting back to a good state
git checkout HEAD -- architecture.jsonc architecture.drawio .bausteinsicht-sync # last commit
bausteinsicht sync
If only the diagram is damaged (XML parse error), rm architecture.drawio and bausteinsicht sync create it again from the model. Everything about the architecture is in the model, so the diagram can always be rebuilt.
Questions
How do I undo the last sync? Use git: git checkout HEAD — architecture.jsonc architecture.drawio .bausteinsicht-sync.
Can I edit architecture.jsonc by hand? Yes. Comments are kept when the commands change the file.
I deleted an element by mistake. Restore the model from git and sync: git checkout HEAD — architecture.jsonc, bausteinsicht sync.
Can I have several models? Use one model per directory. To show several models in one landscape, use a workspace (Landscape from several models).
Where are the logs? Nowhere; the commands print to the terminal. Redirect with bausteinsicht sync > sync.log 2>&1.
Is my data safe? Everything about the architecture is in the model. The diagram and the sync state can be created again.
Still stuck?
Check the issues, run bausteinsicht validate --verbose, and if you report a bug include its output and what git status shows.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.