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

PullSubscribe with '%' character result in disconnect and no messages on fetch #4038

Closed
FredericMa opened this issue Apr 11, 2023 · 1 comment · Fixed by #4040
Closed

PullSubscribe with '%' character result in disconnect and no messages on fetch #4038

FredericMa opened this issue Apr 11, 2023 · 1 comment · Fixed by #4040

Comments

@FredericMa
Copy link

Hi,

We are using a NATS server with JetStream configured.
When we want to do a PullSubscribe for a wildcard subject we encode the subject to become the Durable name of the consumer. This results in a string that doesn't contain the wildcards but it introduces '%'. This should be valid since it is in the ASCII printable range and differs from the wildcard characters.

Although when we subscription and fetch the messages we get no results in return. If we use a consumername that doesn't include any '%' we get the correct results.

You can reproduce this with the following procedure:

  • Enable JetStream on the NATS server.

  • I created a JetStream with the following configuration (yellow highlighted items differ from default):
    image

  • I published a message: nats pub "test.1" "someData"

  • I created a small test program to simulate this. Commenting one of the lines with the // <-- SWAP BETWEEN THESE TWO LINES comment enables you to simulate a working and broken scenario.

using NATS.Client;
using NATS.Client.JetStream;

class Program
{
    static void Main(string[] args)
    {
        // Connect
        var connectionFactory = new ConnectionFactory();

        var options = ConnectionFactory.GetDefaultOptions();
        options.DisconnectedEventHandler += (sender, eventArgs) =>
        {
            Console.WriteLine("ERROR");
        };

        options.Url = "localhost:4222";

        var connection = connectionFactory.CreateConnection(options);

        while (connection.State != ConnState.CONNECTED)
        {
            Task.Delay(100);
        }

        // Subscribe
        var context = connection.CreateJetStreamContext();

        var consumerName = "Test%123"; // <-- SWAP BETWEEN THESE TWO LINES
        //var consumerName = "Test123"; // <-- SWAP BETWEEN THESE TWO LINES

        var subOptions = PullSubscribeOptions.Builder().WithDurable(consumerName).Build();
        var sub = context.PullSubscribe("test.*", subOptions);

        IList<Msg>? messages = sub.Fetch(10, 1000);

        // Cleanup
        sub.Unsubscribe();

        IJetStreamManagement? jsm = connection.CreateJetStreamManagementContext();
        jsm?.DeleteConsumer("test", consumerName);

        Console.WriteLine($"Number of received messages: {messages.Count}");
    }
}

No error is seen except a disconnect and reconnect that happens in case a '%' is present in the consumer name.

Is collected these logs:

  • Consumer name "Test123":
[48464] 2023/04/11 15:59:33.199889 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- MSG_PAYLOAD: ["{\"offset\":0,\"subject\":\"test.*\"}"]
[48464] 2023/04/11 15:59:33.200409 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [MSG _INBOX.pU59zTePf8ImM5SwaBMIeN.1 1 110]
[48464] 2023/04/11 15:59:33.201444 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  517]
[48464] 2023/04/11 15:59:33.201444 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzIQ\",\"timestamp\":\"2023-04-11T13:59:33.2004095Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":29941500,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.STREAM.NAMES\",\"request\":\"{\\\"offset\\\":0,\\\"subject\\\":\\\"test.*\\\"}\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.stream_names_response\\\",\\\"total\\\":1,\\\"offset\\\":0,\\\"limit\\\":1024,\\\"streams\\\":[\\\"test\\\"]}\"}"]
[48464] 2023/04/11 15:59:33.209996 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- [PUB $JS.API.CONSUMER.INFO.test.Test123 _INBOX.pU59zTePf8ImM5SwaBMIeN.2 0]
[48464] 2023/04/11 15:59:33.210561 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- MSG_PAYLOAD: [""]
[48464] 2023/04/11 15:59:33.211602 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [MSG _INBOX.pU59zTePf8ImM5SwaBMIeN.2 1 131]
[48464] 2023/04/11 15:59:33.212125 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  502]
[48464] 2023/04/11 15:59:33.212648 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzKs\",\"timestamp\":\"2023-04-11T13:59:33.2116026Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":29941500,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.CONSUMER.INFO.test.Test123\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.consumer_info_response\\\",\\\"error\\\":{\\\"code\\\":404,\\\"err_code\\\":10014,\\\"description\\\":\\\"consumer not found\\\"}}\"}"]
[48464] 2023/04/11 15:59:33.222200 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- [SUB _INBOX.pU59zTePf8ImW6SwaBMIeN  2]
[48464] 2023/04/11 15:59:33.229764 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- [PUB $JS.API.CONSUMER.CREATE.test.Test123.test.* _INBOX.pU59zTePf8ImM5SwaBMIeN.3 194]
[48464] 2023/04/11 15:59:33.229764 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- MSG_PAYLOAD: ["{\"stream_name\":\"test\",\"config\":{\"durable_name\":\"Test123\",\"deliver_policy\":\"all\",\"opt_start_seq\":0,\"ack_policy\":\"explicit\",\"filter_subject\":\"test.*\",\"replay_policy\":\"instant\",\"rate_limit_bps\":0}}"]
[48464] 2023/04/11 15:59:33.233425 [←[33mTRC←[0m] JETSTREAM - <<- [SUB $JSC.CI.$G.test.Test123  45]
[48464] 2023/04/11 15:59:33.233950 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [MSG _INBOX.pU59zTePf8ImM5SwaBMIeN.3 1 553]
[48464] 2023/04/11 15:59:33.234470 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  1228]
[48464] 2023/04/11 15:59:33.236156 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzPm\",\"timestamp\":\"2023-04-11T13:59:33.2339506Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":29941500,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.CONSUMER.CREATE.test.Test123.test.*\",\"request\":\"{\\\"stream_name\\\":\\\"test\\\",\\\"config\\\":{\\\"durable_name\\\":\\\"Test123\\\",\\\"deliver_policy\\\":\\\"all\\\",\\\"opt_start_seq\\\":0,\\\"ack_policy\\\":\\\"explicit\\\",\\\"filter_subject\\\":\\\"test.*\\\",\\\"replay_policy\\\":\\\"instant\\\",\\\"rate_limit_bps\\\":0}}\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.consumer_create_response\\\",\\\"stream_name\\\":\\\"test\\\",\\\"name\\\":\\\"Test123\\\",\\\"created\\\":\\\"2023-04-11T13:59:33.2307959Z\\\",\\\"config\\\":{\\\"durable_name\\\":\\\"Test123\\\",\\\"name\\\":\\\"Test123\\\",\\\"deliver_policy\\\":\\\"all\\\",\\\"ack_policy\\\":\\\"explicit\\\",\\\"ack_wait\\\":30000000000,\\\"max_deliver\\\":-1,\\\"filter_subject\\\":\\\"test.*\\\",\\\"replay_policy\\\":\\\"instant\\\",\\\"max_waiting\\\":512,\\\"max_ack_pending\\\":1000,\\\"num_replicas\\\":0},\\\"delivered\\\":{\\\"consumer_seq\\\":0,\\\"stream_seq\\\":0},\\\"ack_floor\\\":{\\\"consumer_seq\\\":0,\\\"stream_seq\\\":0},\\\"num_ack_pending\\\":0,\\\"num_redelivered\\\":0,\\\"num_waiting\\\":0,\\\"num_pending\\\":1}\"}"]
[48464] 2023/04/11 15:59:33.271801 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- [PUB $JS.API.CONSUMER.MSG.NEXT.test.Test123 _INBOX.pU59zTePf8ImW6SwaBMIeN 32]
[48464] 2023/04/11 15:59:33.271961 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- MSG_PAYLOAD: ["{\"batch\":10,\"expires\":990000000}"]
[48464] 2023/04/11 15:59:33.274079 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [MSG test.1 2 $JS.ACK.test.Test123.1.1.1.1681221465875194400.0 8]
[48464] 2023/04/11 15:59:34.269651 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [HMSG _INBOX.pU59zTePf8ImW6SwaBMIeN 2  81 81]
[48464] 2023/04/11 15:59:34.290161 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- [UNSUB 2 0]
[48464] 2023/04/11 15:59:34.291194 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <-> [DELSUB 2]
[48464] 2023/04/11 15:59:34.291194 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- [PUB $JS.API.CONSUMER.DELETE.test.Test123 _INBOX.pU59zTePf8ImM5SwaBMIeN.4 0]
[48464] 2023/04/11 15:59:34.291717 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <<- MSG_PAYLOAD: [""]
[48464] 2023/04/11 15:59:34.291717 [←[33mTRC←[0m] JETSTREAM - <-> [DELSUB 1]
[48464] 2023/04/11 15:59:34.291717 [←[33mTRC←[0m] JETSTREAM - <-> [DELSUB 2]
[48464] 2023/04/11 15:59:34.292237 [←[33mTRC←[0m] JETSTREAM - <-> [DELSUB 45]
[48464] 2023/04/11 15:59:34.294852 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [MSG _INBOX.pU59zTePf8ImM5SwaBMIeN.4 1 75]
[48464] 2023/04/11 15:59:34.294852 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  440]
[48464] 2023/04/11 15:59:34.294852 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzUg\",\"timestamp\":\"2023-04-11T13:59:34.2948523Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":29941500,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.CONSUMER.DELETE.test.Test123\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.consumer_delete_response\\\",\\\"success\\\":true}\"}"]
[48464] 2023/04/11 15:59:34.306878 [←[33mTRC←[0m] [::1]:53879 - cid:8 - <-> [DELSUB 1]
  • Consumer name "Test%123":
[48464] 2023/04/11 16:00:03.603246 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- MSG_PAYLOAD: ["{\"offset\":0,\"subject\":\"test.*\"}"]
[48464] 2023/04/11 16:00:03.603246 [←[33mTRC←[0m] [::1]:53987 - cid:12 - ->> [MSG _INBOX.FJeU2ND3YLF47JaShLTIYr.1 1 110]
[48464] 2023/04/11 16:00:03.604298 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  517]
[48464] 2023/04/11 16:00:03.604298 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzX8\",\"timestamp\":\"2023-04-11T14:00:03.6032468Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":25338400,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.STREAM.NAMES\",\"request\":\"{\\\"offset\\\":0,\\\"subject\\\":\\\"test.*\\\"}\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.stream_names_response\\\",\\\"total\\\":1,\\\"offset\\\":0,\\\"limit\\\":1024,\\\"streams\\\":[\\\"test\\\"]}\"}"]
[48464] 2023/04/11 16:00:03.612980 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- [PUB $JS.API.CONSUMER.INFO.test.Test%123 _INBOX.FJeU2ND3YLF47JaShLTIYr.2 0]
[48464] 2023/04/11 16:00:03.613655 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- MSG_PAYLOAD: [""]
[48464] 2023/04/11 16:00:03.614184 [←[33mTRC←[0m] [::1]:53987 - cid:12 - ->> [MSG _INBOX.FJeU2ND3YLF47JaShLTIYr.2 1 131]
[48464] 2023/04/11 16:00:03.615251 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  503]
[48464] 2023/04/11 16:00:03.615251 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzZa\",\"timestamp\":\"2023-04-11T14:00:03.6141843Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":25338400,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.CONSUMER.INFO.test.Test%123\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.consumer_info_response\\\",\\\"error\\\":{\\\"code\\\":404,\\\"err_code\\\":10014,\\\"description\\\":\\\"consumer not found\\\"}}\"}"]
[48464] 2023/04/11 16:00:03.624851 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- [SUB _INBOX.FJeU2ND3YLF4ANaShLTIYr  2]
[48464] 2023/04/11 16:00:03.631254 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- [PUB $JS.API.CONSUMER.CREATE.test.Test%123.test.* _INBOX.FJeU2ND3YLF47JaShLTIYr.3 195]
[48464] 2023/04/11 16:00:03.631820 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- MSG_PAYLOAD: ["{\"stream_name\":\"test\",\"config\":{\"durable_name\":\"Test%123\",\"deliver_policy\":\"all\",\"opt_start_seq\":0,\"ack_policy\":\"explicit\",\"filter_subject\":\"test.*\",\"replay_policy\":\"instant\",\"rate_limit_bps\":0}}"]
[48464] 2023/04/11 16:00:03.634463 [←[33mTRC←[0m] JETSTREAM - <<- [SUB $JSC.CI.$G.test.Test%123  46]
[48464] 2023/04/11 16:00:03.634463 [←[33mTRC←[0m] [::1]:53987 - cid:12 - ->> [MSG _INBOX.FJeU2ND3YLF47JaShLTIYr.3 1 556]
[48464] 2023/04/11 16:00:03.634463 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  1233]
[48464] 2023/04/11 16:00:03.635524 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzeU\",\"timestamp\":\"2023-04-11T14:00:03.6344634Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":25338400,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.CONSUMER.CREATE.test.Test%123.test.*\",\"request\":\"{\\\"stream_name\\\":\\\"test\\\",\\\"config\\\":{\\\"durable_name\\\":\\\"Test%123\\\",\\\"deliver_policy\\\":\\\"all\\\",\\\"opt_start_seq\\\":0,\\\"ack_policy\\\":\\\"explicit\\\",\\\"filter_subject\\\":\\\"test.*\\\",\\\"replay_policy\\\":\\\"instant\\\",\\\"rate_limit_bps\\\":0}}\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.consumer_create_response\\\",\\\"stream_name\\\":\\\"test\\\",\\\"name\\\":\\\"Test%123\\\",\\\"created\\\":\\\"2023-04-11T14:00:03.6318205Z\\\",\\\"config\\\":{\\\"durable_name\\\":\\\"Test%123\\\",\\\"name\\\":\\\"Test%123\\\",\\\"deliver_policy\\\":\\\"all\\\",\\\"ack_policy\\\":\\\"explicit\\\",\\\"ack_wait\\\":30000000000,\\\"max_deliver\\\":-1,\\\"filter_subject\\\":\\\"test.*\\\",\\\"replay_policy\\\":\\\"instant\\\",\\\"max_waiting\\\":512,\\\"max_ack_pending\\\":1000,\\\"num_replicas\\\":0},\\\"delivered\\\":{\\\"consumer_seq\\\":0,\\\"stream_seq\\\":0},\\\"ack_floor\\\":{\\\"consumer_seq\\\":0,\\\"stream_seq\\\":0},\\\"num_ack_pending\\\":0,\\\"num_redelivered\\\":0,\\\"num_waiting\\\":0,\\\"num_pending\\\":1}\"}"]
[48464] 2023/04/11 16:00:03.666037 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- [PUB $JS.API.CONSUMER.MSG.NEXT.test.Test%123 _INBOX.FJeU2ND3YLF4ANaShLTIYr 32]
[48464] 2023/04/11 16:00:03.666344 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <<- MSG_PAYLOAD: ["{\"batch\":10,\"expires\":990000000}"]
[48464] 2023/04/11 16:00:03.667887 [←[33mTRC←[0m] [::1]:53987 - cid:12 - ->> [MSG test.1 2 $JS.ACK.test.Test%d.1.1.1.1681221465875194400%!(EXTRA uint64=0) 8]
[48464] 2023/04/11 16:00:03.679056 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <-> [DELSUB 1]
[48464] 2023/04/11 16:00:03.679907 [←[33mTRC←[0m] [::1]:53987 - cid:12 - <-> [DELSUB 2]
[48464] 2023/04/11 16:00:06.725543 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [CONNECT {"verbose":false,"pedantic":false,"ssl_required":false,"lang":".NET","version":"1.0.3.0","protocol":1,"echo":true,"headers":true,"no_responders":true}]
[48464] 2023/04/11 16:00:06.726061 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [PING]
[48464] 2023/04/11 16:00:06.727080 [←[33mTRC←[0m] [::1]:54019 - cid:15 - ->> [PONG]
[48464] 2023/04/11 16:00:06.732643 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [SUB _INBOX.FJeU2ND3YLF47JaShLTIYr.*  1]
[48464] 2023/04/11 16:00:06.733410 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [SUB _INBOX.FJeU2ND3YLF4ANaShLTIYr  2]
[48464] 2023/04/11 16:00:06.740087 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [UNSUB 2 0]
[48464] 2023/04/11 16:00:06.740139 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <-> [DELSUB 2]
[48464] 2023/04/11 16:00:06.740139 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [PING]
[48464] 2023/04/11 16:00:06.740643 [←[33mTRC←[0m] [::1]:54019 - cid:15 - ->> [PONG]
[48464] 2023/04/11 16:00:06.741240 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- [PUB $JS.API.CONSUMER.DELETE.test.Test%123 _INBOX.FJeU2ND3YLF47JaShLTIYr.4 0]
[48464] 2023/04/11 16:00:06.744399 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <<- MSG_PAYLOAD: [""]
[48464] 2023/04/11 16:00:06.744933 [←[33mTRC←[0m] JETSTREAM - <-> [DELSUB 1]
[48464] 2023/04/11 16:00:06.745451 [←[33mTRC←[0m] JETSTREAM - <-> [DELSUB 2]
[48464] 2023/04/11 16:00:06.745965 [←[33mTRC←[0m] JETSTREAM - <-> [DELSUB 46]
[48464] 2023/04/11 16:00:06.747524 [←[33mTRC←[0m] [::1]:54019 - cid:15 - ->> [MSG _INBOX.FJeU2ND3YLF47JaShLTIYr.4 1 75]
[48464] 2023/04/11 16:00:06.747524 [←[33mTRC←[0m] ACCOUNT - <<- [PUB $JS.EVENT.ADVISORY.API  434]
[48464] 2023/04/11 16:00:06.747524 [←[33mTRC←[0m] ACCOUNT - <<- MSG_PAYLOAD: ["{\"type\":\"io.nats.jetstream.advisory.v1.api_audit\",\"id\":\"uW4fSa7rf1gFbbjcJiCzjO\",\"timestamp\":\"2023-04-11T14:00:06.7475249Z\",\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\",\"client\":{\"acc\":\"$G\",\"rtt\":1,\"server\":\"NDGUJBY2XGSUJJU2XWVIPKQHHGLPPGTFHH3Y2ITLDMUXQDPKOT4UD536\"},\"subject\":\"$JS.API.CONSUMER.DELETE.test.Test%123\",\"response\":\"{\\\"type\\\":\\\"io.nats.jetstream.api.v1.consumer_delete_response\\\",\\\"success\\\":true}\"}"]
[48464] 2023/04/11 16:00:06.753389 [←[33mTRC←[0m] [::1]:54019 - cid:15 - <-> [DELSUB 1]

This line in the log above looks suspicious if you compare it to the log of the working situation (note the %d):

[48464] 2023/04/11 16:00:03.667887 [←[33mTRC←[0m] [::1]:53987 - cid:12 - ->> [MSG test.1 2 $JS.ACK.test.Test%d.1.1.1.1681221465875194400%!(EXTRA uint64=0) 8]

VS

[48464] 2023/04/11 15:59:33.274079 [←[33mTRC←[0m] [::1]:53879 - cid:8 - ->> [MSG test.1 2 $JS.ACK.test.Test123.1.1.1.1681221465875194400.0 8]

Is this expected behavior, are we doing something wrong, or is this a bug?

Thanks in advance for the support!

Greetings,
Frederic

Jarema added a commit that referenced this issue Apr 12, 2023
If the Consumer had a name containing `%`, it could result in the reply
subject failing to format with `fmt.Sprintf`, as the `%` was not
properly escaped with `%%`.

Resolves #4038 

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@Jarema
Copy link
Member

Jarema commented Apr 12, 2023

@FredericMa, thanks for the detailed report.
That helps us a lot!

It was an actual issue that has been fixed in #4040

It will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants