javaspring-bootcassandradatastax-astra

cql-proxy: error: must provide either bundle path, token, or contact points


How to resolve this error: cql-proxy: error: must provide either bundle path, token, or contact points This is my docker-compose.yml:

cassandra-service:
    image: datastax/cql-proxy:v0.1.2
    container_name: cassandra-container
    hostname: cassandra-service
    ports:
    - 9042:9042
    networks:
    - clicknrate-network
    restart: always
    volumes:
    - ./secure-connect-clicknrate.zip:/secrets/secure-connect-clicknrate.zip
    environment:
    - ASTRA-TOKEN=AstraCS:********
    - ASTRA-DATABASE-ID=*******
    - ASTRA-API-URL=https://api.astra.datastax.com
    - PORT=9042
    - DATA-CENTER=dc1
    - USERNAME=******
    - PASSWORD=*****
    - KEYSPACE=clicknrate
    - ASTRA-BUNDLE=/secrets/secure-connect-clicknrate.zip
    - CONTACT-POINTS=cassandra-service
    - SCHEMA_ACTION=CREATE_IF_NOT_EXISTS

My application is a java spring boot application running with docker-compose.


Solution

  • The configuration is a bit contradictory - you have a secure bundle path, Astra Database ID and Astra Token - but then you specify a contact point, which would be for using cql-proxy when not connecting to Astra.

    As per the docs (https://github.com/datastax/cql-proxy#configuration)

     -c, --contact-points=CONTACT-POINTS,...                 
    Contact points for cluster. Ignored if using the bundle path 
    or token option ($CONTACT_POINTS).
    

    The error details from the original post are unclear but must provide either bundle path, token, or contact points indicates as above, you are specifying both.

    While it says 'ignored' in the description, thats for a CLI parameter, I'm not sure how the container would react to the variable. If connecting to Astra, remove the contact points environment variable, and provide the full error within the post please.