Skip to content
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

event_callback keeps triggering client error: nats: authorization violation #1334

Open
hanselke opened this issue Oct 28, 2024 · 2 comments
Open
Labels
defect Suspected defect such as a bug or regression

Comments

@hanselke
Copy link

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

@hanselke hanselke added the defect Suspected defect such as a bug or regression label Oct 28, 2024
@Jarema
Copy link
Member

Jarema commented Oct 28, 2024

We need more details about your setup.

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

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

3 participants
@hanselke @Jarema and others