Classification: Bug
NOT a duplicate of #22019. The two issues have completely different stack traces and affect different subsystems:
- #22019:
histories.py→get_record_metadata()— export metadata stored as string instead of dict - #22132:
tools/parameters/wrapped.py→process_key()— tool parameter flattening/nesting
The process_key() function in lib/galaxy/tools/parameters/wrapped.py (line 203) converts flat pipe-delimited tool parameters into nested dicts. On line 191, it stores scalar values (d[incoming_key] = incoming_value). On line 203, it assumes d.get(input_name, {}) will return a dict, but if a previous iteration already stored a string at that key, the .get() returns the string, and the recursive call on line 205 then crashes trying to call .get() on that string.
This only affects the input_format == legacy path (flat parameter encoding), so it is likely triggered by specific tool parameter structures submitted through the older API format — possibly a conditional or section where the flat key ordering creates a conflict between a scalar value and a nested key sharing the same prefix.
Add a type guard in process_key at line 203: if d.get(input_name) returns a non-dict value, replace it with a fresh {} (or wrap the existing value) before recursing. Small, isolated fix in lib/galaxy/tools/parameters/wrapped.py. Worth checking what specific tool/parameters triggered this on the production instance (via Sentry) to understand if there is a broader issue with how certain tool inputs get flattened.
Small