Skip to content

Plugin version causes error in nextflow plugin command #7110

@JosuaCarl

Description

@JosuaCarl

Bug report

Expected behavior and actual behavior

When specifying a version the correct version should be loaded from a local repository.

Steps to reproduce the problem

Works (with the current version 1.2.1):

nextflow plugin nf-co2footprint:postRun --tracePath out/pipeline_info execution_trace.txt --config nextflow.config

Does not work:

nextflow plugin nf-co2footprint@1.2.1:postRun --tracePath out/pipeline_info execution_trace.txt --config nextflow.config

Program output

nextflow plugin nf-co2footprint@1.3.0:postRun --tracePath out/pipeline_info/execution_trace_2026-05-06_09-55-52.txt --config nextflow.config
->

nf-co2footprint plugin  ~  version 1.3.0
Cannot find target plugin: nf-co2footprint@1.3.0

The first line is from the plugin itself, showing that it is loaded and started. I could trace the path of the command being issued to the version and plugin name being correctly
parsed:

final head = args.pop()
final items = head.tokenize(CMD_SEP)
final target = items[0]
final cmd = items[1] ? items[1..-1].join(CMD_SEP) : null
// push back the command as the first item
Plugins.start(target)

, interpreted:

static PluginRef parse(String fqid, DefaultPlugins defaultPlugins=null) {
final tokens = fqid.tokenize('@') as List<String>
final id = tokens[0]
final ver = tokens[1]
if( ver || defaultPlugins==null )
return new PluginRef(id, ver)
if( defaultPlugins.hasPlugin(id) )
return defaultPlugins.getPlugin(id)
return new PluginRef(id)

,loaded:

boolean installPlugin(String id, String version) {
if( !pluginsStore )
throw new IllegalStateException("Missing pluginStore attribute")
return load0(id, version)
}

with the intended path ($HOME/.nextflow/plugins/nf-co2footprint-1.3.0):

PluginWrapper wrapper = pluginManager.loadPluginFromPath(pluginPath)

, and started (this is where the plugin first logs its version):

PluginState state = pluginManager.startPlugin(id)
return PluginState.STARTED == state

However, after the successful startup the plugin can not be fetched from the manager and the wrapper is null, leading to the error:

final wrapper = Plugins.manager.getPlugin(target)
if( !wrapper )
throw new AbortOperationException("Cannot find target plugin: $target")

Environment

  • Nextflow version: 26.04.0
  • Operating system: MacOS

Additional context

So my question is: Why does the plugin start up correctly, but is not found in the manager? And why does it work if I do not supply a specific version?

Relates to nextflow-io/nf-co2footprint#391

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions