Chapter 22

Troubleshooting Pi Agent

The previous 21 chapters explain what to do when everything works. This chapter starts from the other direction: identify a visible symptom and work toward a solution. Whether you see a 401, 402, or 404 error, lose access through Ingress, encounter a video workflow failure, or cannot install a Skill, each section gives you a practical check you can complete in 2-3 minutes. This is the final page of the guide—and probably the one you will revisit most often.

How to use this guide

The reason for this chapter is simple: problems do not occur in the order of a tutorial. Your API key may work for two months after Chapter 6, then suddenly produce a 401 one morning. The video workflow from Chapter 18 may run reliably until it produces a black screen one weekend. At that point, you do not want to reread the guide from the beginning; you want to know what the error means and what to try next.

This chapter is therefore organized by symptom:

  • Start with the 5-second quick checks. They eliminate roughly 80% of simple causes immediately.
  • Then find the section that matches what you see. A 401 notification leads to the 401 section; a 404 after selecting the sidebar entry leads to the 404 section.
  • Where appropriate, a section points back to the chapter that explains the underlying feature in depth. This page is for immediate recovery; the earlier chapters provide the background.

You are not expected to read this chapter straight through. Return to the relevant section when you need it. Each section stands on its own, names the symptom directly, and does not assume that you have read the others. Bookmark this page for the next time something goes wrong.

Concept: Documentation usually serves two different purposes. A tutorial teaches a workflow from the beginning; a troubleshooting reference helps someone who already knows the workflow recover when it fails. The previous 21 chapters are tutorials. This chapter is deliberately written as a reference.

Quick self-checks: start here

When Pi Agent develops a problem, run these three checks before investigating the specific symptom. They take less than a minute and identify the cause of roughly 80% of reported problems.

  1. Is the add-on still running?

    Return to the Home Assistant home page, then open Settings → Add-ons → Woow HA Pi Agent and check its status. A green Started indicator means the add-on is running. If the status is Stopped or red, select Start, allow 30-60 seconds for initialization, and try again.

  2. Is the correct provider selected?

    Return to the Pi Agent conversation screen and inspect the model selector above the message box. It should show a provider and model, such as GLM / glm-4.6. If it is disabled or says “No model,” the Models panel is not configured correctly. Follow Chapter 6 to enter the key and confirm that Test succeeds.

  3. Can this network reach the internet?

    Open https://www.google.com in a new browser tab. If it does not load, repair the local internet connection before troubleshooting Pi Agent. If general internet access works but one provider does not, check that provider’s official status page and make sure its API endpoint is permitted by your network policy.

If all three checks pass, continue with the section that matches your symptom.

Tip: In an illustrative set of 10 “Pi Agent is broken” reports, 8 may turn out to be an add-on that did not restart cleanly after a Home Assistant update, a missing key, or a dropped Wi-Fi connection. These checks take less than 30 seconds, so run them first every time.

401 Unauthorized: check the API key

Symptom: After you send a message, a red “401” or “Unauthorized” notification appears in the upper-right corner and the AI does not respond.

In plain English: The provider received the request but did not accept its credentials. As a rule of thumb, about 90% of these failures are key-related; the remaining 10% require checking the endpoint or provider status.

Possible causeLikelihoodWhat to do
API key is incorrect or expired 90% Open the Models panel described in Chapter 6, select the provider, enter a current key, and select Test. Continue only after the test succeeds.
Incorrect baseUrl 5% Compare the provider’s current endpoint with Chapter 11, then correct the baseUrl in the Models panel. Do not mix an OpenRouter key with a direct-provider endpoint, or vice versa.
Provider service interruption 5% Check the provider’s official status page. GLM, OpenAI, and Anthropic each publish one. Wait for recovery, or switch to another configured provider if the request is urgent.

Common misconception: A 401 does not normally mean that the internet connection, computer, or add-on itself is broken. It means that the selected provider rejected the supplied credentials. Correct the key, endpoint, and provider pairing first.

Warning: Do not add spaces or line breaks before or after a key, and make sure no characters are missing. Keys are often 40-60 characters long, so a browser selection can easily omit part of one. Paste the value into a plain-text editor first if you need to inspect it—but do not save the key in an unsecured file.

402 Payment Required or 429 Too Many Requests

Symptom: Sending a message produces a 402 error, or the message includes “insufficient_balance,” “insufficient balance,” “rate limit,” or “quota exceeded.”

In plain English: The credentials may be valid, but the account has no usable credit, has reached a quota, or is temporarily being rate-limited.

  1. Distinguish a billing problem from a temporary rate limit

    insufficient_balance, insufficient balance, credits, and quota usually point to account credit or quota. rate_limit and too many requests usually indicate a temporary limit. Wait 1-2 minutes before retrying a temporary limit, and avoid sending duplicates while you wait.

  2. Add credit if the account balance is exhausted

    Open the billing page for the provider that actually handles the selected route. GLM uses bigmodel.cn, OpenAI uses platform.openai.com, Anthropic uses console.anthropic.com, and OpenRouter uses openrouter.ai. You do not need to restart the add-on after adding credit; the next request can use the updated balance.

  3. Or switch providers, as described in Chapter 13

    Select another provider and model that you have already configured and tested. The alternative may have different charges and limits, so check its current terms. Chapter 10 explains why maintaining a tested second provider reduces reliance on a single service.

Credit and quota terms change. Trial balances, daily limits, and reset periods vary by provider, route, and account. Before diagnosing a 402 from an old signup offer or fixed reset assumption, check the current dashboard.

Tip: A 402 or 429 is a provider or account response, not evidence that Pi Agent itself is broken. AI requests consume tokens and are subject to billing and rate limits. A tested backup provider is the most reliable long-term fallback.

404 Not Found: check Ingress and the add-on

Symptom: After selecting Pi Agent in the sidebar or Open Web UI on the add-on page, you see “404 Not Found” or “Ingress token invalid.”

A 404 in this situation is usually related to Ingress, the mechanism Home Assistant uses to proxy an add-on’s web interface. Check these three cases:

SituationWhat you seeWhat to do
Expired Ingress token The page worked earlier but returns 404 after you come back to it Return to the Home Assistant home page and select Pi Agent in the sidebar again. Home Assistant will issue a new token. In rare cases, you may need to run ha core restart.
Add-on is not running Pi Agent does not open at all, and Open Web UI does not respond Open the add-on’s Info tab and check its status. If it is stopped, select Start and wait 30-60 seconds.
Sidebar entry is missing Pi Agent is running, but no entry appears in Home Assistant’s left sidebar On the add-on’s Info tab, enable Show in sidebar. Versions after v0.8.0 normally enable it automatically through Supervisor, but you can enable it manually if registration fails.

Chapter 3 explains the relationship between the sidebar and Ingress in detail. For immediate troubleshooting, eliminate the three cases in the table first.

Concept: Think of Ingress as a hotel desk. Home Assistant issues a temporary keycard—a token—when you open Pi Agent. If that card is no longer valid, opening Pi Agent from the sidebar requests a fresh one. That is why returning to the sidebar often resolves this kind of 404.

A conversation keeps spinning without a response

Symptom: The message appears to send and a spinner appears in the lower-right corner, but the AI does not respond. No clear error notification appears.

This is harder to diagnose than a 401, 402, or 404 because there is no visible error code. Check the following in order:

  1. Confirm the prerequisites

    Is a model selected? Does Test succeed for the corresponding provider in the Models panel? If either answer is no, return to Chapter 6 and correct the configuration before continuing.

  2. Allow for model and route latency

    Reasoning-capable models may take 30–60 seconds or longer before they begin responding. There is no universal 90-second threshold: latency depends on the model, route, request size, and provider load. Chapter 12 explains the difference. Compare the same prompt with another configured model if you need to isolate the cause.

  3. Check whether the network blocks the provider endpoint

    A corporate VPN, school network, DNS filter, or regional policy may block a provider’s baseUrl. Opening https://api.openai.com in a browser is only a basic connectivity check, not a complete API test. Check the official status page and test DNS and HTTPS from the relevant host. If necessary, switch to another configured route that is supported on your network and in your location.

  4. Give the add-on’s Watchdog time to recover pi-web

    In rare cases, pi-web may remain running but stop responding. Wait for automatic recovery first. The Watchdog added in v0.10.0 probes /api/home once a minute and asks Supervisor to restart an unresponsive add-on. It should detect the failure within 60 seconds; allow 60-90 seconds in total, then reopen Pi Agent and check the logs.

If the request still does not complete, open the add-on’s Logs tab and inspect the final 30 lines around the failed attempt. Copy the relevant lines, redact secrets, and use them when opening a GitHub issue.

Warning: A slow response is not necessarily a stalled response. Do not select Send repeatedly while waiting. Three submissions can create three billable requests, making the queue slower and consuming more tokens. Use observed provider status and latency rather than an arbitrary timeout.

Video workflow failures: symptom table

The video workflow—the pitch_video Skill introduced in Chapter 18—has more potential failure points because it connects 5-6 tools: TTS, Playwright capture, ffmpeg composition, subtitle rendering, and rclone upload. Find the row that matches the stage at which the workflow stops.

SymptomLikely causeWhat to do
The AI stalls while writing script.yaml, or the script has no usable structure The selected model is not reliably following the structured script format Use a current reasoning-capable model through a configured provider when the task requires one. See Chapter 12, then retry with a clear request to validate the YAML structure.
Playwright produces a video that is entirely black or gray Chromium is incomplete, or the Playwright cache is damaged On the Configuration tab, set reset_video_tools to true, save, and restart the add-on. Allow 3-8 minutes for the 720MB download. After a successful reset, Supervisor normally returns the option to false; if the log says that auto-revert failed, turn it off manually. See Chapter 18 for the complete procedure.
The video has images but no narration edge-tts cannot reach the Microsoft TTS endpoint Search the Logs tab for edge-tts and look for a timeout or network error. If the network blocks speech.platform.bing.com, follow your network policy or configure another supported TTS workflow rather than repeatedly retrying the blocked endpoint.
The video has images and narration but no subtitles The SRT file exists, but ffmpeg did not render it Inspect the pitch_video Skill’s SKILL.md. Subtitle rendering uses the ffmpeg -vf subtitles= step. Search Logs for subtitles. If fonts-noto-cjk is missing from the image, reinstall or update the add-on; reset_video_tools does not reinstall image packages. If the SRT path is wrong, compare it with script.yaml.
The video is complete, but the upload fails The rclone Google Drive authorization is invalid, revoked, or expired Follow Chapter 19 and reopen rclone --config=/data/pi-agent/rclone/rclone.conf config to test or reconnect the remote. Do not assume that every token expires after a fixed period; use the actual rclone error and provider account status.
The workflow cannot start because it cannot find python, ffmpeg, or rclone video-tools-init did not finish, or the add-on image is incomplete For a missing Python environment, set reset_video_tools, restart, and allow 3-8 minutes for the 720MB initialization while you monitor video-tools-init in Logs. Because ffmpeg and rclone come from the add-on image, reinstall or update the image if either binary is missing.
Tip: To trace a video workflow, temporarily change the add-on’s log_level to debug, restart, and reproduce the failure once. The Logs tab will show much more detail for each stage. Return the setting to info afterward so the log does not grow unnecessarily.

A Skill will not install or activate

Chapter 15 explains Add from URL, and Chapter 16 explains how to write a Skill. Use these checks when installation or activation fails:

  1. Add from URL produces no result

    There are two common causes. (1) The package specification is invalid. Pi does not accept a bare owner/repo value such as elmo/fridge-check. Use a full URL such as https://github.com/elmo/fridge-check or a supported Git specification such as git:github.com/elmo/fridge-check. Check for spaces and missing characters. (2) The repository is private. A plain HTTPS clone has no credential prompt in the UI. Use a documented SSH package specification with keys configured in the container, or make the repository public. This is separate from the sidebar problem below.

  2. The clone completes, but the Skills panel does not show the new Skill

    Press F5 to refresh the panel, then use Reload Session or start a new Session. Confirm that the installed package contains a SKILL.md file with uppercase SKILL and lowercase .md in a directory Pi scans. If a repository only stores Skills in an unsupported nested layout, Pi may install the package without discovering a Skill.

  3. The Skill appears in the list, but the AI does not use it

    Inspect the SKILL.md description field. The agent uses that field to decide whether the Skill applies to the current request. A vague description such as “helps with household tasks” provides little signal. Follow the principle in Chapter 16: state the task clearly and identify the user requests that should trigger the Skill.

  4. The Skill and description are correct, but it is still ignored

    Verify that the Skill appears in the current Session’s available Skills, reload the Session if necessary, and explicitly ask the agent to use it. Then compare with another reasoning-capable model. Lightweight models such as GLM-4-Flash may follow complex system instructions less consistently; Chapter 12 explains why, but switching models cannot repair an undiscovered or malformed Skill.

The Pi Agent sidebar entry is missing

If Pi Agent does not appear in Home Assistant’s left sidebar, check these three items:

  1. Is Show in sidebar enabled on the add-on’s Info tab?

    Open Settings → Add-ons → Woow HA Pi Agent → Info, then find the Show in sidebar switch. Since v0.8.0, the add-on normally enables this through the Supervisor API at startup. If that registration fails, enable the switch manually; doing so does not change the rest of the configuration.

  2. Is the signed-in Home Assistant account an Administrator?

    The Pi Agent panel uses panel_admin: true, so only an Administrator can see it. A standard account shared with a family member will not display the entry. Chapter 3 explains this restriction. To grant access, open Settings → People → Users, select the user, and enable Administrator only if that level of access is appropriate.

  3. Restart Home Assistant once

    In rare cases, Supervisor does not register the side panel with Home Assistant Core. Run ha core restart or use Restart Home Assistant in the UI to request registration again.

Concept: The sidebar entry, Ingress token, and add-on process belong to three different layers. A missing sidebar entry does not prove that the add-on is down, and a green add-on status does not prove that Ingress works. Diagnose each layer separately.

The add-on restarts repeatedly, every 60 seconds

Symptom: The add-on status is green, but the Logs tab shows video-tools-init or pi-web starting… starting over every 60 seconds. Conversations are unstable and may disconnect midway through a response.

In plain English: Home Assistant Supervisor’s Watchdog probes /api/home once a minute and restarts the add-on when it does not respond. This protection was added in Pi Agent v0.10.0 so an unresponsive process does not leave users staring at a blank page. If the add-on fails during every initialization, however, Watchdog can create an endless restart loop.

  1. Find the error immediately before the restart

    Scroll to the latest entries in the Logs tab and inspect the lines before startup repeats. Look for Error, Failed, or fatal. Common clues include an interrupted video-tools-init download, a port already in use, or pi-web being unable to read models.json.

  2. If video-tools-init fails, reset only the downloaded tools

    Set reset_video_tools on the Configuration tab, restart, and let initialization finish. This is the recovery procedure described in the video workflow section. It rebuilds the Python environment and Playwright cache; it does not reinstall packages that belong to the add-on image.

  3. Temporarily disable Watchdog while diagnosing the loop

    Repeated restarts can erase the context you need to read. Open Settings → Add-ons → Woow HA Pi Agent → Info and turn off Watchdog, in the same area as Show in sidebar. The failed process will then remain stopped, giving you time to inspect the log. Turn Watchdog back on when diagnosis is complete.

  4. If the cause remains unknown, reinstall the add-on

    On the add-on’s Info tab, select Uninstall, then install it again from the store. User data under /data/pi-agent/—including Sessions, Skills, and models.json—is separate from the image replacement. After reinstallation, video-tools-init may run again; allow 3-8 minutes and verify your backup before relying on this recovery step.

Warning: Always re-enable Watchdog after debugging. If it remains disabled, an actual hang will no longer trigger automatic recovery. Watchdog is an important v0.10.0 protection, not a setting to leave off during normal operation.

How to read the add-on logs

The add-on’s Logs tab is the starting point for diagnosing roughly 90% of problems. It can look overwhelming at first, but these techniques make it manageable.

  1. Open the Logs tab

    Go to Settings → Add-ons → Woow HA Pi Agent and select Log from the tabs at the top. The lower part of the page displays the log and normally scrolls to the newest entry.

  2. Begin with the final 30 lines

    A log can contain thousands of lines. Start with the final few dozen lines around the failed action, then work backward if the error refers to an earlier initialization step. Capturing the last 30 lines is often enough for an initial report.

  3. Search for these keywords

    Use Ctrl+F in the browser. A matching line may identify the failing component:

    KeywordWhat it usually indicates
    Error / ERRORA general error; read the entire matching message and nearby lines
    Failed / failedA failed step, usually followed by a reason
    fatalA fatal condition that can terminate the add-on process
    denied / PermissionA file or directory permission problem, possibly involving chmod or SELinux
    timeoutA network timeout while contacting a provider or other upstream service
    401 / 402 / 404An HTTP status corresponding to the earlier sections of this chapter
    ENOENTA missing file or command, often caused by an incorrect path or incomplete installation
    EADDRINUSEA port is already in use, often because an earlier process has not exited
  4. Enable debug logging only when you need more detail

    On the Configuration tab, change log_level from info to debug, save, then select Restart on the Info tab. Debug output can grow rapidly—potentially thousands of lines per minute—so reproduce the problem once and return the level to info. Do not allow /var/log to fill unnecessarily.

Tip: After enabling debug logging, reproduce the problem once—for example, send the request that returns 401. The resulting entries provide more context about that attempt. Debug logs may also contain request metadata or sensitive values, so redact them before sharing anything.
Pi Agent add-on Logs tab showing startup and pi-web output
Figure 22-1 The add-on’s Logs tab interleaves bashio startup messages with pi-web output. Begin with the bottom 30 lines when troubleshooting the latest event.

How to ask for help effectively

If the checks in this chapter do not resolve the problem, open a GitHub issue. A complete, focused report is much easier for maintainers and other users to diagnose than a message that only says “it is broken.”

  1. Open an issue in the correct repository

    https://github.com/WOOWTECH/Woow_ha_pi_agent_add_on/issues

    Search the issue list first using terms such as “401,” “video-tools,” or “blank iframe.” Someone may already have reported the same symptom, in which case the existing discussion may contain the solution.

  2. Include all required diagnostic information

    Without these details, someone will have to ask for them before diagnosis can begin:

    • Pi Agent version from the top of the add-on’s Info tab, such as 0.13.1
    • Home Assistant version from Settings → About or the system information page
    • The final 30 relevant lines from the Logs tab, enclosed in three backticks so GitHub formats them as a code block
    • Everything you have already tried, such as “restarted, replaced the key, and Test succeeds, but sending a message still returns 401”
  3. Never post secrets or private data

    Issues are public and visible to everyone. Never include any of the following:

    • An API key. If you publish one, treat it as compromised and replace it immediately.
    • Your external home address, including a Nabu Casa URL, DuckDNS URL, or public IP address
    • Personal information such as names, addresses, or telephone numbers
    • A complete Session file, which may contain your private conversation with the AI

    Read every log line before posting it and replace sensitive values with <REDACTED>.

  4. Write in English when you can

    The maintainers can read Chinese, but an English report can also be understood by users around the world who may be able to help. Chinese is acceptable if you are not comfortable writing in English; diagnostic detail matters more than perfect wording.

Danger: Inspect logs before publishing them. Some errors may include request headers and expose a key on an Authorization line. Replace the value with Bearer <REDACTED>. If a real key is ever published, revoke it immediately in the provider dashboard and create a replacement.

Other common symptoms: quick reference

The previous sections cover roughly 90% of common problems. Use these shorter checks for less common cases:

  1. The entire pi-web page is unreachable—not a 404, but no page at all

    Open the Home Assistant home page in another browser tab. If that also fails, Home Assistant itself is unavailable; restore Home Assistant before investigating Pi Agent. If Home Assistant works and only Pi Agent is unreachable, use the 404 section to check the add-on and Ingress layers.

  2. The page opens but remains blank or gray

    Select F12 to open browser developer tools, then inspect the Console for errors. Failed to load /_next/... can indicate an Ingress asset-routing problem; restart the add-on once. ChunkLoadError can indicate stale browser cache; use Ctrl+Shift+R for a hard refresh.

  3. A message cannot be sent because Send is disabled

    The model selector probably has no active selection. Open it and choose a configured provider and model. Send should then become available. This is especially common immediately after creating a Session.

  4. Everything appears normal, but the Logs tab is empty

    The log_level may be too restrictive. The default info level records important events, while error records only errors. Use info for normal operation or debug temporarily when tracing a specific problem.

  5. A Session closes immediately and returns to the home page

    The Session file may have been removed or damaged. Under /data/pi-agent/sessions/, each .jsonl file contains a conversation; invalid content can prevent pi-web from loading it. Follow the restoration procedure in Chapter 20 to recover the Sessions directory from a Home Assistant backup.

  6. Pi Agent seems slower after an update

    As Chapter 21 explains, the first startup after an update may run the video-tools-init check, and pi-web may rebuild its .next cache. A slower first startup can be normal; later startups should return to their usual speed. If the slowdown persists for two or three consecutive starts, inspect the logs and system resources.

Frequently asked questions

What if this chapter does not describe my symptom?
Run the three quick self-checks again. If they all pass: (1) inspect the final 30 log lines around the failure and compare the message with the sections above; (2) search GitHub Issues for the exact error or component name; and (3) open a new issue with the 4 items listed under How to ask for help effectively.
How long does a reply to a GitHub issue take?
This is a community open-source project with no SLA or guaranteed response time. A reply may take hours, weeks, or may not arrive. Reports that say only “broken” are difficult to diagnose. Include the complete diagnostic information from the asking for help section. For an urgent problem, use this guide, GitHub Discussions, and the wider Home Assistant community rather than waiting for an issue response.
Is paid support available for an urgent problem?
There is currently no formal paid-support plan. Woow HA Pi Agent is a community open-source Home Assistant add-on, not a commercial support service. For urgent help, (1) follow the symptom-based checks in this chapter and (2) ask in GitHub Discussions, the official Home Assistant forum, or another Home Assistant community. Availability and response times are not guaranteed.
How can I contribute a correction or a better solution?
Contributions to Chapter 22 are welcome. Choose one of three routes: (1) Pull request—the tutorial files are in the Woow_ha_pi_agent_tutorial repository; edit ch22_troubleshoot.html and submit a PR. (2) Issue—if you do not use Git, open an issue that identifies the section and proposed correction. (3) GitHub Discussion—use a discussion for a technique that may need community review before it becomes part of the guide. Documentation improves through specific, verifiable feedback.
What should I check before updating the add-on?
Return to Chapter 21 for the full upgrade procedure. In brief: (1) create a Home Assistant backup before the update; (2) read CHANGELOG.md, especially any BREAKING notice—v0.13.0, for example, moved API keys from add-on settings to the pi-web Models panel, requiring them to be entered again; and (3) consider waiting two or three days before a larger update such as 0.10 → 0.11 so early reports can surface.
Every conversation returns 401 after upgrading to v0.13. Is Pi Agent broken?
No; this is a breaking configuration change. In v0.13.0, API key management moved from the add-on’s Configuration tab to the Models panel in pi-web. The old fields disappeared and the keys were not migrated automatically, so requests can return 401 until the credentials are entered again. Open Pi Agent → Models, enter the key for each provider, and confirm that Test succeeds. The CHANGELOG documents the v0.13.0 change.
How can I verify the video tools before running the workflow?
Install the SSH & Web Terminal add-on. The container name differs between installations, so do not run docker exec -it <discovered-container-name> bash literally. Chapter 19 explains container discovery. A name may resemble addon_a1b2c3d4_woow_ha_pi_agent; first run docker ps | grep pi_agent and use the exact result. Inside the container, run which python3, which ffmpeg, which rclone, and which chromium. Each should return a path such as /data/pi-agent/venv/bin/python3 or /usr/bin/ffmpeg. A not found result for Python or Chromium means video-tools-init is incomplete. See the video workflow section and use reset_video_tools to rebuild the downloaded tools. If ffmpeg or rclone is missing, reinstall or update the add-on image.
Why do image uploads fail on a tablet or phone but work on a PC?
Version 0.13.1 fixed a common 413 Request Entity Too Large failure. Earlier nginx configuration limited the request body to 1 MB, while phone photos are often 3-5 MB. In 0.13.1, the request limit became 100 MB, with a 25 MB limit per file. Upgrade if the add-on is older than v0.13.1. If the problem continues on v0.13.1 or later, check whether the individual image exceeds 25 MB and resize it before uploading.
Will an update remove my Skills, Sessions, or settings?
No—normal add-on updates should preserve them. User data such as Sessions, Skills, models.json, and rclone.conf lives under /data/pi-agent/, the add-on’s persistent storage, while an update replaces the image. Regenerable components such as venv and playwright-cache may be excluded from backups and rebuilt when required, so do not describe every item under /data as backed up. Before v0.10.0, Pi’s worktree lived in the container root filesystem and could be lost during an update; v0.10.0 set HOME=/data/pi-agent/home to make that state persistent. Keep a current Home Assistant backup before upgrading.