google/tsunami-security-scanner · error · ParameterException

Number of plugin server paths must be equal to number of…

Error message

Number of plugin server paths must be equal to number of plugin server ports. Paths: %s. Ports: %s.

What it means

Each plugin server filename is paired positionally with a port, so validate() requires pluginServerFilenames.size() == pluginServerPorts.size(). A count mismatch means the pairing is ambiguous and throws this ParameterException.

Solutions

  1. Provide the same number of --plugin-server-filename and --plugin-server-port values, in matching order.
  2. Count the flag occurrences in your launch script/config and align them.
  3. If adding a server, add both its path and port together.

Example fix

// before
--plugin-server-filename=a.py --plugin-server-filename=b.py --plugin-server-port=8080
// after
--plugin-server-filename=a.py --plugin-server-filename=b.py --plugin-server-port=8080 --plugin-server-port=8081
Defensive patterns

Strategy: validation

Validate before calling

if (filenames.size() != ports.size()) { throw new IllegalStateException("path/port count mismatch"); }

Try / catch

try { options.validate(); } catch (ParameterException e) { log.error("Pairing mismatch: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Running Tsunami with e.g. two --plugin-server-filename values but one --plugin-server-port value, or forgetting one flag of the pair entirely.

Common situations: Adding a new language plugin server and updating only one of the two flags, or commented-out lines in generated configs that remove one entry but not the other.

Understand the failure class

Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.

Related errors


AI-assisted analysis of google/tsunami-security-scanner@363ba87b35 (2026-09-13). Data as JSON: /api/errors/7ee4eeaef7b096fb. Report an issue: GitHub.

Appendix: source

Thrown at main/src/main/java/com/google/tsunami/main/cli/LanguageServerOptions.java:98

            int port = Integer.parseInt(pluginServerPort);
            if (!(port <= NetworkEndpointUtils.MAX_PORT_NUMBER && port > 0)) {
              throw new ParameterException(
                  String.format(
                      "Port out of range. Expected [0, %s], actual %s.",
                      NetworkEndpointUtils.MAX_PORT_NUMBER, pluginServerPort));
            }
          } catch (NumberFormatException e) {
            throw new ParameterException(
                String.format("Port number must be an integer. Got %s instead.", pluginServerPort),
                e);
          }
        }
      }

      var pathCounts = pluginServerFilenames == null ? 0 : pluginServerFilenames.size();
      var portCounts = pluginServerPorts == null ? 0 : pluginServerPorts.size();
      if (pathCounts != portCounts) {
        throw new ParameterException(
            String.format(
                "Number of plugin server paths must be equal to number of plugin server ports."
                    + " Paths: %s. Ports: %s.",
                pathCounts, portCounts));
      }

      if (!pluginServerRpcDeadlineSeconds.isEmpty()) {
        if (pluginServerRpcDeadlineSeconds.size() != pathCounts) {
          throw new ParameterException(
              String.format(
                  "Number of plugin server rpc deadlines must be equal to number of plugin server"
                      + " ports. Paths: %s. Ports: %s. Deadlines: %s",
                  pathCounts, portCounts, pluginServerRpcDeadlineSeconds.size()));
        }
      }
    }

    if (!remotePluginServerAddress.isEmpty()) {

View on GitHub (pinned to 363ba87b35)