Skip to main content
Version: Next

Build errors

Before Kanoniq can validate a model, it has to build one: read the files, resolve every reference, and assemble what they say. When that fails, Kanoniq reports a build error. This page lists every one, what it means and how to fix it.

Codes​

Every build error has a permanent code, KB and three digits, and it never changes meaning. A release may reword the message; the code stays, so you can search for it, cite it in a ticket, or match it in CI.

  • KB001–KB499 are errors. The model does not build, so nothing is validated or written, and the command exits 1. The one exception is KB024, which fails the command but still lets the model build.
  • KB500 and up are warnings. They are about the repository's settings, and fail nothing.

A build error is different from a validation finding. A KQ finding is about a model that built and breaks a rule; a KB error means there is no model yet, or that something around it, such as kanoniq.repository.json, needs fixing. No build error can be suppressed: fix the file instead.

Where you see them​

  • kq prints each one as a line, orders.kq:12:5 error KB003 'payments' names nothing, with its file and position. --format github makes it an annotation titled with its code, and --format sarif makes it a result, so a SARIF viewer lists it beside the findings.
  • VS Code shows it in the Problems panel with its code, which links to its section on this page.
  • The visual editor and the portal list the errors of a model that does not build, each with its code.

Every code​

CodeCheckSeverity
KB001syntaxError
KB002characters the language readsError
KB003a reference resolvesError
KB004a reserved CodeError
KB005declared onceError
KB006a reopening has a declarationError
KB007a reopening restates nothingError
KB008a name is statedError
KB009declared where its kind can beError
KB010a clause of its kindError
KB011a schedule's intervalError
KB012a property has a valueError
KB013a property is given onceError
KB014a property's placeError
KB015an assumption is marked onceError
KB016an assumption's reasonError
KB017an assumption's placeError
KB018what carries an assumptionError
KB019the scoped lineError
KB020a scoped file's folderError
KB021an extend in a scoped fileError
KB022one .g.kq fileError
KB023an Ecosystem's fileError
KB024the arranged layoutError
KB025authentication through a brokerError
KB026the broker idiom is unnamedError
KB027a ui statement's authenticationError
KB028a grant is its source'sError
KB029one credentialError
KB030a cloud role's resourceError
KB031an entity's header is stated onceError
KB032an entity of its storageError
KB033references stay with one ownerError
KB034a data migration covers an entity onceError
KB035one plateau without a blockError
KB036a derived plateau stands aloneError
KB037a plateau link is stated onceError
KB038plateaus form one sequenceError
KB039a plateau's occurrence restates nothingError
KB040a before block changes nothingError
KB041where a move is writtenError
KB042a move's destinationError
KB043a removal removes somethingError
KB044declared under what is removedError
KB046a policy set has one kindError
KB047a policy's set is stated onceError
KB048a policy's set is in scopeError
KB049a policy set's name is stated onceError
KB050an exemption is its owner'sError
KB051an exemption's subjectError
KB052an exemption is stated onceError
KB053an exemption's policy pathError
KB054a comment is keptError
KB055inside the modelError
KB056no model inside a modelError
KB057the repository file is a JSON objectError
KB058a known settingError
KB059a setting's valueError
KB060a command needs a repositoryError
KB061a command needs one sequenceError
KB062a command writes the whole modelError
KB063dissolve names a plateauError
KB064dissolve needs no before blockError
KB065a dissolve's directionError
KB066data migrations that would meetError
KB067the portal's output directoryError
KB068the repository's idError
KB069a message's version is stated onceError
KB070an event travels on a legError
KB071a message is carried onceError
KB072a removal carries nothingError
KB073a removal states no aclError
KB074a value is given once in a listError
KB075a process's statement is written onceError
KB076a name is not emptyError
KB077a version is named on a callError
KB078via names a call's gatewayError
KB079a kind its element takesError
KB080a period's formError
KB082a name used is a constantError
KB083a constant's valueError
KB084a legal basis is one of GDPR'sError
KB085a country is an ISO 3166-1 codeError
KB086a reserved policy set is written at the model or an EcosystemError
KB087a requirement is one its framework listsError
KB088a policy set's requirements are stated onceError
KB089a location word the registry holdsError
KB090a removal names its endsError
KB091a relationship keeps its attributesError
KB092a transfer ground is one of GDPR Chapter V'sError
KB501a policy-sets key names a setWarning

Syntax​

KB001 — syntax​

Error · syntax

The text is not valid Kanoniq: a keyword in the wrong place, a missing { or }, or a declaration cut short. The message says what the parser expected at that position. Look at the line and the one before it; a missing closing brace is often reported where the next declaration starts. The language guide has every form.

KB002 — characters the language reads​

Error · lexer

The file holds a character or a token Kanoniq cannot read, such as an unclosed quote or a stray symbol. Close the string or remove the character.

KB080 — a period's form​

Error · period-form

A period is misspelled. Kanoniq writes a period as an ISO 8601 duration: P, then years Y, months M and days D, then T and hours H, minutes M and seconds S, each a whole number with an uppercase letter, written once and in that order, such as P90D, P18M or PT15M; or weeks alone, P2W. The message names the rule the period breaks: P90d has a lowercase letter, PT0.5S a fraction, P1W3D a week beside days, P1D2Y its parts out of order. Write the period in that form.

KB083 — a constant's value​

Error · constant-value

A constant's value is a word other than true or false, such as const ENABLED = yes. A constant holds a period, a whole number, quoted text, true or false; write one of those after the =.

Names and references​

KB003 — a reference resolves​

Error · reference-resolves

A Code or path names nothing, names more than one element, or names an element of the wrong kind for its place. The message says which: where a bare Code was looked for, which segment of a path was not found, or what it named instead. Correct the spelling, write the full path from the root with a leading / if an inner Code hides the one you mean, or declare the element.

KB004 — a reserved Code​

Error · reserved-code

The Code is a reserved word or a name Windows gives a device, such as con or nul. Every Code must be able to name a folder. Choose another Code, or write a Code that is a reserved word with an @, as @customer.

KB005 — declared once​

Error · declared-once

An element, plateau, policy or data migration is declared twice. Remove one declaration, or, if the element has children, turn the second into a reopening: its keyword and Code alone, followed by a block.

KB006 — a reopening has a declaration​

Error · reopening-has-declaration

A reopening names an element that is declared nowhere, in the model or in the plateau before. Declare the element once, with its name, or correct the Code of the reopening.

KB007 — a reopening restates nothing​

Error · reopening-restates-nothing

A reopening is only a Code and a block. Its name, description, properties, assumption, environment and a workload identity's credential go on the declaration. Move them there, and give the reopening a block.

KB008 — a name is stated​

Error · name-stated

An element you declare states its name in quotes after its Code. Add the name. Only Kanoniq leaves a name out, on what it writes into .g.kq.

KB076 — a name is not empty​

Error · name-not-empty

A name is written "", or a code in parentheses is written (""). Write the name or the code between the quotes, or, for a code, leave the parentheses out.

KB082 — a name used is a constant​

Error · constant-resolves

A name is written where a value is taken, such as rotate MAX_ROTATION or #owner OWNER, and no constant in the model has that name. Check the spelling, or define it with const MAX_ROTATION = P90D.

KB085 — a country is an ISO 3166-1 code​

Error · country-known

A supplier's or a legal entity's headquarters, a contract's law, a branch's country after in, or the country of a data center or a saas component names a country that isn't an ISO 3166-1 alpha-2 code, such as headquarters UK or country UK. Write the country's two-letter code in capitals, such as headquarters GB, law IE or country GB. No country code is reserved, so a Code such as de stays legal.

KB089 — a location word the registry holds​

Error · location-known

A location names a region the registry of location words doesn't hold, such as location azure.west-europe. Write the region as its provider spells it, location azure.westeurope; the message lists the words the registry holds.

Structure​

KB009 — declared where its kind can be​

Error · declared-where-allowed

The element sits inside an element that cannot hold its kind: for example a module outside a monolith, a storage outside the Component or monolith that owns it, a policy in a block that holds none, or a data migration outside an Ecosystem. A later plateau's move that puts an element under one that cannot hold its kind, such as a module anywhere but in a monolith or a Component in a Domain or another Component, is refused the same way. Move it to where its kind belongs; the language guide says what holds what.

KB010 — a clause of its kind​

Error · clause-of-its-kind

The clause does not apply to this kind of element: environment and technology go on a deployable module only, schedule on a job or a robot only, and location and country on a saas component or monolith only. Any other component or monolith is where what it runs on is, so it states no location of its own. A module's kind in a plateau is the one its header has there: an environment line that stands where a later plateau restates its module as not deployable is refused, and so is a restated header with technology on a module that is not deployable. Remove the clause, or change the element's kind.

KB011 — a schedule's interval​

Error · schedule-interval

every takes a period with no month or year, such as PT15M, PT4H or P1D, since a month or a year has no fixed length. Write the interval in weeks, days, hours or minutes, or use monthly or cron.

KB075 — a process's statement is written once​

Error · process-statement-once

A job role's holds, a process's lane, a then between the same two nodes, or a node's message to or from the same party, is written twice in one plateau. Each is fixed by its two ends, so the second line says the same thing again. Delete one of them.

KB079 — a kind its element takes​

Error · kind-known

The kind after the colon of a network, a link, a host, an app platform, a database server, a gateway, a DNS record, a storage account, a vault, a registry, an AI platform, a backup vault, a security service or a broker is not one that element takes: no generic kind of it, and no product word the registry maps to it. A device host states what it is by a second word, such as kiosk, and no other host states one. A channel states its kind exactly where what holds it carries several: none in a broker whose kind carries one, one of them in a broker such as rabbitmq that carries several, and on a storage file-share or sftp on a file one, blob-storage or sftp on a blob one. A repository's format is one of oci, npm, nuget, maven, pypi, go, cargo, rubygems, swift, helm, terraform, apt, yum and generic, and an installation's kind one of os, runtime, sdk, web-server and middleware. Write one of the kinds the message names, or a product word for that element.

Properties and assumptions​

KB012 — a property has a value​

Error · property-has-value

A property line names a property but no value, or a comma with no value after it: write @name <value>, or a list's values @name <value>, <value>.

KB013 — a property is given once​

Error · property-once

A property has one value unless it is declared a list. Remove the second line giving it, or, on a connection, the second statement naming it; for a list, write its values on one line, separated by commas, or declare the property "list": true to give it several.

KB014 — a property's place​

Error · property-placed

A property line goes directly above a declaration or a statement that carries properties. Move it there, or remove it.

KB015 — an assumption is marked once​

Error · assumption-once

A line carries one #assumed. Remove the second.

KB016 — an assumption's reason​

Error · assumption-reason

An assumption's reason is quoted text that says why: #assumed "not confirmed by the team". Quote it, or leave the reason out entirely.

KB017 — an assumption's place​

Error · assumption-placed

An #assumed line goes directly above a declaration or a statement that carries one. Move it there, or remove it.

KB018 — what carries an assumption​

Error · assumption-carried

Only something known or unknown can be assumed. A plan is neither; a derived element carries the assumption of what it came from; an entity line that states nothing of its header has nothing to assume. Mark the line that states it instead, or remove the mark. See Assumptions.

KB074 — a value is given once in a list​

Error · property-value-once

A list property names each value once: #brand acme, acme gives one brand twice. Remove the second. Two paths naming the same element are one value given twice.

Splitting a model​

KB019 — the scoped line​

Error · scoped-first-line

A scoped file starts with scoped alone on its first line, with nothing before it, not even a comment. Move it to the top.

KB020 — a scoped file's folder​

Error · scoped-folder

A scoped file is read inside the element its folder mirrors, so the folder has to name one: the file must be under the model's root, not at the root itself, in a folder path that matches an element's path. Move the file to the right folder, or remove scoped.

KB021 — an extend in a scoped file​

Error · scoped-extend-policies

An extend block in a scoped file holds policies alone. Move anything else to the file of the element it belongs to.

KB022 — one .g.kq file​

Error · one-id-map

A model has one .g.kq file. Delete the extra one, keeping the file named after the repository.

KB023 — an Ecosystem's file​

Error · ecosystem-file-traced

A file the arranged layout gives an Ecosystem no longer holds that Ecosystem. Run kq arrange to put the declarations where they belong.

KB024 — the arranged layout​

Error · arranged-layout

In an arranged model, a file is not where the layout puts it, or holds what belongs in another file. Run kq arrange. This is the one error that does not stop the build: the model is still built and .g.kq written, but the command fails.

Connections and workload identity​

KB025 — authentication through a broker​

Error · broker-auth

A path into a broker is two arrows, so it states each one's scheme with sender-auth and receiver-auth. A single arrow states auth. Use the pair on a broker path and auth everywhere else.

KB026 — the broker idiom is unnamed​

Error · broker-idiom-unnamed

The broker idiom stands for two connections, so it takes no as name. Remove as, or write the two connections out if you need to name them.

KB027 — a ui statement's authentication​

Error · ui-no-auth

A ui statement carries no auth and no grant: who signs in is the Role's in, or the robot's runs-as. Remove the clause and state it there.

KB028 — a grant is its source's​

Error · grant-is-sources

A grant on a connection is a role of the connection's source. Write the grant on the connection from the element that holds the role.

KB029 — one credential​

Error · one-credential

A workload identity states one credential. Remove the extra ones.

KB030 — a cloud role's resource​

Error · cloud-role-on

A cloud role names the resource it is granted on with on, or is written as part of a connection to that resource. Add on <resource>, or move the role onto the connection.

KB070 — an event travels on a leg​

Error · event-on-a-leg

An event is named in carries on a call. An event travels into and out of channels, so name it on the publisher's connection into the channel and on each delivery out of it, or carry a command or a query on the call instead.

KB071 — a message is carried once​

Error · carried-once

A carries list, on a connection or a sync, names the same message, or the same version of it, twice. Remove the repeat.

KB072 — a removal carries nothing​

Error · removal-carries-nothing

A - line for a connection has carries. A removal names a connection by its ends and transport only, so drop carries from it; to change what a connection carries, remove it and write it again with its new list.

KB073 — a removal states no acl​

Error · removal-states-no-acl

A - line for a connection has acl. A removal names a connection by its ends and transport only, so drop acl from it; to add or drop the anticorruption layer, remove the connection and write it again with or without acl.

KB077 — a version is named on a call​

Error · version-on-a-call

A version follows the target of a statement that lands on no interface: a connection into or out of a channel, the broker idiom or an in-process call; or a - line for a connection names one. Only a call to an interface names the version it calls, so drop it there. A removal names a connection by its ends and transport only; to move a caller to another version, remove the call and write it again with the new version.

KB078 — via names a call's gateway​

Error · via-on-a-call

A via <gateway> sits on something other than a call over a protocol: a leg into or out of a channel, the broker idiom, a ui statement, or a - line. Only a call goes through a gateway, so drop via there; to change a call's gateway, remove the call and write it again with its new via.

Data​

KB031 — an entity's header is stated once​

Error · entity-header-once

Each part of an entity's header (its root, its markers, part of, from and its description) is stated once. Remove the repeat.

KB032 — an entity of its storage​

Error · entity-of-storage

The name is not one of this storage's entities. Correct it, or declare the entity in the storage.

KB033 — references stay with one owner​

Error · references-within-owner

references names an entity in a storage of the same Component. Point it at one of those, or remove it.

KB034 — a data migration covers an entity once​

Error · migration-covers-once

Remove the second covers line for the entity.

Error · legal-basis-known

A data use states a word GDPR doesn't list, such as basis contractual. A basis is one of the six lawful bases of Art. 6(1), and a special one of the conditions of Art. 9(2) or Art. 10's authorized-by-law. Write the word as the list spells it, such as basis contract. None of these words is reserved but contract, which basis still reads, so a Code such as consent stays legal.

KB092 — a transfer ground is one of GDPR Chapter V's​

Error · transfer-ground-known

A contract's transfer states a word GDPR Chapter V doesn't list, such as transfer consent. A ground is one of adequacy, scc, bcr, code-of-conduct, certification, ad-hoc-clauses and public-instrument; an Art. 49 derogation isn't one, since it is for occasional transfers rather than a standing flow. Write the word as the list spells it, such as transfer scc. None of these words is reserved, so a Code such as scc stays legal.

Plateaus​

KB035 — one plateau without a block​

Error · one-base-plateau

Exactly one plateau is declared without a block; the model's top level is its content. Every other plateau has a block. Give each extra one a block, or, if none is declared without one, take the block off the plateau the model starts from.

KB036 — a derived plateau stands alone​

Error · derived-plateau-alone

Kanoniq derives a plateau only for a model that declares none. Once you declare plateaus, declare this one in a model file too: plateau <code> "<name>".

Error · plateau-link-once

The link between two plateaus is stated once: after on the later, or before on the earlier, not both. Remove one.

KB038 — plateaus form one sequence​

Error · plateaus-one-sequence

Plateaus form one line: every plateau but the first follows exactly one other, and no two follow the same one. Fix the after and before links so there is no fork, merge, loop or plateau left on its own.

KB039 — a plateau's occurrence restates nothing​

Error · plateau-occurrence-restates-nothing

Inside a plateau, a description, property or assumption goes on a declaration, which restates the element's header. Write the element's full declaration in that plateau, or move them out.

KB040 — a before block changes nothing​

Error · before-block-changes-nothing

A move or a policy change belongs in the later plateau, not in a before block. Move it there. kq arrange writes every plateau forward.

KB041 — where a move is written​

Error · move-written-where-new

A move is written where its element lands, not inside a block of an element the plateau before holds. Write it in the destination's block.

KB042 — a move's destination​

Error · move-destination

A move lands on a free path. Choose a destination that no element already holds, and that is not under the element being moved. The path is judged once the whole plateau is read, so the plateau can't add an element where the move puts another. Only an ecosystem moves to the model's top, and an ecosystem moves nowhere else. An element moves once in a plateau; a second move gives it two destinations. A move names its element by its path in the plateau before, so a move naming the path an earlier move of the same plateau made names nothing, KB003.

KB043 — a removal removes something​

Error · removal-removes

A removal names something the plateau before holds. Check the name and the plateau; if the element was added in this plateau, delete its declaration instead. A -v1 in a message's block names a version the plateau before has, and is never written in the model's first state. A plateau does not both move and remove an element: a - line that takes away what a move of the same plateau moves, itself or with an element above it, is refused; write the move or the removal, not both.

KB044 — declared under what is removed​

Error · declared-under-removed

The element is declared under one its plateau removes. Move it to a parent that stays, or keep the parent.

KB069 — a message's version is stated once​

Error · version-stated-once

A version is written twice in an event's, a command's or a query's block, or a later plateau adds a version the plateau before already has. Write each version once; a plateau writes only the versions it adds, v3, and the ones it removes, -v1.

KB090 — a removal names its ends​

Error · removal-names-ends

A - line removing a then states its name, or one removing a used-by states its reason. Such a line names the relationship by its two ends alone: write -review then pay, not -review then pay [yes], and leave the name or the reason out.

KB091 — a relationship keeps its attributes​

Error · return-keeps-attributes

A then, a message flow or a used-by written again in a later plateau, after a - line ended it, states another name, over chain or reason than it was first stated with. Written again, it is the same relationship, with one name, chain or reason in every plateau it lives in: write it as it was first written.

Policies​

KB046 — a policy set has one kind​

Error · policy-set-one-kind

Every occurrence of a policy set states the same kind, model or architecture. Make them match. See Governance.

KB047 — a policy's set is stated once​

Error · policy-in-once

A policy outside every set names where it goes, with in model, in architecture or in <set> after its Code. A policy inside a set takes the set's kind, and writes no in. Add or remove in to match.

KB048 — a policy's set is in scope​

Error · policy-set-in-scope

in <set> names a set of the model, or of the policy's own Ecosystem. Correct the Code, declare the set, or move the policy to where the set is.

KB049 — a policy set's name is stated once​

Error · policy-set-name-once

A policy set's name is written once, at one of its occurrences. Remove it from the others.

KB050 — an exemption is its owner's​

Error · exemption-by-owner

Only the side that owns a policy can lift it. Write the exemption in the Ecosystem the message names.

KB051 — an exemption's subject​

Error · exemption-subject

An exemption at the model's top level names what it exempts with for <subject>. Add it.

KB052 — an exemption is stated once​

Error · exemption-once

A policy is exempted once for one subject. Remove the duplicate exemption.

KB053 — an exemption's policy path​

Error · exemption-policy-path

An exemption names its policy as <set>/<policy>, or <ecosystem>/<set>/<policy> from outside the policy's Ecosystem. Write the path in that form.

KB086 — a reserved policy set is written at the model or an Ecosystem​

Error · reserved-set-in-ecosystem

A policy set with a reserved Code, default-model, default-architecture or one of the four baseline-… presets, is written at the model's top or in an Ecosystem's block, never in a Platform or below. Move the set out of the Platform or Component block, and write the policies of that block as policy <code> in model, in architecture or in <preset>.

KB087 — a requirement is one its framework lists​

Error · requirement-known

A requirement after serves names a framework that neither Kanoniq ships nor your repository declares, or an id that framework doesn't list, such as serves pci-dss-4/13.1.1. Write the framework's word as Kanoniq ships it, such as iso-27001-2022, or declare your own framework and its ids in the repository's frameworks setting, and write the id as the framework numbers it.

KB088 — a policy set's requirements are stated once​

Error · policy-set-serves-once

Two occurrences of one policy set each state serves. State the requirements the set serves on one of its occurrences, as its name is.

Canonical form​

KB054 — a comment is kept​

Error · comment-kept

Kanoniq rewrites files in canonical form and keeps every // comment above the declaration or statement it precedes. This comment has nothing to go above, or would be written twice. Move it directly above a declaration.

The repository's files​

KB055 — inside the model​

Error · inside-model

In a repository, every .kq file belongs under model/. Move the file there, or delete it.

KB056 — no model inside a model​

Error · no-nested-model

A model holds no other model: this kanoniq.repository.json sits inside one. Delete it, or move the folder out of the model.

KB057 — the repository file is a JSON object​

Error · repository-file-object

kanoniq.repository.json is JSON holding one object, with // and /* … */ comments allowed and no trailing comma. Fix the syntax; the message says where it broke.

KB058 — a known setting​

Error · repository-setting-known

The key is not a setting. Check its spelling against the settings kq init writes, and remove it if it is not one.

KB059 — a setting's value​

Error · repository-setting-value

The setting's value is not of its form. The message says what form it takes. An end-of-support-error longer than the end-of-support-warning is this error too, since the error comes before the warning: shorten the error, or lengthen the warning. So is a confidentiality-levels that is empty, lists a level twice, or lists a reserved word other than public, internal and secret: list each level once, spelled as a code is. So is a residencies entry whose name isn't spelled as a code is or is a reserved word, that holds a key other than countries and adequate, whose countries is empty, or that lists a code outside ISO 3166-1, a country twice or an adequate country among its own: list each country once, as its two capitals.

KB501 — a policy-sets key names a set​

Warning · policy-sets-key-names-set

A key under policy-sets names a policy set the model does not have. Remove the key, or correct it. This is a warning, so a set can be removed before its setting.

Commands​

KB060 — a command needs a repository​

Error · command-needs-repository

A command that writes needs a repository: kq build, kq prune, kq arrange, kq dissolve and kq portal:build read a model whose root is marked by kanoniq.repository.json. Run kq init to make one.

KB061 — a command needs one sequence​

Error · command-needs-one-sequence

kq arrange and kq dissolve need the model's plateaus to form one sequence. Fix KB038 first.

KB062 — a command writes the whole model​

Error · command-writes-whole-model

kq arrange and kq dissolve write the whole model or nothing. This one could not place everything, so it wrote nothing. Fix what the other messages report and run it again.

KB063 — dissolve names a plateau​

Error · dissolve-names-plateau

kq dissolve names a plateau of the model by its Code. Check the spelling.

KB064 — dissolve needs no before block​

Error · dissolve-needs-arranged

kq dissolve reads a model with no before block. Run kq arrange first, which writes every plateau forward.

KB065 — a dissolve's direction​

Error · dissolve-direction

A plateau dissolves into a neighbor it has: the model's only plateau has none, the first plateau dissolves only into next, and the last only into previous. Choose the other direction.

KB066 — data migrations that would meet​

Error · dissolve-migrations-meet

Dissolving the plateau would put two data migrations at one path. Rename or remove one of them first.

KB067 — the portal's output directory​

Error · portal-out-directory

kq portal:build writes into a directory that is not the repository nor above it, and that is empty or holds only what it wrote before. Choose another --out directory, or empty it.

KB068 — the repository's id​

Error · portal-repository-id

kq portal:build needs the repository's permanent id in kanoniq.repository.json. Add the "id" the message gives; it stays the repository's for good.

© 2026 Extenza Works. All rights reserved.