Skip to content

[BUG] multitenant incompatible with NATS #746

@mikenikles

Description

@mikenikles

When I set WADM_MULTITENANT=true, the server crashes with the following error message:

Error { kind: JetStream(Error { code: 500, err_code: ErrorCode(10052), description: Some("subjects that overlap with jetstream api require no-ack to be true") }), source: None }

I narrowed it down to this line in https://github.com/nats-io/nats-server.

In wadm, this code block causes the issue:

let topic_prefix = if multitenant {
    format!("*.{prefix}")
} else {
    prefix.clone()
};

To resolve this, we need to prefix multitenant topics with an additional value to prevent it from clashing with $JS.>. Either a hardcoded value or a configurable one would do.

For example:

let topic_prefix = if multitenant {
    format!("multitenant.*.{prefix}")
} else {
    prefix.clone()
};

This would also require changes to how NATS account imports/exports are set up in https://github.com/wasmCloud/wadm/blob/main/tests/nats/nats-test.conf.

FWIW, this started to break in summer of 2024 with this code change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions