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

Scheduler crashes with TypeError #1389

Closed
victorlin opened this issue Feb 10, 2022 · 2 comments · Fixed by #1556
Closed

Scheduler crashes with TypeError #1389

victorlin opened this issue Feb 10, 2022 · 2 comments · Fixed by #1556
Labels
bug Something isn't working

Comments

@victorlin
Copy link

victorlin commented Feb 10, 2022

Snakemake version

Version 6.15.3 (latest available on bioconda)

Describe the bug

A specific workflow crashes with a TypeError stemming from the scheduler and its usage of pulp.lpSum.

  • Running the workflow again picking up from where it left off, it will complete an additional step then fail with the same error.
  • If I delete target files and start from scratch, it deterministically crashes at the same step.

Logs

[Tue Feb  8 20:19:42 2022]
Finished job 5.
16 of 32 steps (50%) done
Select jobs to execute...
Traceback (most recent call last):
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/snakemake/__init__.py", line 785, in snakemake
    keepmetadata=keep_metadata,
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/snakemake/workflow.py", line 1077, in execute
    success = self.scheduler.schedule()
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/snakemake/scheduler.py", line 491, in schedule
    run = self.job_selector(needrun)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/snakemake/scheduler.py", line 740, in job_selector_ilp
    for job in jobs
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/pulp/pulp.py", line 2281, in lpSum
    return LpAffineExpression().addInPlace(vector)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/pulp/pulp.py", line 897, in addInPlace
    self.addInPlace(e)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/conda-env-name/lib/python3.7/site-packages/pulp/pulp.py", line 889, in addInPlace
    self.constant += other.constant
TypeError: unsupported operand type(s) for +=: 'int' and 'str'

Looks like something here is mixing int and str:

lpSum(
[
scheduled_jobs[job] * job.resources.get(name, 0)
for job in jobs
]
)

Minimal example

Unfortunately, I am only able to reproduce this with a private workflow. However, see additional context below.

Additional context

The same workflow runs successfully with Snakemake versions 5.x.

I spot-checked several versions of Snakemake, and determined that the bug was introduced somewhere between 6.4.1 (runs fine) and 6.5.3 (crashes). I am unable to run this workflow on 6.5.0-6.5.2 due to #1069 which was fixed in 6.5.3. Could this be related?

Here's the diff between 6.4.1 and 6.5.3, in case it's handy: v6.4.1...v6.5.3

@johanneskoester
Copy link
Contributor

Good catch. A part of the fixed has been done in #1552. The other part comes in #1556.

@johanneskoester
Copy link
Contributor

Thanks for reporting!

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

Successfully merging a pull request may close this issue.

2 participants