nats-io/nats.rs

event_callback keeps triggering client error: nats: authorization violation

Closed this issue · 2 comments

Observed behavior

    let nc_main = ConnectOptions::with_jwt(jwt, move |nonce| {
        let keypair_clone = keypair_clone.clone();
        async move { keypair_clone.sign(&nonce).map_err(async_nats::AuthError::new) }
    })
    .custom_inbox_prefix(inbox_prefix)
    .event_callback(|event| async move {
          println!("NATS event occurred: {}", event);
    })
    .connect(main_nats_url)
    .await
    .context("Cannot connect to main NATS service")?;

jwt token is issued with all perms, and 1 year expiry.

When i do nothing else, ie..no subscriptions, after a min or so i'll start seeing

NATS event occurred: client error: nats: authorization violation
NATS event occurred: client error: nats: authorization violation

one event every min or so. however when i run it with all my app features, all the features still work even tho we keep seeing this auth violation.

Expected behavior

there shouldnt be any auth violation events

Server and client version

server: 2.10.22 & 2.10.21
async nats client: 0.37.0

Host environment

mac m1. nats is running inside docker, with a local only swarm mode enabled.

Steps to reproduce

seems to just happen in my app, have not tried a bare setup to see if it happens to deduce further

We need more details about your setup.

Can you share how the permissions to subject looks like?
Are you using JetStream?

I'm closing this issue as there is no response or details.
Feel free to reopen if you will get a chance to get back to this.
Anyway - I suspect missing permissions to some subjects.