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

Error in re-executing workflow files #3262

Closed
m-alisafaee opened this issue Jan 13, 2023 · 0 comments · Fixed by #3263
Closed

Error in re-executing workflow files #3262

m-alisafaee opened this issue Jan 13, 2023 · 0 comments · Fixed by #3263
Labels

Comments

@m-alisafaee
Copy link
Contributor

Describe the bug
If we run a workflow file partially and then run it again fully, we get a database error.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. Unzip and copy the attached workflow file to the project: workflow-file.yml.zip
  3. renku run workflow-file.yml head tail
  4. renku run workflow-file.yml
Executing step 'workflow-file.head': 'head -n10 Dockerfile > intermediate' ...
Executing step 'workflow-file.tail': 'tail -n5 intermediate > results/output.csv' ...
Executing step 'workflow-file.line-count': 'wc -l results/output.csv > results/output.csv.wc' ...
Ahhhhhhhh! You have found a bug. �

1. Open an issue by typing "open";
2. Print human-readable information by typing "print";
3. See the full traceback without submitting details (default: "ignore").

Please select an action by typing its name (open, print, ignore) [ignore]: 
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/renku", line 8, in <module>
    sys.exit(cli())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/exception_handler.py", line 141, in main
    self._handle_github()
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/exception_handler.py", line 173, in _handle_github
    getattr(self, "_process_" + value)()
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/exception_handler.py", line 133, in main
    return super().main(*args, **kwargs)
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/exception_handler.py", line 92, in main
    return super().main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/ui/cli/run.py", line 612, in run
    run_workflow_file_command(no_commit=no_commit, commit_only=commit_only)
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/command/command_builder/command.py", line 266, in execute
    hook(self, context, result, *args, **kwargs)
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/command/command_builder/database.py", line 112, in _post_hook
    project_context.pop_context()
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/domain_model/project_context.py", line 244, in pop_context
    self._top.database.commit()
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/database.py", line 454, in commit
    self._store_object(object)
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/database.py", line 461, in _store_object
    self._cache[object._p_oid] = object
  File "/Users/Mohammad/Documents/Workspace.noindex/sdsc/code/renku-python/renku/infrastructure/database.py", line 527, in __setitem__
    raise ValueError(f"The same oid exists: {existing_data} != {object}")
ValueError: The same oid exists: <WorkflowFilePlan 'workflow-file.line-count'> != <WorkflowFilePlan 'workflow-file.line-count'>

Additional context
Renku should reuse the existing WorkflowFilePlan but it creates a new instance with the same ID which causes this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
1 participant