linera-io/linera-protocol · critical · anyhow
network protocol mismatch: cannot have {internal_protocol} a
Error message
network protocol mismatch: cannot have {internal_protocol} and {external_protocol} What it means
Raised in `Proxy::from_context` (linera-service proxy) at startup when the validator configuration mixes protocol families: `config.internal_network.protocol` and `config.validator.network.protocol` must both be `Grpc` or both be `Simple`. Any mixed combination (Grpc internal + Simple external, or Simple internal + Grpc/TLS external) hits the catch-all `bail!` and the proxy process refuses to start. The proxy cannot translate between the gRPC and Simple (TCP/UDP) network stacks, so the configuration is rejected rather than partially run.
Source
Thrown at linera-service/src/proxy/main.rs:214
(
NetworkProtocol::Simple(internal_transport),
NetworkProtocol::Simple(public_transport),
) => Self::Simple(Box::new(SimpleProxy {
internal_config: context
.config
.internal_network
.clone_with_protocol(internal_transport),
public_config: context
.config
.validator
.network
.clone_with_protocol(public_transport),
send_timeout: context.send_timeout,
recv_timeout: context.recv_timeout,
storage,
id: context.id,
})),
_ => bail!("network protocol mismatch: cannot have {internal_protocol} and {external_protocol} "),
};
Ok(proxy)
}
}
#[derive(Debug, Clone)]
pub struct SimpleProxy<S>
where
S: Storage + Clone + Send + Sync + 'static,
{
public_config: ValidatorPublicNetworkPreConfig<TransportProtocol>,
internal_config: ValidatorInternalNetworkPreConfig<TransportProtocol>,
send_timeout: Duration,
recv_timeout: Duration,
storage: S,
id: usize,
}View on GitHub (pinned to 6c226ddcb3)
Solutions
- Edit the validator config so both `internal_network.protocol` and `validator.network.protocol` use the same family (both `grpc` or both `simple`)
- Regenerate the whole config with `linera configgen` (or the config-generation command used originally) instead of hand-editing one section
- Diff the config against a known-good config from the same linera version
- Verify each shard's config in a multi-shard setup — one mismatched shard fails the proxy startup
Example fix
# before (config.toml)
[internal_network]
protocol = { type = "grpc", tls = "cleartext" }
[validator.network]
protocol = { type = "simple", transport = "tcp" }
# after
[internal_network]
protocol = { type = "grpc", tls = "cleartext" }
[validator.network]
protocol = { type = "grpc", tls = "cleartext" } Defensive patterns
Strategy: validation
Validate before calling
// Rust: validate the proxy config before constructing/running the proxy
use linera_base::network::NetworkProtocol;
fn protocols_same_family(internal: &NetworkProtocol, external: &NetworkProtocol) -> bool {
matches!((internal, external),
(NetworkProtocol::Grpc { .. }, NetworkProtocol::Grpc(_))
| (NetworkProtocol::Simple(_), NetworkProtocol::Simple(_)))
}
anyhow::ensure!(
protocols_same_family(&config.internal_network.protocol, &config.validator.network.protocol),
"internal and external protocols must both be grpc or both be simple"
); Prevention
- Never edit only one of internal_network/validator.network — change both together
- Generate validator configs with linera-configgen rather than hand-editing
- Add a config lint step in deployment scripts that asserts both protocol families match
- Keep per-shard configs in sync; a single mismatched shard aborts the proxy
When it happens
Trigger: Running `linera proxy` with a config where `internal_network.protocol` is set to `grpc` while `validator.network.protocol` remains `simple` (or the reverse); hand-editing a generated validator config to change only one side; mixing config fragments produced by different linera-configgen versions.
Common situations: Migrating a validator deployment from Simple to gRPC networking and editing only the internal section; manually assembling config.toml for a proxy shard; copy-pasting network sections between validator configs with different generations.
Related errors
- TLS not supported between proxy and shards.
- Error serving metrics: {e}
- Only allowed options are grpc and grpcs
- Failed to obtain a port
- Only supported scheme are http and https
AI-assisted analysis of linera-io/linera-protocol@6c226ddcb3 (2026-08-22).
Data as JSON: /api/errors/7fed2cd55b5aa3e5.
Report an issue: GitHub.