narayana.jayanthi_191238 avatar image
narayana.jayanthi_191238 asked bettina.swynnerton commented

Why can't my Python app from the workshop connect to Astra using keyspace 'killrvideocluster'?


i followed the instructions... still no luck.. the zip file is in this location

SECURE_CONNECT_BUNDLE = '/workspace/cassandra-workshop-series/week3-AppDev-crud/'

when i execute, i have no errors.. for any other files, i get connection object error.

Attached is the error for your reference

Start exercise
Closing connection (up to 10s)
Traceback (most recent call last):
File "/workspace/cassandra-workshop-series/week3-AppDev-crud/crud-python/", line 17, in <module>
NameError: name 'connection' is not defined

Output making the changes to as per advice from Bettina:

Start exercise
("Unable to connect to any servers using keyspace 'killrvideocluster'", [''])
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

bettina.swynnerton avatar image
bettina.swynnerton answered bettina.swynnerton commented

We should have implemented some better error messages to troubleshoot these connection issues in more detail.

Please make the following change in the except block in the python code for, this should give you a much better idea where this is failing:

except Exception as e:

Don't forget to save, this catches me out sometimes on gitpod, no auto-save.

The error you posted points to the keyspace name:

"Unable to connect to any servers using keyspace 'killrvideocluster'"

In our workshop we generally use the name killrvideo for the keyspace, but you have something else set up. Once you fix the keyspace name, the app should work.

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

narayana.jayanthi_191238 avatar image narayana.jayanthi_191238 commented ·

Many thanks... It worked. I replaced killrvideocluster with killrvideo.. I have provided cluster name instead of keyspace name.. my mistake... Your help is highly appreciated... I am able to execute the files

1 Like 1 ·
bettina.swynnerton avatar image bettina.swynnerton ♦♦ commented ·

perfect, happy to hear that this is working now. Thanks for staying with it!

0 Likes 0 ·