-
Notifications
You must be signed in to change notification settings - Fork 34
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
Scylla Manager, under certain condition, is unable to use only SSL port (9142) to restore data #4079
Comments
@ppalczak Are there CQL credentials added to the cluster here ? |
@karol-kokoszka from error and repro it's seems clear to me it's not a username/password issue
username and password are sent over the socket/channel once the communication is established , And if you see below the exact same command will succeed when the "--force-tls-disabled=true" is used |
Yes, it was added when adding cluster to SM |
This is a bug in SM implementation. cqlPort := ni.CQLPort()
if ni.ClientEncryptionEnabled && !cluster.ForceTLSDisabled {
if !cluster.ForceNonSSLSessionPort {
cqlPort = ni.CQLSSLPort()
} We pass hosts extended with non-SSL port directly to session creation. // Fill hosts if they weren't specified by the options
if len(cfg.Hosts) == 0 {
sessionHosts, err := GetRPCAddresses(ctx, client, client.Config().Hosts) // <- here we get hosts extended with non-SSL ports
if err != nil {
s.logger.Info(ctx, "Gets session", "err", err)
if errors.Is(err, ErrNoRPCAddressesFound) {
return session, err
}
}
cfg.Hosts = sessionHosts // <- here we set hosts in session cfg
}
ni, err := client.AnyNodeInfo(ctx)
if err != nil {
return session, errors.Wrap(err, "fetch node info")
}
if err := s.extendClusterConfigWithAuthentication(clusterID, ni, cfg); err != nil {
return session, err
}
if err := s.extendClusterConfigWithTLS(ctx, clusterID, ni, cfg); err != nil {
return session, err
}
return gocqlx.WrapSession(cfg.CreateSession()) // GetRPCAddresses accepts client and hosts parameters that are used later on to query client.NodeInfo endpoint
// returning RPC addresses for given hosts.
// RPC addresses are the ones that scylla uses to accept CQL connections.
func GetRPCAddresses(ctx context.Context, client *scyllaclient.Client, hosts []string) ([]string, error) {
var sessionHosts []string
var combinedError error
for _, h := range hosts {
ni, err := client.NodeInfo(ctx, h)
if err != nil {
combinedError = multierr.Append(combinedError, err)
continue
}
sessionHosts = append(sessionHosts, ni.CQLAddr(h)) // <- here we always take non-SSL CQL addr
}
if len(sessionHosts) == 0 {
combinedError = multierr.Append(ErrNoRPCAddressesFound, combinedError)
}
return sessionHosts, combinedError
} This means that the default port set to SSL CQL port is overwritten by the per host non-SSL CQL port. |
scylla-manager and scylla-manager-agent : 3.2.8
Scylla version: 2024.1.9
ISSUE:
While we were testing data restore through SSL (port 9142) we were unable to proceed due to below errors.
The whole cluster nodes are configured to use only SSL(9142 and 9042 is commented in scylla.yaml file in cluster's node).
scylla.yaml config in each scylla node
scylla node does not listen on 9042 port
sctool cluster add : works fine
sctool backup : works fine
sctool restore ... --restore-schema/--restore-tables : it fails with the same error
Even if we provide --ssl-user-cert-file and --ssl-user-key-file, it doesn't seem to be working.
Once we re-enable non-ssl port on scylla node (scylla.yaml), we're hit the following error.
Next step, set --force-tls-disabled=true. Now, it does not complain about TLS anymore.
The text was updated successfully, but these errors were encountered: