Index mirroring not working

When things don't work as they should.
Post Reply
autovate
Posts: 7
Joined: Wed Mar 11, 2020 9:47 pm

Index mirroring not working

Post by autovate »

I've been trying to get the FUSE mount working, every time I try it using-

/opt/mayan-edms/bin/mayan-edms.py mountindex 'company-date' /share/Mayan_INDEX/Companies_by_DATE

I always get the following error -

django.db.utils.OperationalError: no such table: document_indexing_index

I've tried different folders, I've made sure the slug is correct, tried different indexes, same error every time

Any ideas what I'm doing wrong?

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: Index mirroring not working

Post by rosarior »

Code: Select all

django.db.utils.OperationalError: no such table: document_indexing_index

This means Mayan is not being able to connect to the database. Include the environment variables used to connect to the database when attempting to mount the index.

ahbinn
Posts: 2
Joined: Mon Mar 30, 2020 8:39 am

Re: Index mirroring not working

Post by ahbinn »

I tried to run this command:

sudo -u mayan MAYAN_MEDIA_ROOT=/opt/mayan-edms/media MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" /opt/mayan-edms/bin/mayan-edms.py mountindex 'my_index' /home/ahbinn/mirrored_index

it gets stuck there endlessly. Any ideas?

autovate
Posts: 7
Joined: Wed Mar 11, 2020 9:47 pm

Re: Index mirroring not working

Post by autovate »

I get stuck there too

If I try as mayan user I get "fusermount: mounting over filesystem type 0xfe534d42 is forbidden"

If I try as root it just hangs endlessly
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" /opt/mayan-edms/bin/mayan-edms.py mountindex 'company-date' /share/Mayan/Companies-by-date/

/share is a CIFS mount

From the terminal the mayan user is able to create and delete files and folders on the share without issues

Have also tried it with a local folder (both root and mayan users) and still get same results

autovate
Posts: 7
Joined: Wed Mar 11, 2020 9:47 pm

Re: Index mirroring not working

Post by autovate »

Just figured it out! Not sure if it's my stupidity or just not entirely obvious. The hanging was it executing successfully, the mountindex command just doesn't return any output, so adding '&' to the end send it to the background and voila, index mounted!

sudo -u mayan MAYAN_MEDIA_ROOT=/opt/mayan-edms/media MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" /opt/mayan-edms/bin/mayan-edms.py mountindex 'company-date' /home/mayan/index &

#: [1] 49734
#: sudo -u mayan ls /home/mayan/index
#: Mounted files!

autovate
Posts: 7
Joined: Wed Mar 11, 2020 9:47 pm

Re: Index mirroring not working

Post by autovate »

So the CIFS share I have mounted for is for users to be able to scan to the folders and mayan monitors them, which works without issues, mayan is able to delete files as it imports them.

The share is mounted as -

Code: Select all

//10.0.100.17/AVG-Scans /share/         cifs    credentials=/root/.smbcredentials,uid=33,gid=33,rw,nounix,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
Which UID/GID mounts everything as www-data:www-data.

If I try to mount the index on the share as root, it succeeds and I can see the files there from the mayan terminal but so far it doesn't appear anywhere else (I'm not sure it's actually exporting?). The permissions are also root:root, which doesn't seem to be following the CIFS mount options.

If I try the mount as the mayan user I get

Code: Select all

fusermount: mounting over filesystem type 0xfe534d42 is forbidden
If I try to mount it as www-data

Code: Select all

PermissionError: [Errno 13] Permission denied: '/tmp/e81e17f2b46baec16955e498bf3f0981db1c5908c3ad37f0be7c5a62cc32f15e'
The share is hosted on FreeNAS (FreeBSD) and is accessible to Linux and Windows clients, hence the permissions.

Am I doing something wrong? Should I try NFS or share a local fuse mount out? The main reason I was trying to mount directly to the share is to try and eliminate permissions issues.

autovate
Posts: 7
Joined: Wed Mar 11, 2020 9:47 pm

Re: Index mirroring not working

Post by autovate »

I never actually got it working to the network share. I just decided to setup rsync on a cron job to move the indexes to the CIFS share and that's working pretty well for the time being.

Post Reply