Why does cassandra cqlsh responds : Trigger class 'mypackage.myclass' couldn't be loaded

Viewed 35

I have created a trigger class 'mypackage.myclass' that works fine on standard cassandra container. I have packaged everything under a single jar file in /etc/cassandra/triggers/my-fat-jar.jar (permissions are root 644)

However, when I deploy that same container under Red Hat OpenShift CP, that trigger cannot be loaded. It is simply saying:

ā€˜<stdin>:1:InvalidRequest: Error from server: code=2200 [Invalid query] message="Trigger class 'mypackage.myclass' couldn't be loaded"’

I have no clue where that error could come from.. Would you have any idea where to look at ?

Thank you.

Versions used: [cqlsh 6.0.0 | Cassandra 4.0.1 | CQL spec 3.4.5 | Native protocol v5]

1 Answers

It's hard to be certain without seeing how you are building the image and the file permissions in more detail, but since it appears that it might be a file permissions issue you might be running into a problem with Openshift security policies regarding arbitrary user ids. In theory the 644 permission should mean that this isn't a problem, but perhaps the arbitrary user is having trouble accessing the directory itself.

(Also, depending on what you have in your Dockerfile, you could try adding the anyuid SCC just to verify if this is the cause of your issue.)

In general, I'd walk through the OpenShift platform-specific guidelines because that will give you specific instructions on making sure your file permissions will work.

I'd also just use oc debug to get a shell in the problematic container and just verify access to the relevant directories/files.

Related