besser-troubleshooting — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited besser-troubleshooting (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Quick reference for diagnosing and fixing common issues. Organized by symptom. This is an intentionally flat, single-file skill — a fast lookup you scan top-to-bottom or search, with no references/ subdirectory.
pip install besser fails with native dependency errorsSeveral BESSER dependencies require system libraries:
| Dependency | Requires | Fix (Ubuntu/Debian) | Fix (macOS) |
|---|---|---|---|
psycopg2-binary | PostgreSQL client libs | apt install libpq-dev | brew install postgresql |
pyodbc | ODBC driver manager | apt install unixodbc-dev | brew install unixodbc |
oracledb | Oracle Instant Client | Download from Oracle | Download from Oracle |
If you don't need a specific database, these won't block core BESSER functionality — most generators work fine with SQLite (no native deps needed).
pip install -e . fails or installs nothingsetup.cfg and pyproject.toml live; setup.cfg holds the package metadata and python_requires).setuptools>=42 and wheel. Upgrade first: pip install --upgrade setuptools wheel.which python (Unix) or where python (Windows).BESSER requires Python 3.11+ (enforced by python_requires = >=3.11 in setup.cfg). Check with:
python --versionIf you're on 3.10 or earlier, upgrade Python or use pyenv/conda to manage versions.
venv\Scripts\activate not foundThe activation path is venv\Scripts\activate (capital S). A common mistake in some docs is venv\Script\activate (missing the 's') — this will fail.
:: Correct:
venv\Scripts\activateModuleNotFoundError: No module named 'besser'pip install -e . from the repo root, or pip install besser.source venv/bin/activate or venv\Scripts\activate).pip and python may point to different installations. Use python -m pip install -e . to ensure alignment.ImportError: cannot import name 'X' from 'besser.BUML.metamodel.structural'Check the exact name. Common mistakes:
| Wrong | Correct |
|---|---|
String | StringType |
Integer | IntegerType |
Float | FloatType |
Boolean | BooleanType |
Date | DateType |
DateTime | DateTimeType |
Association | BinaryAssociation (for 2-end associations) |
The primitive types are singleton instances, not classes. You import them directly: from besser.BUML.metamodel.structural import StringType.
ImportError related to boclThe OCL constraint checker requires bocl==1.0.1 (exact version). If you installed a different version or it's missing:
pip install bocl==1.0.1This only affects OCL validation — generators work without it.
ImportError related to antlr4The PlantUML parser requires antlr4-python3-runtime>=4.13.1. The runtime version must be compatible with the grammar files shipped with BESSER. Install:
pip install antlr4-python3-runtime>=4.13.1If you get runtime parse errors after upgrading, the ANTLR runtime version may be too new for the shipped grammar. Pin to 4.13.1 or 4.13.2.
plantuml_to_buml() parses but the model is empty or wrongThe converter only handles a subset of PlantUML class-diagram syntax. If a .plantuml file converts without error but yields missing classes, associations, or attributes, the input likely used unsupported notation (n-ary associations, non-class diagrams, stereotypes/OCL) rather than a BESSER bug. See the besser-user skill's references/plantuml.md for the exact supported subset, then adjust the diagram or add the missing pieces in Python after conversion.
ImportError for optional packagesThese packages are only needed for specific features:
| Package | Needed for | Install |
|---|---|---|
deep_translator | Agent personalization (translation) | pip install deep-translator |
docker | Docker image building in BackendGenerator | pip install docker |
qiskit | Running generated quantum circuits | pip install qiskit |
torch / tensorflow | Running generated NN code | pip install torch / pip install tensorflow |
ValueError: 'My Name' is invalid. Name cannot contain spaces.All B-UML names (classes, attributes, associations, etc.) must not contain spaces. Use underscores: My_Name.
ValueError: 'my-name' is invalid. Hyphens are not allowed; use '_' instead.Replace hyphens with underscores: my_name.
ValueError: Invalid primitive data typeValid primitive type names for PrimitiveDataType(name): int, float, str, bool, time, date, datetime, timedelta, any.
More commonly, use the pre-built singletons: StringType, IntegerType, etc.
ValueError: A class cannot have more than one attribute marked as 'id'Only one Property per class can have is_id=True. Pick one primary key attribute.
ValueError: A binary association must have exactly two endsBinaryAssociation requires a set of exactly 2 Property objects as ends. Check that you're passing ends={end1, end2} with both ends.
ValueError: A class cannot be a generalization of itselfGeneralization(general=A, specific=A) is not allowed. Check that general and specific are different classes.
ValueError: The model cannot have types with duplicate namesTwo types in your DomainModel share the same name. Each class, enumeration, and data type must have a unique name within the model.
ValueError: Invalid min/max multiplicitymin_multiplicity must be >= 0.max_multiplicity must be > 0 and >= min."*" or UNLIMITED_MAX_MULTIPLICITY (9999) for "many".ValueError: An enumeration cannot have two literals with the same nameEach EnumerationLiteral within an Enumeration must have a unique name.
TypeError: Expected Property instance, but got XAssociation ends must be Property instances, not classes or strings. Each end should be: Property(name="...", type=SomeClass, multiplicity=Multiplicity(...)).
model.validate() reports errorsDomainModel.validate() checks structural consistency:
| Error message | Meaning | Fix |
|---|---|---|
| Generalization references class not in model | A Generalization uses a class that wasn't added to types | Add the missing class to the model's types set |
| Association end references type not in model | An association end's type class isn't in types | Add the class to types |
| Constraint context not in model | An OCL Constraint references a class not in types | Add the context class or remove the constraint |
| Circular inheritance detected | A → B → A inheritance loop | Fix the generalization chain |
Always call model.validate() before running generators to catch these early.
OCL constraints must:
context keyword (case-insensitive).inv, pre, post, self, collect, select, exists, forall, size.If the bocl library can't parse a constraint, it falls back to a regex-based parser. Complex OCL that neither parser handles will be reported as invalid but won't block generation.
Two distinct OCL failure classes — don't conflate them:
Constraint whose context class isn't inmodel.types is a model.validate() error — it fails validation and you should fix it before generating (see the table above).
whose OCL text neither parser can evaluate is reported as invalid but does not block generation — generators that don't consume OCL run fine.
This skill is the fast lookup for a generator error message: the table maps symptom → likely cause → first fix. For wrong-output debugging (a generator that runs but produces nothing or the wrong content) and per-generator deep dives, defer to the besser-generators skill's references/debugging.md.
| Symptom | Likely cause | First fix |
|---|---|---|
ValueError: Invalid DBMS | DBMS string is not one of sqlite, postgresql, mysql, mssql, mariadb, oracle | Use exactly postgresql (not postgres) |
ValueError: Invalid backend (Qiskit) | backend_type is not aer_simulator, fake_backend, or ibm_quantum | Pick a valid backend |
subprocess.CalledProcessError (Django) | Django not installed, project name conflict, or invalid Python identifier | python -m django --version; delete stale project; rename |
AttributeError inside WebAppGenerator | gui_model=None was passed | Build a GUIModel first (see the besser-user skill's references/gui-models.md) |
jinja2.TemplateNotFound | BESSER package corrupted or templates missing | pip install --force-reinstall besser |
Raw [[ ]] in generated React files | ReactGenerator template rendering failed silently | Check console for Jinja errors; React uses [[ ]] to avoid JSX clashes |
The Django generator catches subprocess errors and prints them rather than re-raising — if the generator "succeeded" but produced no project, scroll back through the console. (A generator that produces no file and no error is a debugging case → references/debugging.md in besser-generators.)
docker-compose up fails immediatelylsof -i :8000 (Unix) or netstat -an | findstr 8000 (Windows). git submodule update --init --recursive.env file at besser/utilities/web_modeling_editor/frontend/packages/webapp/webpack/.env. Create one if missing.docker-compose vs docker composeBESSER's docker_deployment.py calls docker-compose (v1 with hyphen). If you only have Docker Compose v2 (plugin), either:
docker-compose separately: pip install docker-composealias docker-compose='docker compose'The PYTHONPATH must be set to /app in the container. Check that docker-compose.yml has PYTHONPATH: /app in the backend service's environment.
ValueError: A different container is already running on port 8000The deployment service detected a port conflict. Stop the existing container:
docker ps # find the container using port 8000
docker stop <container_id>The base image python:3.11-slim doesn't include system libraries for psycopg2, pyodbc, etc. Add to the Dockerfile:
RUN apt-get update && apt-get install -y libpq-dev gccWhen the generated code doesn't match what you expect from your model:
print(my_class.attributes).print(model.get_classes()).gets the foreign key.
model.types and the association is inmodel.associations.
Generalization in model.generalizations?Generalization(general=Parent, specific=Child) — generalis the parent, specific is the child.
print([lit.name for lit in my_enum.literals]).validate(), but the Pydantic/SQLAlchemy generators can't serialize an enum-literal default — they emit its raw repr() (the whole enum graph, with timestamps), so pydantic_classes.py / sql_alchemy.py won't even parse (SyntaxError: leading zeros in decimal integer literals are not permitted). Omit the default and set it in the app layer or as a DB column default. (Primitive defaults like True/0 are fine.)When filing a bug report, include:
python --versionpip show besser or check setup.cfg# minimal_repro.py
from besser.BUML.metamodel.structural import (
DomainModel, Class, Property, BinaryAssociation,
Multiplicity, StringType, IntegerType,
)
from besser.generators.sql_alchemy import SQLAlchemyGenerator
# Smallest model that triggers the bug
a = Class(name="A", attributes={Property(name="x", type=StringType)})
b = Class(name="B", attributes={Property(name="y", type=IntegerType)})
assoc = BinaryAssociation(name="a_b", ends={
Property(name="a_end", type=a, multiplicity=Multiplicity(1, 1)),
Property(name="b_end", type=b, multiplicity=Multiplicity(0, "*")),
})
model = DomainModel(name="repro", types={a, b}, associations={assoc})
# Validate first — validate() returns {"success": bool, "errors": [...], "warnings": [...]}
result = model.validate()
assert result["success"], result["errors"]
# Swap in whichever generator reproduces your bug
gen = SQLAlchemyGenerator(model=model, output_dir="./repro_output")
gen.generate(dbms="sqlite")Run it: python minimal_repro.py. If it reproduces the bug, file it as an issue at https://github.com/BESSER-PEARL/BESSER/issues with the script and the full error output.
# Check BESSER is importable
python -c "from besser.BUML.metamodel.structural import DomainModel; print('OK')"
# Check specific generator
python -c "from besser.generators.sql_alchemy import SQLAlchemyGenerator; print('OK')"
# Check OCL support
python -c "import bocl; print(f'bocl {bocl.__version__}')"
# Check Django
python -m django --version
# Check Docker
docker --version && docker compose version
# Run the library example to verify full stack
python tests/BUML/metamodel/structural/library/library.py
# Run tests
python -m pytest tests/ -x --tb=short~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.