Hello I was debuging a pulsar code, and I was working perfectly, but one time after a re-execution of the code suddenly show a error, of when try to connect:
Loading .env environment variables...
0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 INFO [0000-00-00 00:00:00.000 ERROR [0000-00-00 00:00:00.000 ERROR [Traceback (most recent call last):
File "/home/user/USB/Services/back-worker/src/app.py", line 11, in <module>
0000-00-00 00:00:00.000 ERROR [0000-00-00 00:00:00.000 ERROR [0000-00-00 00:00:00.000 INFO [ from services.pulsar import consumer
File "/home/user/USB/Services/back-worker/src/services/__init__.py", line 3, in <module>
0000-00-00 00:00:00.000 INFO [ from .pulsar import consumer
File "/home/user/USB/Services/back-worker/src/services/pulsar/__init__.py", line 21, in <module>
consumer = pulsar.Client(
File "/home/user/USB/Services/back-worker/.venv/lib/python3.10/site-packages/pulsar/__init__.py", line 748, in subscribe
c._consumer = self._client.subscribe(topic, subscription_name, conf)
_pulsar.ServiceUnitNotReady: Pulsar error: ServiceUnitNotReady
How can I solve and reconnect again?
Thanks
It often happens when the namespace bundle is being unloaded, or the owner of the topic is changed. The broker logs will show the details of why the service unit is not ready. It looks like this:
For the client side, it should redo the topic lookup, instead of exposing the
ServiceUnitNotReady
to users.I'm not sure which Python client version you are using. It would be ideal to create a GitHub issue Pulsar repo, so that we can track the issue, and so we can make sure fixed in the next version.