> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/troubleshooting-and-faq/troubleshooting/package-installation-issues/troubleshooting-failed-craft-packages.md).

# Troubleshooting failed craft packages

Diagnose failed craft package installs by reading tray.log for user scope or realmjoin.log for system scope.

For craft packages there are no separate logs (unless explicitly written by an installer inside the craft package).\
Depending on the scope they are executed within `system` or `user`, the (very basic) output will be found in the `tray.log` (for user scope) or in the `realmjoin.log` (for system scope).

## User scope craft packages

For craft packages running in user scope, as mentioned above, the output will be found in the `tray.log` file. Instead of the package id the relevant lines can be found using the configured display name of the package:

{% code overflow="wrap" %}

```log
2023-11-07 15:37:57.7527|INFO|RealmJoin.Core.SoftwarePackaging.CraftPackageEntry|   1|Installing craft package Microsoft Teams 1.6.0.2757300 (user)
```

{% endcode %}

This will be followed more or less instantly (depending on installation time) by:

{% code overflow="wrap" %}

```log
2023-11-07 15:38:51.1590|INFO|RealmJoin.Core.SoftwarePackaging.CraftPackageEntry|   1|Package result: Code = 0, Output:

2023-11-07 15:38:51.1590|INFO|RealmJoin.Core.SoftwarePackaging.CraftPackageEntry|   1|Successfully installed package Microsoft Teams 1.6.0.2757300 (Craft).
```

{% endcode %}

<figure><img src="https://2868468309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FdzUye7qk7RCTQ1YAF9f1%2Fcraft-user-install.png?alt=media&amp;token=4ee49916-b9c4-4682-ad19-595d30bcd9c7" alt=""><figcaption><p>Example output of successful craft user package installation</p></figcaption></figure>

## System scope craft packages

The relevant logs for craft packages running in system scope will be split across `tray.log` for download and initialization information, and `realmjoin.log` for the actual output and return code. Other than that, it's the same as for user craft package installation.

The example below shows how package output is included in the log file:

<figure><img src="https://2868468309-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FyedjTexR79xW04oBU6nV%2Fcraft-system-install.png?alt=media&amp;token=f8c6ccc5-50ca-429f-95d3-c42204a5d116" alt=""><figcaption><p>Output of craft package script as it appears in the log file.</p></figcaption></figure>

The `tray.log` file will always include a hint in parentheses after the version number whether the package is run in system or user scope:

{% code overflow="wrap" %}

```log
2023-11-07 15:48:58.5875|INFO|RealmJoin.Core.SoftwarePackaging.CraftPackageEntry|   1|Installing craft package RealmJoin Set Environment Variable 2.0.0.0 (system)
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/troubleshooting-and-faq/troubleshooting/package-installation-issues/troubleshooting-failed-craft-packages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
