ipfs/kubo · warning

closing plugins: %w

Error message

closing plugins: %w

What it means

When the daemon node's context is cancelled during shutdown, kubo closes loaded plugins in an AfterFunc and wraps any Close() error with this message on the plugin error channel. It signals a plugin failed to release resources cleanly at shutdown.

Source

Thrown at cmd/ipfs/kubo/daemon.go:616

		return node, nil
	}

	// Start "core" plugins. We want to do this *before* starting the HTTP
	// API as the user may be relying on these plugins.
	err = cctx.Plugins.Start(node)
	if err != nil {
		return err
	}

	pluginErrc := make(chan error, 1)
	select {
	case <-node.Context().Done():
		close(pluginErrc)
	default:
		context.AfterFunc(node.Context(), func() {
			err := cctx.Plugins.Close()
			if err != nil {
				pluginErrc <- fmt.Errorf("closing plugins: %w", err)
			}
			close(pluginErrc)
		})
	}

	// construct api endpoint - every time
	apiErrc, err := serveHTTPApi(req, cctx)
	if err != nil {
		return err
	}

	// construct fuse mountpoints - if the user provided the --mount flag
	mount, _ := req.Options[mountKwd].(bool)
	if mount && offline {
		return cmds.Errorf(cmds.ErrClient, "mount is not currently supported in offline mode")
	}
	if mount {
		if err := mountFuse(req, cctx); err != nil {

View on GitHub (pinned to 329838acdf)

Solutions

  1. Inspect the wrapped inner error to identify which plugin failed
  2. Update or remove the misbehaving plugin from the plugins directory
  3. Report upstream if it is a bundled plugin; ensure plugin Close() is idempotent and error-free
Defensive patterns

Strategy: try-catch

Try / catch

// consume the daemon shutdown error channel
if err := <-pluginErrc; err != nil {
    var wrapped *fmt.wrapError
    if errors.As(err, &wrapped) {
        log.Warnf("plugin shutdown issue: %v", errors.Unwrap(err))
    }
}

Prevention

When it happens

Trigger: Daemon shutdown while a plugin's Close() method returns an error (e.g. plugin holding open datastore/file handles or a failing teardown hook).

Common situations: Custom plugins with buggy teardown logic; plugin panics or timeouts during close; shutdown during heavy plugin activity.

Related errors


AI-assisted analysis of ipfs/kubo@329838acdf (2026-09-03). Data as JSON: /api/errors/1d4b110fbffa1432. Report an issue: GitHub.