FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Plugin loader: one plugin's activate() failure crash-loops the whole server; isolate and retry instead · Issue #645 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub

Repository navigation

Plugin loader: one plugin's activate() failure crash-loops the whole server; isolate and retry instead #645

Open

Description

What happened

A host reboot brought jspod back under pm2 before a Bitcoin node that one plugin depends on. That plugin's activate() does a fetch to the node's RPC at startup; with the node down it threw fetch failed. The loader rethrows (src/plugins.js, "plugin ${id}: activate() failed"), the server exits with code 1, pm2 restarts it, and the cycle repeats. ~290 restarts over ten minutes.

Meanwhile every other plugin and the plain pod itself were unavailable: /public/... returned connection refused, so a client that normally writes an hour file through the pod fell back to direct disk writes and corrupted a JSON file through a concurrent-write race. None of that had anything to do with the plugin that failed.

Error: plugin plugin: activate() failed: fetch failed
✗ Server exited with code 1

Why this is a server problem, not just a plugin problem

A plugin that needs an external service at activation time will fail whenever that service is not yet up, which is the normal case after a reboot. Today one such plugin takes the whole pod down with it, including unrelated plugins and core LDP serving. The failure mode is a crash loop with no degraded mode.

Suggested fix

  1. Isolate activation failures. Log the error with the plugin id, skip that plugin, and continue starting the server. The pod and the other plugins stay up. (Keep today's fail-fast behaviour behind an opt-in flag, e.g. --plugin-strict, for deployments that would rather not start at all.)
  2. Optionally retry. Re-attempt activate() for a failed plugin with backoff (e.g. 5 s, 10 s, 30 s, then every minute) so a dependency that comes up a few seconds later is picked up without an operator restart. Until it activates, requests under its prefix get a 503.
  3. Surface the state. Expose failed/pending plugins somewhere inspectable (log line at startup, and/or a field in the server info endpoint) so a crash-looping dependency is visible rather than silent.

Related: #599 (the wrap also drops err.code, which would help distinguish a network failure from a config error here).

Environment

jspod via pm2, Node v24.16.0, four plugins on the command line (--plugin a@/x --plugin b@/y ...). The failing one was fourth in the list; the first three had already logged "plugin ... active" when the process exited.

Activity

  1. added
    bugSomething isn't working
    pluginCould be implemented as a plugin (#206); core/plugin line defined in #564
    on Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpluginCould be implemented as a plugin (#206); core/plugin line defined in #564

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL