Skip to content

Transfer service returns errors unwrapped #293

Description

@austinvazquez

Summary

Found during review of #287.

plugins/services/transfer/service.go:97 — the ttrpc Transfer handler returns errors raw (return nil, err) instead of wrapping them with errgrpc.ToGRPC, unlike every other ttrpc service in this repo. This means the errdefs.ErrPermissionDenied that #287 introduces for read-only mount/rootfs enforcement never survives the RPC boundary as a classifiable gRPC status.

Failure scenario

A client issues a copy-to against a read-only bind mount or read-only rootfs. containerFSTransferrer.Transfer correctly returns an error wrapping errdefs.ErrPermissionDenied, but ttrpc's dispatch (status.FromError(err)) only recovers a real code when the error implements GRPCStatus() — otherwise it degrades to codes.Unknown. Any client-side errdefs.IsPermissionDenied check after errgrpc.ToNative fails to classify the rejection, so the read-only-enforcement feature is unobservable through the actual RPC path and is only verified by in-process unit tests.

Suggested fix

Wrap the returned error in the ttrpc handler with errgrpc.ToGRPC (matching the pattern used by other ttrpc services in the repo) so errdefs-based error classification works for RPC clients, not just in-process callers.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions