Skip to content

Desktop: Repeated 'Path outside media roots' 403 errors in hermes:api handler #43630

Closed as not planned

Description

@BigDon86

Bug Report: Repeated "Path outside media roots" 403 Errors in hermes:api Handler

Date: 2026-06-10
Reporter: BigDon86 (from PowerShell launch logs)
Severity: Medium-High (recurring errors on every image-related action in Desktop)
Component: Hermes Desktop (Electron) + Backend API
Version: 0.16.0 (commit 2f510ca)

Summary

When launching Hermes Desktop from PowerShell, repeated errors appear in the console:

Error occurred in handler for 'hermes:api': Error: 403: {"detail":"Path outside media roots"}
    at IncomingMessage.<anonymous> (.../electron/main.cjs:2374:20)

This happens multiple times during normal operation (especially when dealing with images/attachments).

Steps to Reproduce

  1. Start Hermes Desktop from PowerShell using hermes desktop
  2. Use the chat interface (particularly any action involving images, pasting, or file attachments)
  3. Observe repeated hermes:api 403 errors in the terminal

Expected Behavior

Desktop should successfully communicate with the backend for media operations without 403 "Path outside media roots" errors. The image.attach_bytes or media upload path should be properly authorized and within configured media roots.

Actual Behavior

The Electron main process (main.cjs) receives 403 responses when calling the backend via hermes:api for paths that the server considers outside allowed media roots.

Evidence (Console Output)

[hermes] remote display detected (rdp (SESSIONNAME=RDP-Tcp#0)); disabling GPU hardware acceleration to prevent flicker
[hermes] install stamp: 2f510ca8e07b (main) from local
(node:29956) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
Error occurred in handler for 'hermes:api': Error: 403: {"detail":"Path outside media roots"}
    at IncomingMessage.<anonymous> (C:\Users\Don\AppData\Local\hermes\hermes-agent\apps\desktop\release\win-unpacked\resources\app.asar\electron\main.cjs:2374:20)
... (repeated 4+ times)

Note: Username in path is Don (Windows profile: C:\Users\Don).

Environment

  • OS: Windows (running via PowerShell)
  • Hermes Desktop: 0.16.0 (win-unpacked)
  • Backend: WSL (Ubuntu)
  • Session: RDP session detected (RDP-Tcp#0)
  • Related previous report: Desktop_Image_Paste_Media_Roots_Error_20260608.md

Impact

  • Console spam with errors
  • Potential breakage of image pasting, attachment handling, and media features in the Desktop app
  • Matches known pattern documented in hermes-desktop-bug-reporting skill

Suggested Investigation

  • Check how the desktop constructs paths for image.attach_bytes / media uploads
  • Verify media root configuration on the backend side
  • Ensure the desktop is sending paths relative to allowed roots (not absolute Windows paths)
  • Reference the existing Desktop_Image_Paste_Media_Roots_Error_20260608.md report

Status: New occurrence captured from launch logs. Related to previously reported image paste media roots issue.

Activity

  1. BigDon86 commented on Jun 10, 2026

    @BigDon86
    Author

    Additional observation:

    When submitting the GitHub issue from within Hermes Desktop, the same 403 error fires, along with these URL loading failures:

    This indicates the bug impacts URL construction/passing (likely in the hermes:api handler or shell.openExternal) in addition to media paths.

    See updated report in vault for full details.

  2. added
    type/bugSomething isn't working
    comp/gatewayGateway runner, session dispatch, delivery
    P3Low — cosmetic, nice to have
    duplicateThis issue or pull request already exists
    on Jun 10, 2026
  3. alt-glitch commented on Jun 10, 2026

    @alt-glitch

    Duplicate of #42363 — same 403 "Path outside media roots" error in the Electron hermes:api handler at main.cjs:2374, same media-upload/image path, reported by the same user. #42363 is the canonical open report tracking this Desktop media-root authorization bug.

  4. teknium1 commented on Jul 14, 2026

    @teknium1
    Collaborator

    Thanks for the report. This is implemented on current main; automated hermes-sweeper review verified the same remote Desktop media path tracked by canonical duplicate #42363.

    • apps/desktop/src/app/session/hooks/use-prompt-actions/index.ts:81-104 reads Desktop-local image bytes and calls image.attach_bytes for a remote gateway instead of handing it the client-local path.
    • tui_gateway/server.py:9576-9634 stages those bytes in the gateway's own image directory and queues the resulting gateway-local path.
    • apps/desktop/src/lib/chat-runtime.ts:183-204 prevents the optimistic preview from requesting a client-local image through /api/media, explicitly avoiding the reported Path outside media roots 403.
    • Regression coverage is present at tests/test_tui_gateway_server.py:8028-8053.
    • The implementation is 16786f3bb392885cf1b9d5910b7fdcdb5fd5a8a5, included in v2026.6.19 (Hermes Agent v0.17.0).

    The additional external-URL observation does not include a focused reproduction and is separate from this resolved media-root path; please report it separately if it persists on a current release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliveryduplicateThis issue or pull request already existssweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions