[Mayan EDMS: 85] [Errno 13] Permission denied: '/document_storage'

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 85] [Errno 13] Permission denied: '/document_storage'

SaintGermain
Hello,

I just installed a checkout of the current state of Mayan EDMS on my
Debian with Apache (in a virtualenv environment).

Everything starts correctly but when trying to upload a document I
got:
Unhandled exception: [Errno 13] Permission denied: '/
document_storage'

After that the database is corrupted (list index out of range) and I
had to flush it.

Do you have some idea of what is going wrong ?
Is it really the DB that got corrupted ?

Thanks,

P.S. : just trying to have a quick view on a very interesting piece of
software. Congratulations anyway to the author to have proposed a DMS
in python (I really love this language).
Reply | Threaded
Open this post in threaded view
|

Re: [Mayan EDMS: 86] [Errno 13] Permission denied: '/document_storage'

rosarior
Administrator
Thanks for trying Mayan EDMS and joining the list.

On 02/07/2012 08:35 PM, SaintGermain wrote:
> Hello,
>
> I just installed a checkout of the current state of Mayan EDMS on my
> Debian with Apache (in a virtualenv environment).
>
> Everything starts correctly but when trying to upload a document I
> got:
> Unhandled exception: [Errno 13] Permission denied: '/
> document_storage'

That's a filesystem permission denial, can be fixed by giving Apache's
user (usually www-data) write and execute permission to the folder where
Mayan and the document_storage folder are located. If that is not
possible for security reasons you can tell Mayan EDMS that the
document_storage and image_cache folders are somewhere else and give
ample permission to the www-data user (/var or /home are good choices)
using the STORAGE_FILESTORAGE_LOCATION and DOCUMENTS_CACHE_PATH

`settings_local.py`
STORAGE_FILESTORAGE_LOCATION='/var/mayan/document_storage'
DOCUMENTS_CACHE_PATH='/var/mayan/documents_cache'

if planning to use digital signatures you can also move the GPG_HOME
directory used to store public keys for verification with the option:
SIGNATURES_GPG_HOME

SIGNATURES_GPG_HOME='/var/mayan/gpg_home'

>
> After that the database is corrupted (list index out of range) and I
> had to flush it.
>
> Do you have some idea of what is going wrong ?
> Is it really the DB that got corrupted ?

Mayan is trying to create the document but since it encountered the
filesystem permission error, the document entry was created on the
database but not pointing to any actual file on the disk.  This is a
sort of naive assumption on the part of Mayan that it will always be
able to create the physical file.  I've been adding transaction
checkpoints and rollbacks to reduce this occurrence in the development
version, soon to be release as 0.12.

>
> Thanks,
>
> P.S. : just trying to have a quick view on a very interesting piece of
> software. Congratulations anyway to the author to have proposed a DMS
> in python (I really love this language).

Thanks!  Hope you find it useful and end up using it as a solution
someday :)
--
Roberto Rosario
GPG key: D210724D


signature.asc (566 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 89] Re: [Errno 13] Permission denied: '/document_storage'

SaintGermain
Hello and thanks for your very quick answer !

On Feb 8, 1:55 am, Roberto Rosario
<[hidden email]> wrote:

> > I just installed a checkout of the current state of Mayan EDMS on my
> > Debian with Apache (in a virtualenv environment).
>
> > Everything starts correctly but when trying to upload a document I
> > got:
> > Unhandled exception: [Errno 13] Permission denied: '/
> > document_storage'
>
> That's a filesystem permission denial, can be fixed by giving Apache's
> user (usually www-data) write and execute permission to the folder where
> Mayan and the document_storage folder are located. If that is not
> possible for security reasons you can tell Mayan EDMS that the
> document_storage and image_cache folders are somewhere else and give
> ample permission to the www-data user (/var or /home are good choices)
> using the STORAGE_FILESTORAGE_LOCATION and DOCUMENTS_CACHE_PATH
>

That is strange because I have given write permission and execute
permission to everybody on the virtualenv (which contains Mayan).
I know that it is not very safe but I wanted to avoid at first these
kind of permission problems.
Can you tell me where this folder is supposed to be by default ? If it
is at the root of the virtualenv, it may be the problem.

>
> > After that the database is corrupted (list index out of range) and I
> > had to flush it.
>
> > Do you have some idea of what is going wrong ?
> > Is it really the DB that got corrupted ?
>
> Mayan is trying to create the document but since it encountered the
> filesystem permission error, the document entry was created on the
> database but not pointing to any actual file on the disk.  This is a
> sort of naive assumption on the part of Mayan that it will always be
> able to create the physical file.  I've been adding transaction
> checkpoints and rollbacks to reduce this occurrence in the development
> version, soon to be release as 0.12.
>

Ok that's very good !
But since I have made a git checkout yesterday, am I not supposed to
work on the development version ?
If yes, how can I check that the rollback is working ?

> > P.S. : just trying to have a quick view on a very interesting piece of
> > software. Congratulations anyway to the author to have proposed a DMS
> > in python (I really love this language).
>
> Thanks!  Hope you find it useful and end up using it as a solution
> someday :)

Sure I hope so.
In the meantime I can always help you improve it.
It seems that I often had some "segmentation fault" while using it
yesterday but I haven't had enough time to debug it. It seems to
happen at the very end of operations. Strangely that didn't affect
operations.

Regards,
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 91] Re: Permission denied: '/document_storage'

SaintGermain
> > > I just installed a checkout of the current state of Mayan EDMS on my
> > > Debian with Apache (in a virtualenv environment).
>
> > > Everything starts correctly but when trying to upload a document I
> > > got:
> > > Unhandled exception: [Errno 13] Permission denied: '/
> > > document_storage'
>
> > That's a filesystem permission denial, can be fixed by giving Apache's
> > user (usually www-data) write and execute permission to the folder where
> > Mayan and the document_storage folder are located. If that is not
> > possible for security reasons you can tell Mayan EDMS that the
> > document_storage and image_cache folders are somewhere else and give
> > ample permission to the www-data user (/var or /home are good choices)
> > using the STORAGE_FILESTORAGE_LOCATION and DOCUMENTS_CACHE_PATH
>
> That is strange because I have given write permission and execute
> permission to everybody on the virtualenv (which contains Mayan).
> I know that it is not very safe but I wanted to avoid at first these
> kind of permission problems.
> Can you tell me where this folder is supposed to be by default ? If it
> is at the root of the virtualenv, it may be the problem.
>

Ok I found it. By default Mayan is trying to write to /
document_storage (at the root of the filesystem).
I manually create this directory and everything is fine now.
This default location is a bit strange, but anyway it works now.

Regards,
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 95] Re: [Errno 13] Permission denied: '/document_storage'

rosarior
Administrator
In reply to this post by SaintGermain
On Wednesday, February 8, 2012 5:10:46 AM UTC-4, SaintGermain wrote:
Hello and thanks for your very quick answer !

On Feb 8, 1:55 am, Roberto Rosario
<roberto.rosario.gonza...@gmail.com> wrote:

> > I just installed a checkout of the current state of Mayan EDMS on my
> > Debian with Apache (in a virtualenv environment).
>
> > Everything starts correctly but when trying to upload a document I
> > got:
> > Unhandled exception: [Errno 13] Permission denied: '/
> > document_storage'
>
> That's a filesystem permission denial, can be fixed by giving Apache's
> user (usually www-data) write and execute permission to the folder where
> Mayan and the document_storage folder are located. If that is not
> possible for security reasons you can tell Mayan EDMS that the
> document_storage and image_cache folders are somewhere else and give
> ample permission to the www-data user (/var or /home are good choices)
> using the STORAGE_FILESTORAGE_LOCATION and DOCUMENTS_CACHE_PATH
>

That is strange because I have given write permission and execute
permission to everybody on the virtualenv (which contains Mayan).
I know that it is not very safe but I wanted to avoid at first these
kind of permission problems.
Can you tell me where this folder is supposed to be by default ? If it
is at the root of the virtualenv, it may be the problem.

>
> > After that the database is corrupted (list index out of range) and I
> > had to flush it.
>
> > Do you have some idea of what is going wrong ?
> > Is it really the DB that got corrupted ?
>
> Mayan is trying to create the document but since it encountered the
> filesystem permission error, the document entry was created on the
> database but not pointing to any actual file on the disk.  This is a
> sort of naive assumption on the part of Mayan that it will always be
> able to create the physical file.  I've been adding transaction
> checkpoints and rollbacks to reduce this occurrence in the development
> version, soon to be release as 0.12.
>

Ok that's very good !
But since I have made a git checkout yesterday, am I not supposed to
work on the development version ?
If yes, how can I check that the rollback is working ?

Git default checkout the master branch only, to create a local development branch that track the upstream one do:

git branch development origin/development
git checkout development
 

To verify that the rollback is working remove the write permission to the document_storage and try to upload a new document, there should be a message indicating the permission error with no new document being added to the database and the DB not getting out of sync.
 
> > P.S. : just trying to have a quick view on a very interesting piece of
> > software. Congratulations anyway to the author to have proposed a DMS
> > in python (I really love this language).
>
> Thanks!  Hope you find it useful and end up using it as a solution
> someday :)

Sure I hope so.
In the meantime I can always help you improve it.
It seems that I often had some "segmentation fault" while using it
yesterday but I haven't had enough time to debug it. It seems to
happen at the very end of operations. Strangely that didn't affect
operations.


The segmentation fault is caused by APS (http://packages.python.org/APScheduler/) when it is shutting down, so far it has only affected deployments in Appsembler.com, would be great if you could tackle this one.
 
Regards,
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 96] Re: Permission denied: '/document_storage'

rosarior
Administrator
In reply to this post by SaintGermain


On Wednesday, February 8, 2012 5:22:34 PM UTC-4, SaintGermain wrote:
> > > I just installed a checkout of the current state of Mayan EDMS on my

> > > Debian with Apache (in a virtualenv environment).
>
> > > Everything starts correctly but when trying to upload a document I
> > > got:
> > > Unhandled exception: [Errno 13] Permission denied: '/
> > > document_storage'
>
> > That's a filesystem permission denial, can be fixed by giving Apache's
> > user (usually www-data) write and execute permission to the folder where
> > Mayan and the document_storage folder are located. If that is not
> > possible for security reasons you can tell Mayan EDMS that the
> > document_storage and image_cache folders are somewhere else and give
> > ample permission to the www-data user (/var or /home are good choices)
> > using the STORAGE_FILESTORAGE_LOCATION and DOCUMENTS_CACHE_PATH
>
> That is strange because I have given write permission and execute
> permission to everybody on the virtualenv (which contains Mayan).
> I know that it is not very safe but I wanted to avoid at first these
> kind of permission problems.
> Can you tell me where this folder is supposed to be by default ? If it
> is at the root of the virtualenv, it may be the problem.
>

Ok I found it. By default Mayan is trying to write to /
document_storage (at the root of the filesystem).
I manually create this directory and everything is fine now.
This default location is a bit strange, but anyway it works now.


The default is document_storage inside the virtualenv because Mayan EDMS maintains a high level of deployment options by assuming as little as possible about certain things such as storage and filesystems, if no StorageClass is defined by the user the safest fallback is the default FileSystemStorage which tries to create the folder in the only place that it should be possible, inside the virtualenv itself on the local disk.
 
Regards,

Thanks!
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 97] Re: Permission denied: '/document_storage'

SaintGermain
> > Ok I found it. By default Mayan is trying to write to /
> > document_storage (at the root of the filesystem).
> > I manually create this directory and everything is fine now.
> > This default location is a bit strange, but anyway it works now.
>
> The default is document_storage inside the virtualenv because Mayan EDMS
> maintains a high level of deployment options by assuming as little as
> possible about certain things such as storage and filesystems, if no
> StorageClass is defined by the user the safest fallback is the
> default FileSystemStorage which tries to create the folder in the only
> place that it should be possible, inside the virtualenv itself on the local
> disk.
>

Oh that is strange because I am running Mayan in a virtualenv (/home/
user/mayan) with the Mayan directory directly in the virtualenv (/home/
user/mayan/mayan).
Reading the documentation, it seems the correct way to do it.
But Mayan is not trying to create document_storage in the virtualenv (/
home/user/mayan/document_storage) but in the root filesystem (/
document_storage).

Do I have to do something special to make Mayan aware of the
virtualenv. Reading the files, I saw a trick with sitedir with some
kind of __FILE__/../../lib/python/site-packages.

Thank again,
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 99] Re: Permission denied: '/document_storage'

SaintGermain
In reply to this post by rosarior
On 9 fév, 07:01, Roberto Rosario <[hidden email]>
wrote:

> > Ok that's very good !
> > But since I have made a git checkout yesterday, am I not supposed to
> > work on the development version ?
> > If yes, how can I check that the rollback is working ?
>
> Git default checkout the master branch only, to create a local development
> branch that track the upstream one do:
>
> git branch development origin/development
> git checkout development
>
> To verify that the rollback is working remove the write permission to the
> document_storage and try to upload a new document, there should be a
> message indicating the permission error with no new document being added to
> the database and the DB not getting out of sync.
>

I switched to the development version with a fresh database.
When trying to access the Documents tab I got this error:
no such table: permissions_storedpermission.
Shall I create the database with something more than just ./manage.py
syncdb ?

Thanks
Reply | Threaded
Open this post in threaded view
|

[Mayan EDMS: 101] Re: Permission denied: '/document_storage'

rosarior
Administrator
Yes, South migrations usage is more extensive now, you have to use:

./manage.py syncdb --migrate

or

./manage.py syncdb
./manage.py migrate


I'm going to revise the logic for the default document_storage folder creation, enforce a true relative path to the virtualenv.

No need to do anything extra on your part, the WSGI file handles the activation of the virtualenv and the setup of the paths.

Thanks