1

I m facing issue while starting cassandra . I am using Datastax version. When I start cassandra , it is closing with below issue.

ERROR [main] 2017-08-10 20:42:04,999 CassandraDaemon.java:654 - Exception  encountered during startup
org.apache.cassandra.io.FSWriteError: java.nio.file.AccessDeniedException: C:\Program Files\DataStax Community\data\commitlog\CommitLog-5-1502421528137.log
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:131) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:148) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.db.commitlog.CommitLogSegmentManager.recycleSegment(CommitLogSegmentManager.java:365) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.db.commitlog.CommitLog.recover(CommitLog.java:165) ~[apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:284) [apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:532) [apache-cassandra-2.2.8.jar:2.2.8]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:641) [apache-cassandra-2.2.8.jar:2.2.8]
Caused by: java.nio.file.AccessDeniedException: C:\Program Files\DataStax Community\data\commitlog\CommitLog-5-1502421528137.log
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) ~[na:1.7.0_40]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[na:1.7.0_40]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[na:1.7.0_40]
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) ~[na:1.7.0_40]
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) ~[na:1.7.0_40]
at java.nio.file.Files.delete(Files.java:1077) ~[na:1.7.0_40]
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:125) ~[apache-cassandra-2.2.8.jar:2.2.8]
... 6 common frames omitted

I tried to keep all permissions to the below folder and restarted many times .

C:\Program Files\DataStax Community\data

But still getting same error , I am using windows 10 .

Please suggest .

Samson Maben
  • 310
  • 2
  • 4
  • 15
user2883028
  • 173
  • 6
  • 19

2 Answers2

3

I got the same issue and in my case, the source was in the incompatible JRE version in the run configuration of executable code.

I've solved a problem with replacing 11.0.2 JRE version to 1.8.0_181

Here is a doc, where you can ensure about Cassandra compatibility.

  • I'm getting this error with Cassandra Unit 3.11.2.0, on Windows 10 Enterprise build 17763 and JRE 1.8.0_181-b13. – vmaldosan Feb 13 '20 at 14:24
2

Some ideas to try or look at:

  • Any anti virus scanning in background in windows needs to setup exclusions to your data directories or it can cause this
  • This may be an intermittent issue that isnt fixed because it hasnt been easy to reproduce. (CASSANDRA-9414) There are not many Cassandra users using Windows so it can have more rough edges. If possible you may want to consider a Linux host which gets more testing/use (not most helpful answer I know)
    • Try upgrading to more recent version or switch to Linux
  • Check the file permissions on C:\Program Files\DataStax Community\data\commitlog\CommitLog-5-1502421528137.log. You can possibly either change the permissions on that file or delete that commitlog and do a repair to make sure you didnt trigger any inconsistencies.
    • Something to look for in particular is the user who owns the file. There are a lot of tools like sstablesplit, sstablelevelreset, sstableexpiredblockers, sstablemetadata, sstable2json which will run cassandra in client mode using your cassandra.yaml. Since it has overlapping data and commitlog locations and it does somethings that trigger internal writes (sstable activity table in particular) it can end up flushing a commitlog or creating new sstables with whatever user ran the tool. If that user is different than the one that is used to run Cassandra it can cause failures like that one. Tools are slowly getting rewritten to make this less of an issue (ie sstabledump, 4.0 sstablemetadata) but if you use these tools issues like this is something to look out for.
Chris Lohfink
  • 16,150
  • 1
  • 29
  • 38
  • I tried with some options, commit logs is not getting deleted .. but I did it forcibly using MCAFEE shred option and files got deleted. But they are created with new timestamp when windows restarted , and when I started the cassandra , it gave me same issue back . As final try , i might need to install new cassandra version if not I have to try in linux . – user2883028 Aug 16 '17 at 05:42
  • any chance Cassandra doesnt have permissions to write into `C:\Program Files\DataStax Community\data\commitlog` ? – Chris Lohfink Aug 16 '17 at 14:07
  • As mentioned, I uninstalled existing datastax version and installed another datastax version and different JDK , and that combination worked . Thanks everyone for all your time. – user2883028 Aug 18 '17 at 05:37