AlexxIT/go2rtc · error

hap: unsupported path:

Error message

hap: unsupported path: 

What it means

The HomeKit server's request handler only supports a fixed set of known request URIs (e.g. accessory endpoints, image snapshots). Any request whose RequestURI does not match a supported path falls through and produces this error naming the unsupported path.

Solutions

  1. Log req.RequestURI at the handler entry to see exactly which path was requested
  2. Fix the client to request a supported endpoint path (the ones matched in server.go's handler)
  3. Check that query parameters (e.g. width/height for image requests) are present so the correct branch matches
  4. If a path should be supported, add a matching case in the handler in pkg/homekit/server.go

Example fix

// before (client request)
GET  HTTP/1.1            // empty URI -> 'unsupported path: '
// after
GET /image?width=1280&height=720 HTTP/1.1
Defensive patterns

Strategy: try-catch

Try / catch

resp, err := doHAPRequest(path)
if err != nil {
    if strings.Contains(err.Error(), "unsupported path") {
        return fmt.Errorf("path %q is not a supported HAP endpoint; check docs for valid paths", path)
    }
    return err
}

Prevention

When it happens

Trigger: An HTTP request hits the hap server with a RequestURI not in the handler's supported list — e.g. missing query parameters so the image branch doesn't match, a typo'd path, or a scanner/client probing endpoints like /favicon.ico or / on the HAP port.

Common situations: Browsers or monitoring tools hitting the HomeKit port directly; an empty path (message shows trailing 'hap: unsupported path: ' with nothing after it, meaning RequestURI was empty); changed/renamed endpoints between library versions.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07). Data as JSON: /api/errors/c0dfe1bc6c6d7f1b. Report an issue: GitHub.

Appendix: source

Thrown at pkg/homekit/server.go:104

				}
				return res, nil
			}

		case hap.PathResource:
			var v struct {
				Width  int    `json:"image-width"`
				Height int    `json:"image-height"`
				Type   string `json:"resource-type"`
			}
			if err := json.NewDecoder(req.Body).Decode(&v); err != nil {
				return nil, err
			}

			body := server.GetImage(conn, v.Width, v.Height)
			return makeResponse("image/jpeg", body)
		}

		return nil, errors.New("hap: unsupported path: " + req.RequestURI)
	})
}

func handleRequest(handle func(conn net.Conn, req *http.Request) (*http.Response, error)) HandlerFunc {
	return func(conn net.Conn) error {
		rw := bufio.NewReaderSize(conn, 16*1024)
		wr := bufio.NewWriterSize(conn, 16*1024)
		for {
			req, err := http.ReadRequest(rw)
			//debug(req)
			if err != nil {
				return err
			}

			res, err := handle(conn, req)
			//debug(res)
			if err != nil {
				return err

View on GitHub (pinned to c245815e75)