Renku.api working depends on where script is run

Dear all,

in ADORE, there are 3 scripts with renku.api code. Here only the relevant snippets from the first script:

# import
from renku.api import Output

# output
df_t.to_csv(Output("ecotox_tests", path_to_file), index=False)

When running the first script in VSCode in the Python interactive window, it works.
When I activate the same conda-env from the terminal and run python scripts/01_preprocessing_rawdata.py, there is the following error:

Traceback (most recent call last):
  File "<local-path>/SDSC/Projects/04_MLTox/05_repositories/adore/scripts/01_preprocessing_rawdata.py", line 321, in <module>
    df_t.to_csv(Output("ecotox_tests", path_root + "data/processed/before_aggregation/ecotox_tests.csv"), index=False)
  File "<local-path>/SDSC/Projects/04_MLTox/05_repositories/adore/conda-env/lib/python3.9/site-packages/renku/ui/api/models/parameter.py", line 211, in __init__
    _PathBase.__init__(self, name=name, path=path, skip_addition=skip_addition)
  File "<local-path>/SDSC/Projects/04_MLTox/05_repositories/adore/conda-env/lib/python3.9/site-packages/renku/ui/api/util.py", line 54, in wrapper
    return fn(*args, **kwargs, project=project)
  File "<local-path>/SDSC/Projects/04_MLTox/05_repositories/adore/conda-env/lib/python3.9/site-packages/renku/ui/api/models/parameter.py", line 86, in __init__
    add_to_files_list(indirect_list_path, name, self._path)
  File "<local-path>/SDSC/Projects/04_MLTox/05_repositories/adore/conda-env/lib/python3.9/site-packages/renku/core/workflow/plan_factory.py", line 750, in add_to_files_list
    raise errors.ParameterError(f"Duplicate input/output name found: {name}")
renku.core.errors.ParameterError: Invalid parameter value - Duplicate input/output name found: ecotox_tests

renku version 2.4.1 is used. Any idea what is causing this?

Thanks for your support!
Best, Lili

the renku api writes inputs/outputs to .renku/tmp/inputs.yml and .renku/tmp/outputs.yml. when running through the renku CLI, these files are cleaned up after the run, but when running directly, they are currently not (though thy should be).

We use these files to check that you don’t have e.g. the same output defined twice but with different paths. So my guess is that you ran the script, changed the path, ran it again but since the file is still left over, it now complains about a path conflict. removing the .renku/tmp/ directory should fix this.

Hi Ralf, yes, this solved the problem. And I have indeed changed the path of repository. Thanks!