Skip to content

"Session aborted -- Cause: Strings must not be null" error when specifying non-existent entry #6405

@robsyme

Description

@robsyme

Bug report

Expected behavior and actual behavior

Expected behavior: When specifying a non-existent workflow entry name with the -entry option, Nextflow should display a clear error message like "Unknown workflow entry name: foo" with helpful suggestions for similar workflow names.

Actual behavior: Nextflow crashes with a cryptic "Session aborted -- Cause: Strings must not be null" error instead of providing a helpful error message about the invalid entry name.

Steps to reproduce the problem

  1. Use any simple Nextflow pipeline (e.g., nextflow-io/hello)
  2. Run with a non-existent entry name:
    nextflow run hello -entry foo

This can be reproduced with any pipeline by specifying an invalid entry name.

Program output

Sep-15 16:55:32.400 [main] DEBUG nextflow.Session - Session aborted -- Cause: Strings must not be null

The complete log shows the session aborts during script parsing rather than providing a user-friendly error message about the invalid workflow entry name.

Environment

  • Nextflow version: 25.04.3
  • Java version: OpenJDK 64-Bit Server VM 21.0.7+6-LTS
  • Operating system: Linux/macOS (reproduced on both)
  • Bash version: N/A (not bash-related)

Additional context

Root cause analysis:

The error occurs in the workflow entry name validation logic in BaseScript.groovy:180-186. When Nextflow tries to provide helpful suggestions for the invalid entry name using the closest() method from Bolts.groovy:739, a Guava Preconditions validation fails with "Strings must not be null".

The issue is in this code path:

// BaseScript.groovy line ~183
final guess = allNames.closest(binding.entryName)

The closest() method calls StringUtils.getLevenshteinDistance() but appears to encounter null values in the workflow names collection, triggering a Guava validation failure.

Impact:

  • Poor user experience with cryptic error messages
  • Difficulty debugging workflow entry issues
  • Session abort instead of graceful error handling

Suggested fix:
Add null-safety checks in the closest() method or the workflow name suggestion logic to handle cases where workflow metadata might contain null values.

This affects the core user experience when making common mistakes like typos in entry point names.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions