You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jacob Fenwick (Created) (JIRA)" <ji...@apache.org> on 2012/03/16 18:33:43 UTC

[jira] [Created] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Debian package does not create /var/lib/cassandra/data
------------------------------------------------------

                 Key: CASSANDRA-4058
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
             Project: Cassandra
          Issue Type: Bug
          Components: Packaging
         Environment: Ubuntu 11.10
            Reporter: Jacob Fenwick


I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging

When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data

The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.

I would assume the data directory should have been created with the correct permissions, but it was not.

However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.

So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Brandon Williams (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams resolved CASSANDRA-4058.
-----------------------------------------

    Resolution: Not A Problem

I don't think papering over a problem a user has caused is a good idea, since they are possibly doing something they don't intend to.
                
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Jacob Fenwick (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231747#comment-13231747 ] 

Jacob Fenwick edited comment on CASSANDRA-4058 at 3/17/12 12:11 AM:
--------------------------------------------------------------------

Ok, admittedly, I think I may have already created those directories the first time I ran the package.
I tried installing the package on a different computer and it worked, setting the directories to the correct permissions.
However... I removed the package using apt-get remove, checked to see that /var/lib/cassandra was gone (which it was), removed /var/lib/cassandra (because it was still there), then reinstalled the package.
This time the directories had root as the owner.
How could the behavior change like that between two installs of the package?
                
      was (Author: jfenwick):
    Ok, admittedly, I think I may have already created those directories the first time I ran the package.
I tried installing the package on a different computer and it worked, setting the directories to the correct permissions.
However... I removed the package using apt-get remove, checked to see that /var/lib/cassandra was gone (which it was), removed /var/lib/cassandra (because it was still there), then reinstalled the package.
This time the packages had root as the owner.
How could the behavior change like that between two installs of the package?
                  
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Jacob Fenwick (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231667#comment-13231667 ] 

Jacob Fenwick commented on CASSANDRA-4058:
------------------------------------------

If you take the position that the users are required to set up data_file_directories, commitlog_directory, and saved_caches_directory manually, then yes it is a user caused problem as they didn't follow the documentation.

However, my observation is that a lot of packages make their default install have a basic working state that does not require additional system configuration.

If you look at a Debian package like MySQL, which also stores its data files in /var/lib by default, they use these sorts of permissions:
drwxr-s--- 2 mysql adm

I don't think it's unreasonable to set up permissions like that for the user automatically, but maybe there's something subtle about cassandra that I'm missing.
                
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Jacob Fenwick (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacob Fenwick reopened CASSANDRA-4058:
--------------------------------------


I found a fix that works.
If you change the ownership of the directory /var/lib/cassandra to cassandra:

sudo chown -R cassandra:cassandra /var/lib/cassandra

Then Cassandra will be able to create the directories.

When installed from the Debian package, by default, /var/lib/cassandra has these permissions:
drwxr-xr-x  5 root     root 

So either the directory has to be set so users besides the owner can read and execute in the directory, or the user that cassandra uses needs to own the directory.

/var/log/cassandra also has this issue as the output.log complains that system.log can't be created.
That issue can be fixed by running:

sudo chown -R cassandra:cassandra /var/log/cassandra

Seems like it should be an easy fix in the Debian package. If you think this is the right fix and is worth fixing I can probably look at it.
                
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Brandon Williams (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brandon Williams resolved CASSANDRA-4058.
-----------------------------------------

    Resolution: Not A Problem

Cassandra itself will create this directory if it doesn't exist.  You likely have a problem in a directory higher up in the hierarchy making it inaccessible.
                
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Jacob Fenwick (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231747#comment-13231747 ] 

Jacob Fenwick commented on CASSANDRA-4058:
------------------------------------------

Ok, admittedly, I think I may have already created those directories the first time I ran the package.
I tried installing the package on a different computer and it worked, setting the directories to the correct permissions.
However... I removed the package using apt-get remove, checked to see that /var/lib/cassandra was gone (which it was), removed /var/lib/cassandra (because it was still there), then reinstalled the package.
This time the packages had root as the owner.
How could the behavior change like that between two installs of the package?
                
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4058) Debian package does not create /var/lib/cassandra/data

Posted by "Brandon Williams (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13231731#comment-13231731 ] 

Brandon Williams commented on CASSANDRA-4058:
---------------------------------------------

My point is that the 'cassandra' user's home directory is /var/lib/cassandra, so it should already own it when the package creates this user.  If you ahead of time create this directory with the wrong permissions, that is your mistake to correct, not the package's to solve with brute force.
                
> Debian package does not create /var/lib/cassandra/data
> ------------------------------------------------------
>
>                 Key: CASSANDRA-4058
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4058
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>         Environment: Ubuntu 11.10
>            Reporter: Jacob Fenwick
>
> I installed Cassandra using the Debian packages as described here: http://wiki.apache.org/cassandra/DebianPackaging
> When trying to start Cassandra using /etc/init.d/cassandra start I get this error: java.io.IOError: java.io.IOException: unable to mkdirs /var/lib/cassandra/data
> The directory /var/lib/cassandra exists, but the directory /var/lib/cassandra/data does not.
> I would assume the data directory should have been created with the correct permissions, but it was not.
> However, I tried creating /var/lib/cassandra/data and setting it the permissions to 666 and setting the user/group to cassandra/cassandra, and now I get this error:
> java.lang.AssertionError: Directory /var/lib/cassandra/data is not accessible.
> So what could possibly be the problem here?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira