Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cassandra data dir test fails when directory exists #10

Open
alexbarta opened this issue Jan 12, 2019 · 4 comments
Open

Cassandra data dir test fails when directory exists #10

alexbarta opened this issue Jan 12, 2019 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@alexbarta
Copy link
Contributor

Hi Maor,

I'm running into this error. Cain fails saying that data directory does not exists, when actually it exists.

kubectl run cassandra-restore  --rm --labels='app=cassandra' --serviceaccount='cassandra-backup' -i --tty --restart=Never --image-pull-policy=IfNotPresent --image nuvo/cain:0.5.1 --env 'AWS_ACCESS_KEY_ID=admin' --env 'AWS_SECRET_ACCESS_KEY=******' --env 'AWS_S3_NO_SSL=true' --env 'AWS_S3_FORCE_PATH_STYLE=true' --env 'AWS_S3_ENDPOINT=http://minio-svc.default.svc.cluster.local:9000' --command -- sh
If you don't see a command prompt, try pressing enter.
~ $ export CAIN_CASSANDRA_DATA_DIR="/var/lib/cassandra/data"
~ $ cain restore --src 's3://db-backup/cassandra/default/tb-cluster' -n default -k tb -l 'app=cassandra' -t 20190112212203 --schema e9bce4
2019/01/12 22:06:46 Restore started!
2019/01/12 22:06:46 Getting clients
2019/01/12 22:06:46 Getting pods
2019/01/12 22:06:46 Testing existence of data dir
2019/01/12 22:06:46 /var/lib/cassandra/data does not exist. error in Stream: container cassandra is not valid for pod cassandra-restore

my cassandra-0 pod path

$ kubectl exec -it cassandra-0 -- ls /var/lib/cassandra
commitlog  data  hints  saved_caches

when running older versions I'm not getting the cassandra data dir error..

Regards

@maorfr
Copy link
Contributor

maorfr commented Jan 13, 2019

Hey Alex,

It seems that the restore process tried to restore in to itself.
Try doing the same, but run the restore pod with different labels from the cassandra pod.
For example:

kubectl run cassandra-restore  --rm --labels='app=cassandra-cain' --serviceaccount='cassandra-backup' -i --tty --restart=Never --image-pull-policy=IfNotPresent --image nuvo/cain:0.5.1 --env 'AWS_ACCESS_KEY_ID=admin' --env 'AWS_SECRET_ACCESS_KEY=******' --env 'AWS_S3_NO_SSL=true' --env 'AWS_S3_FORCE_PATH_STYLE=true' --env 'AWS_S3_ENDPOINT=http://minio-svc.default.svc.cluster.local:9000' --command -- sh

@maorfr maorfr added the question Further information is requested label Jan 13, 2019
@maorfr maorfr self-assigned this Jan 13, 2019
@alexbarta
Copy link
Contributor Author

Yes, I'm an idiot :( Thanks Maor

@maorfr
Copy link
Contributor

maorfr commented Jan 13, 2019

Not at all!
In fact, this can and should be more visible to the user.

For example, if cain printed out the list of pods that it found, you would have seen this right away!

Would you like to submit a PR to implement this behavior? ;)

cc @hagaibarel, do you approve?

@alexbarta
Copy link
Contributor Author

Sure why not! At moment I'm struggling with backup/restore of more complex schemas.. I have found other cryptic error messages.. I will raise separate issues for those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants