Diagnosing Moleculer Action Not Found Errors Due to Version or Registration Issues
A step‑by‑step diagnostic guide for resolving Moleculer 'Action not found' errors caused by version mismatches, registration failures, typos, caching, or serializer issues.
18 Jan 2026, 01:24 UTC

Recognizable condition
When invoking a Moleculer action you receive an HTTP 404 or the framework error "Action not found" even though the action is clearly defined in the service schema.
Cause / diagnostic table
| Possible cause | What you might see |
|---|---|
| Service version mismatch | Caller expects version X but the registered service advertises version Y. |
| Service not loaded / transporter failure | Broker logs show "Service not found" or transporter disconnect warnings. |
| Namespace or action name typo | Action name in the request differs (extra spaces, wrong case) from the schema. |
| Stale cache in API gateway or client | Gateway returns 400/404 despite the broker listing the action. |
| Transport serializer mismatch | Protobuf vs JSON on different nodes corrupts the action name during serialization. |
Ordered checks
- List local services – In any service file or REPL, run:
Verify that the target service appears and its// Run inside a Moleculer service (e.g., in an action) const services = this.broker.getLocalServices(); console.log(JSON.stringify(services, null, 2));actionslist contains the expected action name. Required permission: access to the broker instance (no special rights). Risk: none; read‑only. - Check transporter status – Look at broker logs or subscribe to transit events:
Ensure the transporter (NATS, Redis, MQTT, etc.) shows a connected state. Where to run: in the service’sthis.broker.transit.on('disconnect', () => console.log('Transporter disconnected')); this.broker.transit.on('connect', () => console.log('Transporter connected'));startedlifecycle or via the broker’s REPL. Risk: none. - Confirm version metadata – Inspect the service schema:
Compare this// In the service definition const { Service } = require('moleculer'); module.exports = new Service({ name: 'math', version: '1.0', // <-- check this actions: { add: { /* ... */ } } });versionwith the value used by the caller (e.g., inthis.broker.call('math.v2.add', ...)). Risk: changing version in production may cause temporary mismatches for existing clients. - Scan broker logs for registration messages – Grep for:
Presence of "Service not found" indicates a version or name mismatch. Risk: none.Service registered: math@v1.0 Service not found: math@v2.0 - Validate API gateway forwarding – If using an API gateway (e.g., Moleculer‑Web), check the route definition:
Ensure the gateway forwards the exact action name and version. Risk: misconfiguration can silently drop requests.// moleculer-web config routes: [ { path: '/api', whitelist: [ { action: 'math.add', version: '1.0' } // <-- ensure version matches ] } ];
Fixes tied to findings
- Version mismatch – Align
service.versionacross provider and consumer, or omit the version to let the broker resolve to the latest. Example: Change caller fromthis.broker.call('math.v2.add', ...)tothis.broker.call('math.add', ...)if the service definesversion: '1.0'. - Service not loaded – Restart the node, verify transporter connection (check credentials, port, cluster settings). For NATS, ensure
nats://user:pass@host:4222is identical on all nodes. - Namespace/action typo – Correct the action name in the caller, remove extra spaces, and match case exactly as defined in the schema.
- Stale cache – If using Moleculer‑Web or a custom gateway, set
cache: falseon the action or clear the gateway’s Redis/Memory cache. - Serializer mismatch – Standardize the transporter serializer (e.g.,
transporter: { type: 'JSON', options: {} }) on every node. Do not mix Protobuf and JSON unless you have explicit mapping.
Verification
After applying a fix, confirm the action is reachable:
- Call the action directly via the broker:
Expect a successful response (status 200 or the expected data).this.broker.call('math.add', { a: 5, b: 3 }) .then(res => console.log('Result:', res)) .catch(err => console.error('Error:', err)); - Re‑run
this.broker.getLocalServices()and verify the service lists the action with the correct version. - If using an API gateway, send an HTTP request to the endpoint (e.g.,
GET /api/math/add?a=5&b=3) and validate the response matches the expected schema.
Escalation criteria
If the error persists after completing the checks and fixes:
- Enable broker debug logging:
loggerLevel: 'debug'in the broker options. - Capture the full request/response payloads (including headers).
- Reproduce the issue in a minimal test project (single broker, one service, one caller).
- If still unresolved, open an issue on the Moleculer GitHub repository with logs, version info, and the minimal reproduction steps.
Limitations
This guide assumes the broker process is running and the transporter is functional. It does not cover network‑level firewalls or DNS resolution problems that prevent nodes from reaching each other.
Practical way to check the result
Run the verification steps above; a successful broker.call response or a correct HTTP reply from the gateway confirms that the action is now reachable.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.