Skip to content

nats-server is complaining about overlapping jetstream api subjects on stream creation when not valid [v2.11.2] #6846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AresAutomata opened this issue Apr 29, 2025 · 7 comments
Assignees
Labels
defect Suspected defect such as a bug or regression

Comments

@AresAutomata
Copy link

AresAutomata commented Apr 29, 2025

Observed behavior

In nats-server version 2.11.2, it appears that creating a stream using mostly wildcards in the subjects field raises an error saying: nats: error: could not create Stream: subjects overlap with an existing stream (10065).

I've observed that if the first 2 tokens are wildcards. the stream creation will always fail.

Here is a screenshot of using the cli to replicate the issue.
Image

This is a valid stream being created with the same pattern.
Image

Expected behavior

A valid stream for subjects with wildcards appearing for the first 3+ tokens is created.

This should be valid.
Image

Server and client version

nats-server version = 2.11.2
nats cli version = 0.1.5

Host environment

No response

Steps to reproduce

Outlined in the screenshots above

@AresAutomata AresAutomata added the defect Suspected defect such as a bug or regression label Apr 29, 2025
@neilalexander
Copy link
Member

neilalexander commented Apr 29, 2025

Are you overlapping with the interest of other configured streams? Streams have to have non-overlapping interest within a given account.

@AresAutomata
Copy link
Author

AresAutomata commented Apr 29, 2025

You are probably overlapping with $JS.API and other system subjects, which is prohibited intentionally.

We have intentionally hardcoded one of the tokens in the subject: i.e. *.*.*.*.*.*.*.broadcast.*. Should this not separate subject from jetstream specific subjects?

This is occurring when trying to create a the first stream in a very simple environment.

@neilalexander
Copy link
Member

neilalexander commented Apr 29, 2025

Does nats stream ls -a definitely report no other streams in this case?

@AresAutomata
Copy link
Author

Does nats stream ls -a definitely report no other streams in this case?

Yep no streams are reported. We bypassed this issue by adding a constant prefix to the subject.

@neilalexander
Copy link
Member

With server v2.11.2 and CLI v0.1.5, I fail to create the streams as you do, but the error returned is because of the JS API collision, not a duplicate stream.

For your first example:

nats stream create test --subjects="*.*.*.*.test.*.*" --defaults
nats: error: could not create Stream: subjects that overlap with jetstream api require no-ack to be true (10052)

For your second example:

nats stream create test --subjects="*.test.*.*.*.*" --defaults
nats: error: could not create Stream: subjects that overlap with jetstream api require no-ack to be true (10052)

... which makes sense because the first wildcard could match $JS and therefore it collides with one of the reserved namespaces.

What isn't clear is why you are getting subjects overlap with an existing stream if there are really no streams (which would include KV and object store buckets). Is this a clustered setup or a standalone server?

@wallyqs wallyqs changed the title Nats server 2.11.2 is complaining about overlapping jetstream api subjects on stream creation when not valid nats-server is complaining about overlapping jetstream api subjects on stream creation when not valid [v2.11.2] May 10, 2025
@dominiks96
Copy link

Also happens in 2.11.3 with the following subject *.*.*.*.a.b.>

@fmontorsi-equinix
Copy link

Also happens to me with 2.11.3 with a stream having subjects like:

  • *.enroll
  • *.heartbeat

I fixed that by adding a prefix to all these subjects like:

  • xyz.*.enroll
  • xyz.*.heartbeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

4 participants