Skip to main content

General

When working with Fusion, you might encounter the following issues.

Common issues​

Too many open files​

Tasks fail with an error about too many open files.

This issue occurs when the default file descriptor limit is too low for the container workload.

To resolve, increase the ulimit for the container. Append the following to your Nextflow configuration:

process.containerOptions = '--ulimit nofile=1048576:1048576'

Exit code 143 on Kubernetes​

When a task fails with exit code 143, pipelines halt instead of retrying the affected task.

Exit code 143 indicates the container received SIGTERM and shut down gracefully. On Kubernetes this most commonly signals Spot instance reclamation.

To retry tasks that exit with 143, configure an errorStrategy in your Nextflow configuration:

process {
maxRetries = 3
errorStrategy = { task.exitStatus == 143 ? 'retry' : 'terminate' }
}

See errorStrategy for more configuration options.

A task reads incomplete data written by a Studio session​

A task fails when it reads a Fusion-mounted path that a running Studio session wrote to. The files exist but are 0 bytes, or the directory appears empty.

This issue occurs because Fusion uploads data to object storage in chunks and consolidates those chunks into a complete object only when the Fusion instance that wrote them shuts down. For a Studio session, that happens when the session stops. Separate Fusion instances also do not share a live view of each other's in-progress writes.

To resolve, stop the Studio session and wait for its status to change to stopped before you launch the run. To avoid the problem, upload data for a pipeline with Data Explorer or the Seqera Platform CLI (tw) instead of writing it from a running session.

See Data written by a running session is not visible to pipeline runs for the Studios troubleshooting entry.

Jobs stay pending with CODE_GCE_QUOTA_EXCEEDED​

On Google Cloud Batch, jobs stay pending and Nextflow logs a Batch job cannot be run warning containing CODE_GCE_QUOTA_EXCEEDED.

This issue occurs when the local SSD capacity a run requests exceeds your Google Cloud quota, which is capped per project, per region, and per machine family.

To resolve, open IAM & Admin > Quotas & System Limits in the Google Cloud console, filter for Local SSD per machine family (GB) (LOCAL_SSD_TOTAL_GB_PER_VM_FAMILY), and submit a new value. To avoid the quota, request a persistent disk instead, which draws on a separate quota:

process {
disk = [request: 100.GB, type: 'pd-balanced']
}

See Scratch disk to choose a disk type.

Unrelated changing entry timestamp errors after a task failure​

After a task fails, the Fusion log contains one error-level entry for each .bai, .tbi, or .csi index file that the task created but did not upload:

{"level":"error","provider":"s3","error_code":"NotFound","provider_code":"NoSuchKey","provider_http_status":404,"path":".../recalibrate.bai","message":"changing entry timestamp - cannot create a copy"}

These entries are a side effect of the task failure, not its cause. At shutdown, Fusion updates the timestamp of each .bai, .tbi, and .csi index file in object storage so that the index file is newer than the data file it indexes. When a task fails before its output files finish uploading, the objects do not exist in object storage and each timestamp update fails. NoSuchKey is the S3 error code for an object that does not exist. Any task failure that occurs before index files upload produces these entries, and tasks that produce many index files can log thousands of them for a single failure.

These entries require no action. To find the cause of the task failure, check the task error output and logs for the error that stopped the task. Common causes include resource limits, out-of-memory errors, and file descriptor limits.

Part number must be an integer between 1 and 10000 on AWS S3​

A task that writes a very large file fails, and the task log contains Fusion errors similar to:

ERR [seqera-fusion] cannot upload part copy error="operation error S3: UploadPartCopy, https response error StatusCode: 400, ... api error InvalidArgument: Part number must be an integer between 1 and 10000, inclusive" ... id=/s3/<bucket>/<work-dir>/<file>.<id>.<offset>.<id>.chk

Fusion 2.5.13 and later, and 2.6.1 and later, check the part count before uploading and log this error instead:

ERR [seqera-fusion] compose exceeds the S3 multipart upload part limit ... limit=10000 parts=<count>

Fusion uploads each file it writes in chunks, and then joins the chunks into the final object with an S3 multipart upload, using one part per chunk. S3 allows at most 10,000 parts in a multipart upload, so the largest file Fusion can write to S3 is 10,000 times the chunk size. The default chunk size is 128 MiB, which makes the largest file 1.22 TiB. Upgrading Fusion does not raise this limit.

To write larger files, increase the chunk size with the FUSION_CHUNK_SIZE environment variable on the processes that write them:

process {
withName: 'MY_PROCESS' {
containerOptions = '--env FUSION_CHUNK_SIZE=512'
}
}
FUSION_CHUNK_SIZELargest file on S3
128 (default)1.22 TiB
2562.44 TiB
5124.88 TiB

If you don't know how large the file will get, 512 is a reasonable starting point for processes that write very large files. It raises the limit to 4.88 TiB at little cost. If a file still exceeds the limit, Fusion 2.5.13 and later, and 2.6.1 and later, log how many parts the file needed (parts=<count>). Set FUSION_CHUNK_SIZE to at least <count> x your current chunk size / 10,000.

Set it only on the processes that write very large files. Fusion transfers and caches whole chunks, so larger values increase the local disk each task needs and the data fetched for small reads. Values of several GiB can also cause reads to fail on busy instances. Values above 5120 do not raise the limit, because S3's largest part is 5 GiB and its largest object is 48.8 TiB.

When you set FUSION_CHUNK_SIZE:

  • Set the value as a whole number of MiB, such as 256. If the value includes a unit, such as 256M or 256MB, Fusion logs a parsing FUSION_CHUNK_SIZE error and uses the default of 128.
  • Set the variable with containerOptions. Fusion reads its configuration when the container starts, before variables set with the env directive or in the task script are applied.
  • Put the process scope at the top level of your Nextflow configuration. Inside another scope, such as aws, the setting does not apply to tasks.
  • Fusion versions earlier than 2.5.2 do not read FUSION_CHUNK_SIZE. These versions use FUSION_WRITE_SIZE, which defaults to 240 MiB, and later versions ignore it.

You can change the chunk size between runs, including when you resume a run with -resume.

The Nextflow aws.client.minimumPartSize and aws.client.multipartThreshold options control only the transfers that Nextflow performs itself, such as publishing files. They have no effect on files that tasks write through Fusion.

Incomplete multipart uploads on AWS S3​

S3 bills for more storage than the bucket's listed objects use.

This issue occurs when a task is cancelled or killed while Fusion writes a file. Fusion writes each file to S3 as a multipart upload. If the task stops first, the upload stays open. S3 does not list an open upload as an object, but bills for its uploaded parts until the upload is aborted.

To resolve, add a lifecycle rule that aborts incomplete multipart uploads after 7 days:

aws s3api put-bucket-lifecycle-configuration \
--bucket <S3_BUCKET> \
--lifecycle-configuration '{
"Rules": [{
"ID": "abort-incomplete-multipart-uploads",
"Status": "Enabled",
"Filter": {"Prefix": ""},
"AbortIncompleteMultipartUpload": {"DaysAfterInitiation": 7}
}]
}'

Replace <S3_BUCKET> with your bucket name. See Configuring a bucket lifecycle configuration to delete incomplete multipart uploads.

warning

This command replaces the bucket's existing lifecycle rules. If the bucket already has rules, add this one to them instead.

Leftover .part.chk and .group objects on Google Cloud Storage​

Objects with names ending in .part.chk or .group remain in task work directories.

This issue occurs when a task is cancelled or killed while Fusion writes a file. Fusion uses these temporary objects to join a file's chunks into the final object. If the task stops first, they stay in the bucket.

To resolve, add a lifecycle rule that deletes them after 7 days. Save the rule to a file:

{
"rule": [{
"action": {"type": "Delete"},
"condition": {
"age": 7,
"matchesPrefix": ["<WORK_DIR_PREFIX>/"],
"matchesSuffix": [".part.chk", ".group"]
}
}]
}

Replace <WORK_DIR_PREFIX> with the work directory's path inside the bucket, such as work. The prefix stops the rule from deleting other objects that end in .part.chk or .group.

Apply the rule:

gcloud storage buckets update gs://<GCS_BUCKET> --lifecycle-file=<FILE>

Replace <GCS_BUCKET> with your bucket name and <FILE> with the path to the rule file.

warning

This command replaces the bucket's existing lifecycle rules. If the bucket already has rules, add this one to them instead.

Exit code 174 after the task script succeeds​

A task that writes a large amount of output fails with exit code 174. Its script succeeded, and the .exitcode file in the task work directory contains 0. The task keeps running for a fixed time after the script finishes, 2 hours by default. Some of its output files are missing from object storage.

At the default log level, Fusion logs nothing about this failure. With fusion.logLevel = 'debug', the task log shows the timeout when the script finishes and the forced stop when the timeout expires:

DBG [seqera-fusion] current stop shutdown timeout FUSION_STOP_SHUTDOWN_TIMEOUT=7200000
DBG [seqera-fusion] process didn't exit in time, force kill it

This issue occurs when Fusion is still uploading task outputs when FUSION_STOP_SHUTDOWN_TIMEOUT expires. Fusion uploads the files a task writes in the background. When the task script exits, Fusion waits for the remaining uploads to finish before it stops. The FUSION_STOP_SHUTDOWN_TIMEOUT environment variable limits that wait. When the timeout expires, Fusion stops and the task exits 174. Files that Fusion has not finished uploading are lost.

The log shows the timeout in milliseconds. 7200000 is 2 hours. The default is 2 hours in Fusion 2.5.4 and later and in 2.4.15 and later 2.4 releases. Fusion 2.4.7 to 2.4.14 and 2.5.0 to 2.5.3 default to 30 minutes.

warning

FUSION_STOP_SHUTDOWN_TIMEOUT and FUSION_UPLOADERS are low-level Fusion settings. The defaults suit almost every workload. Change them only when a task fails as described in this section. Set them only on the processes that need them, and remove them when you no longer need them. Their names and behavior might change in future Fusion releases.

To resolve, increase the timeout on the processes that write large outputs:

process {
withName: 'MY_PROCESS' {
containerOptions = '--env FUSION_STOP_SHUTDOWN_TIMEOUT=6h'
}
}

When you set FUSION_STOP_SHUTDOWN_TIMEOUT:

  • Include a unit, such as 6h or 360m. Fusion ignores a number without a unit, such as 21600000, and uses the default without an error. To confirm the value Fusion uses, check the current stop shutdown timeout line in a debug-level log.
  • Set the variable with containerOptions. Fusion reads its configuration when the container starts, before variables set with the env directive or in the task script are applied.
  • If you set the time directive, allow for the extra time. Nextflow passes time to AWS Batch and Google Batch as the job timeout. The time Fusion spends uploading after the script exits counts toward it.

A longer timeout can increase compute costs. Fusion stops as soon as its uploads finish. If uploads stall, the instance keeps running until the timeout expires. Set the timeout to the upload time you expect plus a margin, not to a very large value.

To shorten the upload itself, increase the number of chunks Fusion uploads in parallel with FUSION_UPLOADERS. The default of 10 can limit upload throughput on instances with high network bandwidth:

process {
withName: 'MY_PROCESS' {
containerOptions = '--env FUSION_STOP_SHUTDOWN_TIMEOUT=6h --env FUSION_UPLOADERS=32'
}
}

Set FUSION_UPLOADERS as a whole number. Otherwise, Fusion logs a parsing FUSION_UPLOADERS warning and uses the default of 10. Values of 32 or 64 are reasonable on large instances. A higher value is not always faster because too many uploaders compete with each other and reduce throughput. The best value depends on the number of cores and the network bandwidth of the instance. Increase the value in steps and compare upload times.

Retrying the task does not help on its own because a retry runs the task again in a new work directory and writes all of its output again.

On this Page