Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-12642

cqlsh NoHostsAvailable/AuthenticationFailure when sourcing a file with COPY commands

    XMLWordPrintableJSON

Details

    • Low

    Description

      In cqlsh, with authentication enabled, when sourcing a file with COPY commands in it:

      test.cql:2:Error for (None, None): Failed to connect to all replicas ['127.0.0.1'] for (None, None), errors: ["NoHostAvailable - ('Unable to connect to any servers', {'127.0.0.1': AuthenticationFailed('Remote end requires authentication.',)})"] (permanently given up after 0 rows and 5 attempts)
      

      cqlsh creates a new Shell without passing all pertinent arguments. When copyutil creates new cluster connections, they are not initialized correctly.

      This is only for the source command. As a workaround, cqlsh -f <script> works, since it does not create a new Shell instance.

      Repro:

      ccm create -v 3.7 -n 1 test
      ccm updateconf "authenticator: PasswordAuthenticator" "authorizer: CassandraAuthorizer"
      ccm start
      
      echo "copy system.local to 'something';" > test.cql
      
      echo "source 'test.cql'" | ccm node1 cqlsh
      

      Attachments

        Activity

          People

            stefania Stefania Alborghetti
            aholmber Adam Holmberg
            Stefania Alborghetti
            Adam Holmberg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: