reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 46 forks source link

cannot start workflows with "duplicated" inputs.{directories,files} #626

Closed tiborsimko closed 1 year ago

tiborsimko commented 2 years ago

Consider the following change in reana-demo-helloworld analysis example:

$ git diff
diff --git a/reana.yaml b/reana.yaml
index 50d1bd8..d2edd7e 100644
--- a/reana.yaml
+++ b/reana.yaml
@@ -3,6 +3,8 @@ inputs:
   files:
     - code/helloworld.py
     - data/names.txt
+  directories:
+    - code
   parameters:
     helloworld: code/helloworld.py
     inputfile: data/names.txt

This change leads to impossibility to start the workflow:

$ reana-client run -w test
...
==> Starting workflow...
==> ERROR: Cannot start workflow test.1:
Invalid input paths: 'code' is a prefix of 'code/helloworld.py'

The error comes from server-side validation:

$ kubectl logs reana-server-664d5c4cfb-rkcvd rest-api
2022-08-19 09:21:58,115 | root | uWSGIWorker3Core0 | ERROR | Traceback (most recent call last):
  File "/code/./reana_server/rest/workflows.py", line 1239, in start_workflow
    validate_workflow(
  File "/code/./reana_server/validation.py", line 127, in validate_workflow
    validate_inputs(reana_yaml)
  File "/code/./reana_server/validation.py", line 105, in validate_inputs
    raise REANAValidationError(
reana_commons.errors.REANAValidationError: Invalid input paths: 'code' is a prefix of 'code/helloworld.py'

We should fix it.

Stemmed from https://forum.reana.io/t/snakemake-workflows-in-reana/60