Index mirror does not allow access to documents
Index mirror does not allow access to documents
When an index is mirrored, there is a filesystem that represents the structure of the index (per pp. 165--165 of Exploring Mayan EDMS). However, individual documents cannot be read because they are reported as 0 bytes (empty):
root@572b11a50b64:/# ls -la /index_creation_date/2020/06
total 0
dr-xr-xr-x 2 root root 0 Jun 11 21:45 .
dr-xr-xr-x 2 root root 0 Jun 11 21:45 ..
-r-xr-xr-x 1 root root 0 Jun 11 21:43 test.pdf
root@572b11a50b64:/# file /index_creation_date/2020/06/test.pdf
/index_creation_date/2020/06/test.pdf: empty
test.pdf
is not readable because it is 0 bytes. When I try to open the file with a PDF reader, I get an "Unable to Open Document (no such file or directory)" error.
Expected behavior
Expected behavior is that the index mirror should report the actual size of the document and allow the file to be accessed via the filesystem, something like this:
doe@myworkstation:~/Desktop$ # File that I uploaded to Mayan EDMS
doe@myworkstation:~/Desktop$ ls -la test.pdf
-rw-rw-r-- 1 doe doe 3908 Jun 11 15:55 test.pdf
doe@myworkstation:~/Desktop$ file test.pdf
test.pdf: PDF document, version 1.2
To reproduce the issue
Create a reference installation
- Follow directions at https://docs.mayan-edms.com/chapters/docker/install_docker_compose.html
- Modify default
docker-compose.yml
file'sservices/app
portion- Change port to
"180:8000"
(to get it to work on my system) - Add additional options to enable FUSE to work (required for mirroring):
cap_add: # Allows mount of FUSE filesystem + SYS_ADMIN devices: # Enables the FUSE filesystem, which is required for Mayan to mirror an index + "/dev/fuse:/dev/fuse" security_opt: # Allows access to FUSE filesystem + apparmor:unconfined
-
Note: The full
docker-compose.yml
file I'm using is attached to this issue ticket.
- Change port to
- Run
up
command with custom project name:docker-compose --file docker-compose.yml --project-name mayan_ref up --detach
test.pdf
using Mayan's web interface
Upload - Use temporary admin login (fresh installation)
- Click Documents > New document
- Select "Default" document type, click Next step
- Leave language option at default value ("English") and leave "Expand compressed files" unchecked
- Click on "click here to upload files," select
test.pdf
from local hard drive (~/Desktop
folder on my system) - Verify the test document is visible in index
- Click "Indexes," then "Creation date" (this index is created automatically at installation), then navigate to document
- Verify document preview is visible, and click the "Properties" tab in the document view; verify file size is greater than zero (it is 3.8 KB on my system)
-
Note: The full
test.pdf
file I'm using is also attached to this issue ticket (I've tried with multiple files and they all have the same result, though).
Log into the Mayan container's terminal
doe@myworkstation:~/Desktop$ docker exec -it mayan_ref_app_1 /bin/bash
- Use this terminal for the rest of the commands
Mirror the "Creation date" index
- Install fuse:
sudo apt-get update; sudo apt-get install fuse
- Create the mount point:
mkdir /index_creation_date
- Execute
mountindex
command:/opt/mayan-edms/bin/mayan-edms.py mountindex creation_date /index_creation_date &
Check file size from the terminal
root@572b11a50b64:/# ls -la /index_creation_date/2020/06
total 0
dr-xr-xr-x 2 root root 0 Jun 11 21:45 .
dr-xr-xr-x 2 root root 0 Jun 11 21:45 ..
-r-xr-xr-x 1 root root 0 Jun 11 21:43 test.pdf
root@572b11a50b64:/# file /index_creation_date/2020/06/test.pdf
/index_creation_date/2020/06/test.pdf: empty
test.pdf
is reported as an empty file, 0 bytes, in the file system, even though it is listed as 3.8 KB and is viewable through the web interface.test.pdf