Closed HazemElAgaty closed 1 year ago
Hey @HazemElAgaty,
Are you sure you are providing the right password then? I know it sounds trivial but it happens more than you might think.
Also, version 1.0.2
is a year old. Even if I'm positive persistent subscriptions to all were working back then, would you consider moving to the latest version of the client and retry? Currently, it's version 3.0.0
@YoEight Thanks a lot for the quick response. I double checked the credentials being used yes, but I just noticed that I am using an old version. I will upgrade the sdk and try again.
@YoEight After upgrading the pkg to the latest version, the error has changed to "Unauthenticated" although I am passing the admin credentials as shown below.
creds := &esdb.Credentials{
Login: "admin",
Password: "changeit",
}
persistentSubsOptions := esdb.PersistentAllSubscriptionOptions{
Filter: &esdb.SubscriptionFilter{Type: esdb.StreamFilterType, Prefixes: []string{string(account.AccountAggregateType)}},
Authenticated: creds,
}
logger.Log.Info("creating persistent subscription..")
err := db.CreatePersistentSubscriptionToAll(ctx, SubsGroupName, persistentSubsOptions)
error when creating reading server features from the best candidate 'xxx.eventstore.cloud:2113': rpc error: code = Unauthenticated desc = Unauthenticated
Hey @HazemElAgaty ,
After some investigation, based on how cloud clusters are set up, you'll need to be authenticated prior to even start issuing commands. I suggest you to configure your default credentials at the connection string level like shown below:
esdb.ParseConnectionString("esdb+discover://{login}:{password}@xxx.eventstore.cloud")
You won't need to be pass the Authenticated
setting later on either.
@YoEight Thanks a lot, it worked now.
Pkg Version
v1.0.2
ES Version
v21.10.8 using the cloud solution
Problem
Whenever I try subscribing to the stream using the pkg, I end up with
PermissionDenied
error. I am using the default admin credentials.Would you please tell me what I might be doing wrong?