Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-5877

Unclear FileNotFoundException stacktrace when system.log can't be created

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Won't Fix
    • None
    • None
    • None
    • Cassandra 2.0rc1

    • Low

    Description

      When you start Cassandra with default settings without the appropriate permissions to write in /var/log/cassandra you end up with the following stacktrace:

      log4j:ERROR setFile(null,true) call failed.
      java.io.FileNotFoundException: /var/log/cassandra/system.log (No such file or directory)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:127)
      	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
      	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:207)
      	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
      	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
      	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
      	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
      	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:809)
      	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:735)
      	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:615)
      	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:502)
      	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:395)
      	at org.apache.log4j.PropertyWatchdog.doOnChange(PropertyConfigurator.java:922)
      	at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
      	at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
      	at org.apache.log4j.PropertyWatchdog.<init>(PropertyConfigurator.java:914)
      	at org.apache.log4j.PropertyConfigurator.configureAndWatch(PropertyConfigurator.java:461)
      	at org.apache.cassandra.service.CassandraDaemon.initLog4j(CassandraDaemon.java:121)
      	at org.apache.cassandra.service.CassandraDaemon.<clinit>(CassandraDaemon.java:69)
      

      While a stacktrace at startup may not be the most elegant mean of communication with the user - though at least it's visible - in this situation it doesn't make it clear that Cassandra couldn't create a file in the specified log directory.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mfiguiere Michaël Figuière
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: