google/tsunami-security-scanner · error · ValueError
Parse payload does not have a name.
Error message
Parse payload does not have a name.
What it means
payload_utility._validate_payloads runs sanity checks on each pre-loaded PayloadDefinition. Every payload must have its proto 'name' field set; payloads lacking a name raise ValueError so that bad payload definitions fail fast at load time instead of producing unusable entries in the generator.
Solutions
- Add/restore the name field to the offending PayloadDefinition in the payload resource file
- The error does not include the payload, so iterate payloads and log each HasField('name') result to find the bad one
- If building payloads in code, set name before calling get_parsed_payload
- Validate payload resource files after editing them (load them once in a test)
Example fix
// before payloads = [pg.PayloadDefinition(interpretation_environment=..., execution_environment=...)] // after p = pg.PayloadDefinition(interpretation_environment=..., execution_environment=...) p.name = 'rce-callback' payloads = [p]
Defensive patterns
Strategy: validation
Validate before calling
def validate_names(payloads):
for i, p in enumerate(payloads):
if not p.HasField('name'):
raise ValueError(f'payload[{i}] is missing a name')
return payloads Try / catch
try:
payloads = payload_utility.get_parsed_payload(raw_payloads)
except ValueError as e:
logging.error('Invalid payload definition: %s', e)
payloads = [] Prevention
- Always set the proto name field when authoring PayloadDefinitions
- Add a CI test that loads every payload resource through get_parsed_payload
- Log payload indices/names when validating batches so bad entries are findable
When it happens
Trigger: get_parsed_payload(payloads) is called with a PayloadDefinition message whose name field is unset (proto default), e.g. a hand-written payload entry, a partially filled template, or a proto parsed from a resource missing the name field.
Common situations: Authors adding new payloads to the payload text/proto resources forgetting the name line; code constructing PayloadDefinition programmatically without setting name; merge conflicts dropping the name field.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Parse payload does not have an interpretation environment.
- No payload implemented for
- Validation type not supported.
- No valid payload input is entered.
- Invalid network service
AI-assisted analysis of google/tsunami-security-scanner@363ba87b35 (2026-09-13).
Data as JSON: /api/errors/2d15b24878130c03.
Report an issue: GitHub.
Appendix: source
Thrown at plugin_server/py/plugin/payload/payload_utility.py:53
- Payload that does not uses callback but has no specified validation
type.
- Payload that uses validation regex but does not specify the regex to
be used.
"""
payload_str = Path(_PATH).read_text()
yaml_parser = yaml.YAML(typ='safe', pure=True)
payload_dict = yaml_parser.load(payload_str)
payload_library = json_format.ParseDict(payload_dict, pg.PayloadLibrary())
return _validate_payloads([p for p in payload_library.payloads])
def _validate_payloads(
payloads: list[pg.PayloadDefinition],
) -> list[pg.PayloadDefinition]:
"""Validate the pre-loaded payloads."""
for payload in payloads:
if not payload.HasField('name'):
raise ValueError('Parse payload does not have a name.')
if (
payload.interpretation_environment
is pg.PayloadGeneratorConfig.InterpretationEnvironment.INTERPRETATION_ENVIRONMENT_UNSPECIFIED
):
raise ValueError(
'Parse payload does not have an interpretation environment.'
)
if (
payload.execution_environment
is pg.PayloadGeneratorConfig.ExecutionEnvironment.EXECUTION_ENVIRONMENT_UNSPECIFIED
):
raise ValueError('Parse payload does not have an execution environment.')
if (
pg.PayloadGeneratorConfig.VulnerabilityType.VULNERABILITY_TYPE_UNSPECIFIED
in payload.vulnerability_type
):
raise ValueError('Parse payload does not have a vulnerability type.')
if not payload.HasField('payload_string'):View on GitHub (pinned to 363ba87b35)