Replies: 3 comments 1 reply
|
I could not make your failure happen, and I tried fairly hard with your exact versions and configs, so instead of a guess I can offer you three things: precisely what this error means at the byte level, a set of causes your scenario provably is not, and the one capture that will pin the real cause the next time it fires. Plus one question about your compose file that may reinterpret your only successful fix. What the error means, exactly. In your nats.go v1.47.0, What I ruled out by execution, using nats-server v2.12.1 (your version) and your exact stream and consumer definitions, field for field (the one omission being the stream's Description string, which is metadata): thirteen create/update calls across seven server generations, every one returning full consumer info, zero empty-shaped bodies. The generations covered a fresh store, an idempotent re-upsert, two SIGKILL restarts (the faithful analogue of your machine reboots) with immediate upserts, and four deliberate power-loss corruptions of the consumer's on-disk state before restart: The question about your compose file: is the JetStream store directory on a named volume? This matters because your one working fix, For the next occurrence, three captures that convert this from mystery to diagnosis:
Until then, two mitigations. Treat this error as retryable with backoff and an alert, since your data shows it is environmental rather than config-driven. And if you add a fallback that deletes and recreates the durable, do it knowing the precise cost: with If you capture the raw bytes, post them here; that single string will be pinpointable. And given upstream has no documented trigger for this shape, that capture would also make a well-founded nats-server issue. |
|
Follow-up with substantially stronger exclusion data, since "could not reproduce in thirteen trials" deserved a harder test. I ran a metamorphic campaign against the same standalone nats-server 2.12.1: the invariant under test is the one your error is a violation of (every syntactically valid JSON reply to the consumer API must contain either an error object or consumer info), checked on every single response while the system was stressed along the axes my first pass did not cover, namely concurrency and timing. The campaign: eight concurrent workers racing create/update, delete, and info on your exact durable and config; the server SIGKILLed every 2.5 to 4 seconds throughout, with a dedicated task hammering upserts from the first accepted connection of each boot to sit inside the JetStream recovery window; then 32 config mutations (overlapping filter subjects, duplicates, a twelve-subject list, an empty-string member, and bogus action values). Result: roughly 31,000 valid-JSON replies checked, about 28,000 successes and 3,000 proper error bodies, and zero invariant violations. Every malformed config produced a well-formed error, never an empty shape. One flagged case turned out to be a bug in my own checker (it demanded a consumer-only field from a stream-create response), which I mention because it shows the harness was actually capable of firing. What this changes: a standalone single-node 2.12.1 appears essentially unable to produce the response shape you saw, even under kill-storms, boot-window races, and config abuse. That narrows your trigger to the things this setup cannot exercise: clustered JetStream (if your compose runs more than one node), something else in your system answering on |
|
Thank you very much for the exhaustive response and the depth of the testing to try to reproduce the issue. Answers to your questions:
For the mitigations, we have already implemented the second one. We have a fallback with Considering that we weren't able to reproduce the issue, neither you with all the tests conducted, nor is there documentation outlining producers of the server condition; I would not be surprised if the error was system-related or caused by a specific environment state as suggested. We will keep you updated if we get the same error (this time with traces). |
Uh oh!
There was an error while loading. Please reload this page.
Hi all!
We use NATS+Jetstream as a message bus for the microservices (Go) in our application. We recently observed a weird state in one of the service consumers, and we are not able to understand why, nor properly reproduce the error.
The microservices (together with NATS server) run inside Docker containers that are managed with docker-compose. It is not unusual for the machine where those run to reboot from time to time. When that happens, the consumers that are on the services are recreated using
CreateOrUpdateConsumer. We recently introduced a consumer that was using ' FilterSubjects ' for the first time for multiple subjects instead of a single one (all the other consumers across all microservices useFilterSubject).After one of those machine restarts, we saw that the
CreateOrUpdateConsumeron that consumer started to fail and return the errorErrConsumerCreationResponseEmptynats: consumer creation response is empty. We did not find any error messages on the NATS server. Restarting the "faulty" microservice did not solve it. The only way to fix it was to tear down and rerun the whole application, including the NATS server withdocker compose down/up.This leads us to think that the error might be related to the
Updatepath of theCreateOrUpdateConsumerrather than theCreatepath, which worked after the tear-down, and potentially be related to the usage ofFilterSubjects,as it has only happened with the only consumer that use it.Do you have any idea of what might be happening? Could it be simply some sort of desynchronization due to the reboot? Sorry for not being able to provide more input, as we are not able to reproduce it. For context:
2.12.11.47.0All reactions