hyperledger/fabric · error

failed obtaining channel application writers policy

Error message

failed obtaining channel application writers policy

What it means

The channel's policy manager exists but could not return the Application writers policy that ChannelVerifier is configured with (cv.Policy, defaulting to the channel's /Channel/Application/Writers path). Evaluating the signed data requires this policy; if GetPolicy returns nil the request cannot be authorized.

Source

Thrown at discovery/support/acl/support.go:138

// ChannelVerifier verifies a signature and a message on the context of a channel
type ChannelVerifier struct {
	policies.ChannelPolicyManagerGetter
	Policy string
}

// VerifyByChannel checks that signature is a valid signature of message
// under a peer's verification key, but also in the context of a specific channel.
// If the verification succeeded, Verify returns nil meaning no error occurred.
// If peerIdentity is nil, then the verification fails.
func (cv *ChannelVerifier) VerifyByChannel(channel string, sd *protoutil.SignedData) error {
	mgr := cv.Manager(channel)
	if mgr == nil {
		return errors.Errorf("policy manager for channel %s doesn't exist", channel)
	}
	pol, _ := mgr.GetPolicy(cv.Policy)
	if pol == nil {
		return errors.New("failed obtaining channel application writers policy")
	}
	return pol.EvaluateSignedData([]*protoutil.SignedData{sd})
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Ensure the channel config defines the standard Application policies (Readers/Writers/Admins) via configtxgen
  2. Verify the ChannelVerifier's Policy field matches an actual policy path in the channel config
  3. Regenerate and update channel config from the default configtx.yaml template
Defensive patterns

Strategy: fallback

Validate before calling

// verify channel config includes Application policies
// e.g. inspect configtx.yaml / fetched channel config for /Channel/Application/Writers

Try / catch

res, err := client.Send(ctx, req)
if err != nil {
    if strings.Contains(err.Error(), "failed obtaining channel application writers policy") {
        // fall back to non-channel-scoped discovery or re-verify config
    }
    return err
}

Prevention

When it happens

Trigger: mgr.GetPolicy(cv.Policy) returns nil because the channel config lacks an Application/Writers policy (non-standard channel config) or the verifier's configured policy string doesn't exist in the channel's policy tree.

Common situations: Channels created with a modified configtx.yaml that renames or omits the Application.Writers policy; custom discovery deployments configuring a different policy path that doesn't exist on the channel.

Related errors


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/21a38643054a3873. Report an issue: GitHub.