HydraIssues

Fresh-install path: Sunshine starts with no credentials, so hydrabody cannot register apps until someone sets them
open unclassified Project: hydrabody Parent: #714 Reporter: 14 Oct 2026 23:13

Description

Found 2026-10-14 bringing up the first cloud body (#708). The owner asked that the fresh-install path be investigated specifically.

The chain of failure on a brand-new machine

  1. hydrabody installs Sunshine. A fresh Sunshine has NO credentials at all and serves its welcome page instead of the API.
  2. hydrabody's app sync calls ListApps() first and aborts on error, so every tick logs:
    [sunshine] failed to list apps: parsing apps: invalid character '<' looking for beginning of value
    That < is the HTML welcome page. The message does not say "not authenticated", which sends you looking at JSON parsing rather than at auth.
  3. No apps are ever registered, so no head can stream anything, even though the experience is installed and Sunshine is otherwise healthy.

Why the existing recipe does not cover it

recipes/hydraguard-air-windows.yaml has a configure-sunshine step, but it posts to /api/password with currentUsername: admin and currentPassword: admin. That assumes Sunshine was already initialised with admin/admin. On a genuinely fresh install there is no current credential, so the call fails and the step silently gives up after its retries.

What worked

POST to https://localhost:47990/api/password with only newUsername, newPassword and confirmNewPassword, no current credentials, reading the values from .hydranode/config_cache.yaml (sunshine_username, sunshine_password) which hydracluster already supplies per district from getProviderConfig(district). After that /api/apps returns 200 and registration works.

Suggested fixes

  1. Make the first-run case explicit. Try the no-current-credential form first, fall back to admin/admin for older installs. Belongs in hydrabody rather than the air recipe, since it is hydrabody that owns the provider.
  2. Improve the error. When ListApps gets a non-JSON body, say "Sunshine API returned HTML, it is probably unauthenticated or uninitialised" rather than surfacing a JSON parse error.
  3. Do not abort the whole sync on a list failure if registration could still proceed, or at least log at a level that makes the cause obvious.

Second, smaller finding

After the credential fix, hellohydra-xr and hydraunrealtemplate were registered but rupelmonde-castle-viewer was not, despite having a valid exe_path in .hydrabody/experiences.yaml. The [sunshine] log lines then stopped entirely rather than reporting success or failure, so the sync appears to have stopped ticking after a hydrabody restart. Registering it directly via the API worked. Not root-caused; worth a look alongside the above, since a sync that neither succeeds nor logs is hard to notice.

Related: #708, #707, #798 (the provider zip is also 404, so a fresh body cannot even get Sunshine from the release server).