# Troubleshooting

These instructions apply to the current Admin Console.

{% hint style="info" %}
Contextual Sites run on Contextual Workers, which are in early access and may not be available in your account. [Contact Contextual support](mailto:help@contextual.io) to request that Workers be enabled for your tenant.
{% endhint %}

For image build or push failures, deployment inspection, old images, logs, and runtime limits, start with [Worker Troubleshooting](https://docs.contextual.io/build/contextual-workers/troubleshooting.md). Use the checks below for Site-specific configuration and authentication issues.

## Site Source Initialization Fails

* If **Create repository** lists no GitHub connections, check that the Connection shows **Connected** for the intended account. See [GitHub Connection setup](https://docs.contextual.io/build/contextual-workers/contextual-cli.md#deploy-from-github).
* If the repository name or **Deployed Worker ID** is already taken, choose an unused name in the GitHub account or an unused Worker ID in the tenant, respectively. If the error says GitHub already created the repository but setup or linking failed, inspect that repository before retrying.
* If an older Site shows **Open in GitHub** in place of the source controls, it uses the legacy GitHub Releases source. Open its existing repository to work on its code.

## The Site Worker Does Not Become Ready

Inspect readiness under the Worker's **Deployment** tab. A **Running** status alone does not verify the application.

* Confirm that `SITE_ID` names an existing Site in the intended tenant, with the intended Site version and Auth Profile. See [Understand the Site Binding](https://docs.contextual.io/build/sites/site-workers.md#understand-the-site-binding).
* Confirm that the Worker uses `managed-site-worker` and its `IMAGE` option selects the intended application image. For the Astro starter, build in `DEPLOYMENT=WORKER` mode to produce the standalone server. Other frameworks must meet the [Site image contract](https://docs.contextual.io/build/sites/site-source-code-and-runtime.md#use-another-framework).

The managed Site template supplies gateway readiness checks; the application does not need a custom health route. Follow [Deploy and Verify](https://docs.contextual.io/build/sites/site-workers.md#deploy-and-verify) to check actual hosted content and access.

## Hosted Sign-In Fails

Check the Site's selected Auth Profile. If you created the Site User in advance, confirm that it belongs to that profile. For a first BYO sign-in, check that the identity meets the [provider requirements](https://docs.contextual.io/build/sites/manage-site-users.md#how-site-users-work).

* For **BYO Stytch**, verify the profile's project settings and that the project allows the hosted origin and sign-in redirect.
* For **Managed Stytch**, restart or update the Worker if you added authentication to a running Site or switched it from BYO. This registers the Worker URL, verified custom domains, and sign-in redirects. Then test sign-in, sign-out, and protected routes at the affected URL. See [Authentication and Browser Origins](https://docs.contextual.io/build/sites/site-workers.md#authentication-and-browser-origins).

`site-auth.local.json` configures local development only. Editing it or the Site's **Test Auth Profile** does not change hosted authentication. See [Configure BYO Stytch for Production and Local Development](https://docs.contextual.io/build/sites/manage-auth-profiles.md#configure-byo-stytch-for-production-and-local-development).

## Visitors Are Sent Back Through Sign-In

If sign-in works on the home page but expires on other protected pages, check that each signed-in page renders `<cds-user>`. The Astro starter renders it in `src/pages/index.astro`. To share it across pages, move it and its authentication and session settings into their shared layout and remove the home-page copy. Other frameworks must keep their Stytch frontend SDK active. See [Keep Sessions Fresh on Every Page](https://docs.contextual.io/build/sites/site-source-code-and-runtime.md#keep-sessions-fresh-on-every-page).

## Configuration or User Changes Have Not Appeared

For Site or Auth Profile changes, follow [Apply Site Configuration Changes](https://docs.contextual.io/build/sites/manage-sites.md#apply-site-configuration-changes), especially when `SITE_ID` pins a Site version. For saved user changes or session revocation, see [Update a Site User](https://docs.contextual.io/build/sites/manage-site-users.md#update-a-site-user) for cache and JWT-expiry behavior.

## Get Help

[Contact Contextual support](mailto:help@contextual.io) with the tenant ID, Site ID, Worker ID, failing step, and non-secret error. Do not include tokens, session cookies, full authentication configuration, or private application data.
