Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Run Crash When Passing a Dictionary-Like String to ScriptRunner.script_args #3229

Open
avelinoapheris opened this issue Feb 14, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@avelinoapheris
Copy link

Describe the bug
When using ScriptRunner to generate the client portion of a job, passing a string with curly brackets ({}) to script_args causes a crash. For example, if a parameter is a JSON-compatible string like "--param1={'A':1, 'B':2}" and job.simulator_run() is called, the execution fails at this line.

It appears that NVFlare interprets curly brackets as placeholders for variable substitution, even when the string should be passed as-is.

To Reproduce
A quick and dirty way to reproduce the issue is by modifying one of the example scripts, such as hello-pt.

Set script_args to a string containing curly brackets, e.g., "--data_path {}".
Run the job.

Expected behavior
The run should crash. One of the lines on the log.txt should be an error message similar to:

nvflare.fuel.common.excepts.ConfigError: Error processing '/tmp/nvflare/jobs/workdir/site-2/simulate_job/app_site-2/config/config_fed_client.json' in element '"--data_path {}"': path: 'executors.#1.executor.args.task_script_args', exception: 'IndexError: Replacement index 0 out of range for positional args tuple'

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04, macOS
  • Python Version: 3.10.16
  • NVFlare Version: 2.5.2
@avelinoapheris avelinoapheris added the bug Something isn't working label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant