{"record":{"id":"f4d45e9d5e367dca","repo":"linera-io/linera-protocol","slug":"only-allowed-options-are-grpc-and-grpcs","errorCode":null,"errorMessage":"Only allowed options are grpc and grpcs","messagePattern":"Only allowed options are grpc and grpcs","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"linera-service/src/cli/net_up_utils.rs","lineNumber":142,"sourceCode":"        \"The local test network must have at least one validator.\"\n    );\n    assert!(\n        num_shards >= 1,\n        \"The local test network must have at least one shard per validator.\"\n    );\n\n    let shutdown_notifier = CancellationToken::new();\n    tokio::spawn(listen_for_shutdown_signals(shutdown_notifier.clone()));\n\n    let storage = StorageConfigProvider::new(storage).await?;\n    let storage_config = storage.inner_storage_config().clone();\n    let namespace = storage.namespace().to_string();\n    let database = storage.database()?;\n    let storage_config_builder = InnerStorageConfigBuilder::ExistingConfig { storage_config };\n    let external = match external_protocol.as_str() {\n        \"grpc\" => Network::Grpc,\n        \"grpcs\" => Network::Grpcs,\n        _ => panic!(\"Only allowed options are grpc and grpcs\"),\n    };\n    let internal = Network::Grpc;\n    let network = NetworkConfig { external, internal };\n    let path_provider = PathProvider::from_path_option(path)?;\n    let num_proxies = 1; // Local networks currently support exactly 1 proxy.\n    let block_exporters = ExportersSetup::new(\n        with_block_exporter,\n        block_exporter_address,\n        block_exporter_port,\n    );\n    let initial_amount = Amount::from_tokens(initial_amount);\n    let config = LocalNetConfig {\n        block_export_transport: crate::config::BlockExportTransport::Relay,\n        export_blocks_to_committee: false,\n        network,\n        database,\n        testing_prng_seed,\n        namespace,","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/cli/net_up_utils.rs#L124-L160","documentation":"handle_net_up_service maps the --external-protocol string to a Network value for the local test network's proxy. Only 'grpc' (plaintext gRPC) and 'grpcs' (TLS gRPC) are recognized; any other string panics with 'Only allowed options are grpc and grpcs'.","triggerScenarios":"Running `linera net up --external-protocol <value>` with anything other than grpc or grpcs — e.g. 'grpc-web', 'http', 'h2', a typo like 'grpcs ' with whitespace, or the wrong case ('Grpc').","commonSituations":"Scripts written for an older CLI that accepted other protocol names; copy-pasted commands from docs describing other deployments; shell variable expansion injecting unexpected values.","solutions":["Use exactly grpc or grpcs (lowercase, no surrounding whitespace)","If you want plain HTTP/JSON for a local test, that is not configurable here — use grpc and query via the GraphQL endpoint instead","Quote and validate variables in wrapper scripts before passing them to the CLI"],"exampleFix":"# before\nlinera net up --external-protocol http\n\n# after\nlinera net up --external-protocol grpc","handlingStrategy":"validation","validationCode":"const EXTERNAL_PROTOCOLS: [&str; 2] = [\"grpc\", \"grpcs\"];\nassert!(\n    EXTERNAL_PROTOCOLS.contains(&external_protocol),\n    \"--external-protocol must be one of {EXTERNAL_PROTOCOLS:?}\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize protocol choice in one script variable validated against the allowed set","Add shellcheck/CI assertions on CLI flag values for local-network scripts"],"tags":["cli","net-up","network","configuration","validation"],"backgroundTag":"invalid-configuration-value","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}