# Troubleshoot git and publishing

Start from the symptom, reproduce it locally when possible, and confirm the published version after the fix.

## The ontology check failed

Run the same validation in the checkout for a more detailed error:

```bash
cassis ontology check
```

Common causes are malformed YAML, an unknown or misspelled field, a missing required field, an invalid domain path, or a reference to a domain that is not in the tree. Fix the named file, then run `cassis ontology fmt` and `cassis ontology check` again.

Cassis keeps the previous published version when an import fails.

## Cassis cannot find the ontology

The complete tree must be under the project’s configured **Path**, `cassis/` by default, on the default branch. If every reported path has an unexpected extra directory, update **Path** to the actual location or move the tree once and review that change before merging.

## No pull-request check appeared

Under **Organization → GitHub**, confirm that:

-   the Cassis App installation includes the repository;
-   the project points to the correct `owner/name`;
-   ontology checks are enabled for Cassis-created branches when the branch starts with `cassis/`.

## A merge did not publish

On GitHub, check the Cassis sync result on the default-branch commit. On another provider, check that the default-branch job ran `cassis ontology upload` with the correct project ID and API key.

A `403` from GitHub usually means the App no longer has Contents and Pull requests write access. A `404` usually means the repository was renamed, deleted, or has no default branch.

## Retry an import without another push

An organization admin can call `POST /api/projects/{project_id}/git-sync/pull`. The response is `synced` or `up_to_date`.

A forced re-import overwrites unpublished in-app edits, like any repository import. Check **Pending changes** first if both editing paths have been used.

After any recovery, confirm the expected version with `cassis status` or `get_project_status`. Exact validation messages and exit codes are in the [CLI reference](/reference/cli/ontology/).
