Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
Mayan EDMS
Mayan EDMS
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 173
    • Issues 173
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 9
    • Merge requests 9
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Mayan EDMS
  • Mayan EDMSMayan EDMS
  • Issues
  • #829

Closed
Open
Created Jun 12, 2020 by Brandon W@ancientskyscraper

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's services/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.
  • Run up command with custom project name: docker-compose --file docker-compose.yml --project-name mayan_ref up --detach

Upload test.pdf using Mayan's web interface

  • 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

Edited Jun 12, 2020 by Brandon W
Assignee
Assign to
Version 4.1
Milestone
Version 4.1
Assign milestone
Time tracking
None
Due date
None