archmangler commented on issue #12003:
URL: https://github.com/apache/pulsar/issues/12003#issuecomment-1089863711

   ```
   reader-fd3917723f, 0] Failed to create consumer: BrokerPersistenceError
   ```
   
   I have also been getting this error consistently and can reproduce it by:
   
   1. Running the Golang client reader once to connect to pulsar.
   2. Cancelling the client
   3. Try rerun the client
   
   Error:
   
   ```
   root@pulsar-toolset-0:/pulsar/development# ./pulse | tee read.log
   
   2022/04/06 06:12:51.392 c_client.go:68: [info] INFO  | ConnectionPool:84 | 
Created connection for pulsar://pulsar-broker.pulsar.svc.cluster.local:6650
   2022/04/06 06:12:51.398 c_client.go:68: [info] INFO  | ClientConnection:364 
| [192.168.4.54:57668 -> 192.168.3.74:6650] Connected to broker
   2022/04/06 06:12:51.402 c_client.go:68: [info] INFO  | HandlerBase:54 | 
[persistent://ragnarok/transactions/requests, reader-fd3917723f, 0] Getting 
connection from pool
   2022/04/06 06:12:51.404 c_client.go:68: [info] INFO  | ConnectionPool:84 | 
Created connection for 
pulsar://pulsar-broker-0.pulsar-broker.pulsar.svc.cluster.local:6650
   2022/04/06 06:12:51.405 c_client.go:68: [info] INFO  | ClientConnection:364 
| [192.168.4.54:57670 -> 192.168.3.74:6650] Connected to broker
   2022/04/06 06:12:51.409 c_client.go:68: [info] WARN  | ClientConnection:971 
| [192.168.4.54:57670 -> 192.168.3.74:6650] Received error response from 
server: BrokerPersistenceError -- req_id: 0
   2022/04/06 06:12:51.409 c_client.go:68: [info] ERROR | ConsumerImpl:263 | 
[persistent://ragnarok/transactions/requests, 
   reader-fd3917723f, 0] Failed to create consumer: BrokerPersistenceError
   2022/04/06 06:12:51 Could not create reader: Failed to create Reader: 
BrokerPersistenceError
   ```
   
   Here is my client (run on  the pulsar tool container)
   
   ```
   package main
   
   import (
           "context"
           "fmt"
           "log"
   
           "github.com/apache/pulsar/pulsar-client-go/pulsar"
   )
   
   func main() {
           // Instantiate a Pulsar client
           client, err := pulsar.NewClient(pulsar.ClientOptions{
                   URL: "pulsar://pulsar-broker.pulsar.svc.cluster.local:6650",
           })
   
           if err != nil {
                   log.Fatalf("Could not create client: %v", err)
           }
   
           // Use the client to instantiate a reader
           reader, err := client.CreateReader(pulsar.ReaderOptions{
                   Topic:          "ragnarok/transactions/requests",
                   StartMessageID: pulsar.EarliestMessage,
           })
   
           if err != nil {
                   log.Fatalf("Could not create reader: %v", err)
           }
   
           defer reader.Close()
   
           ctx := context.Background()
   
           // Listen on the topic for incoming messages
           for {
   
                   msg, err := reader.Next(ctx)
   
                   if err != nil {
                           log.Fatalf("Error reading from topic: %v", err)
                   } else {
                           fmt.Println(msg)
                   }
           }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to