After ugprading a Cassandra 5.x server from Debian 12 (Bookworm) to Debian 13 (Trixie), everything seemed to run fine. nodetool commands were working, nodetool status showed the cluster, including the upgraded node up. Great!
But when I tried to use cqlsh (the CLI for working with the Cassandra keyspaces, comparable to mysql cli), the following error showed up:
ck@cassandra:~# cqlsh -u cassandra -p secret 127.0.0.1
Warning: unsupported version of Python, required 3.6-3.11 but found 3.13
Warning: unsupported version of Python, required 3.6-3.11 but found 3.13
No appropriate Python interpreter found.
A quick research led to bug CASSANDRA-20997, which confirms that the deb packages are not yet made for Debian 13.
Any update on the deb packages working on Debian 13?
The reason for the compatibility issue is that cqlsh breaks on Python 3.13 due to a removed stdlib module. The fix exists in draft form but hasn't been merged and released yet, so the official .deb packages still don't work cleanly on Debian 13.
Luckily there's a workaround.
The cqlsh command can also be found on pypi as separate pypi package. This means we can install cqlsh using pip3:
ck@cassandra:~# sudo apt-get install python3-pip
ck@cassandra:~# sudo pip3 install cqlsh --break-system-packages
Now you've got two cqlsh commands on the system:
ck@cassandra:~# whereis cqlsh
cqlsh: /usr/bin/cqlsh /usr/local/bin/cqlsh
The latter, /usr/local/bin/cqlsh, is the newly installed command from pypi.
And this one's working:
ck@cassandra:~# /usr/local/bin/cqlsh -u cassandra -p secret 127.0.0.1
Warning: Using a password on the command line interface can be insecure.
Recommendation: use the credentials file to securely provide the password.
WARNING: cqlsh was built against 5.0.0, but this server is 5.0.8. All features may not work!
ATTENTION: All commands will be saved to history file: /root/.cassandra/cqlsh_history
This may include sensitive information such as passwords.
To disable history, use --disable-history or set 'disabled = true' in the [history] section of cqlshrc.
See https://cassandra.apache.org/doc/latest/tools/cqlsh.html for more information.
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.2.2 | Cassandra 5.0.8 | CQL spec 3.4.7 | Native protocol v5]
Use HELP for help.
As an alternative you could also set up a Python venv with a lower version (Python 3.12 for example) and use the original cqlsh command in there.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Observability Office OpenSearch PHP Perl Personal PostgreSQL PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Znuny Zoneminder