Version 3.5.7

Released: March 28, 2021

Status: Stable

Changes

Backports

Ensure all tasks are properly configured. Added a check to the task manager app to ensure all defined tasks are properly configure in their respective queues.py modules.

Fixed the inverted names of the dynamic search task used during queue registration.

Updated the generic views to raise exceptions on object creation and edit during testing.

Updated the overloaded .save() method used for testing pass the original arguments to the super class call. Scrapping the arguments was hiding some errors during testing.

Added a test for communication with the locking backend when the app loads.

Added support for purging RedisLock backend locks. Prefix all locks in the RedisLock backend to avoid name clashing when using the same Redis database for multiple purposes.

Ensure the default timeout setting is used by all the backends.

Docker

Updated the Docker base image from debian:10.7-slim to debian:10.8-slim.

Updated the Docker Compose file to allow specifying a different database host as well as a different image tag for the Mayan, PostgreSQL and Redis containers.

Added the fuse package to the Docker image.

Updated the Docker Compose file to load an env file.

Added a default env_file with some examples uses.

LDAP

Updated the sample LDAP settings file to add note about package version pinning required by the use of the Buster Backports.

The package list for MAYAN_APT_INSTALLS for the LDAP setting file is now “gcc libldap2-dev/buster-backports libsasl2-dev python3-dev”.

Logging

Ensure logging is available early. Moved the logging init to the logging app and moved the logging app to the top of the app list.

Metadata

The behavior of the bulk metadata edit was updated. Previously, a validation was raised when the metadata update checkbox was disabled for a required metadata. This was changed to not raise a validation error if the metadata already has a value which would comply with the original purpose of required metadata feature.

Make the metadata type id usage more explicit in formsets. Instead of just using a field named id, the metadata form now uses a more readable metadata_type_id name.

Migrations

Updated the file caching migration 0005 to have Django generate the SQL query for each respective backend. This solved an upgrade issue when using MySQL.

Task manager

Moved the task manager app to the top of the installed apps. This ensures all queues are created before any other app tries to use them. This fixes the sporadic upgrade error: celery.exceptions.QueueNotFound: “Queue ‘default’ missing from task_queues”

Added connectivity check for the Celery broker URL and the result backend settings.

Testing

Backport multiple test document types code. This makes it easier to create multiple test document types for the tests that use them.

Other

Removals

  • None

Upgrading process

Upgrading from Mayan EDMS 3.2.x or earlier

  1. Stop supervisord:

    sudo systemctl stop supervisor
    
  2. Update the Redis configuration:

    Configure Redis to discard data when it runs out of memory, not save its database, and only keep 2 database:

    echo "maxmemory-policy allkeys-lru" | sudo tee -a /etc/redis/redis.conf
    echo "save \"\"" | sudo tee -a /etc/redis/redis.conf
    echo "databases 2" | sudo tee -a /etc/redis/redis.conf
    echo "requirepass mayanredispassword" | sudo tee -a /etc/redis/redis.conf
    sudo systemctl restart redis
    
  3. Install the Python 3 development OS package:

    sudo apt-get install python3-dev
    
  4. Update the virtualenv to use Python 3:

    sudo -u mayan virtualenv --clear /opt/mayan-edms -p /usr/bin/python3
    
  5. Create a home directory for the Mayan EDMS system user:

    mkdir /home/mayan
    
  6. Grant ownership to the Mayan EDMS system user:

    chown mayan:mayan /home/mayan
    
  7. Reinstall the Python client for PostgreSQL and Redis:

    sudo -u mayan /opt/mayan-edms/bin/pip install psycopg2==3.2.3 redis==5.0.7
    

    Note

    Platforms with the ARM CPU might also need additional requirements:

    sudo -u mayan /opt/mayan-edms/bin/pip install psutil==5.8.0
    
  8. Reinstall the Python client for RabbitMQ if you are using RabbitMQ as a broker:

    sudo -u mayan /opt/mayan-edms/bin/pip install amqp==5.2.0
    

Upgrading from Mayan EDMS 3.4.x or 3.3.x

  1. Stop supervisord:

    sudo systemctl stop supervisor
    
  2. Upgrade to the latest pip version:

    sudo -u mayan /opt/mayan-edms/bin/pip install -U pip
    
  3. Update the Redis configuration to enable password protection:

    echo "requirepass mayanredispassword" | sudo tee -a /etc/redis/redis.conf
    sudo systemctl restart redis
    
  4. Remove deprecated requirements:

    sudo -u mayan curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt -o /tmp/removals.txt \
    && sudo -u mayan /opt/mayan-edms/bin/pip uninstall -y -r /tmp/removals.txt
    
  5. Update the Mayan EDMS Python package:

    sudo -u mayan /opt/mayan-edms/bin/pip install mayan-edms==3.5.7
    

    the requirements will also be updated automatically.

  6. Make a backup of your supervisord file:

    sudo cp /etc/supervisor/conf.d/mayan-edms.conf /etc/supervisor/conf.d/mayan-edms.conf.bck
    
  7. Update the supervisord configuration file. Replace the environment variables values show here with your respective settings. This step will refresh the supervisord configuration file with the new queues and the latest recommended layout:

    sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
    MAYAN_DATABASE_PASSWORD=mayandbpass MAYAN_DATABASE_USER=mayan \
    MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media/ \
    /opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord | sudo sh -c "cat > /etc/supervisor/conf.d/mayan-edms.conf"
    

    or:

    sudo -u mayan MAYAN_DATABASES=\"{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayandbpass','USER':'mayan','HOST':'127.0.0.1'}}\" \
    MAYAN_MEDIA_ROOT=/opt/mayan-edms/media/ \
    /opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord | sudo sh -c "cat > /etc/supervisor/conf.d/mayan-edms.conf"
    
  8. Edit the supervisord configuration file and update any setting specific to your installation:

    sudo vi /etc/supervisor/conf.d/mayan-edms.conf
    
  9. Migrate existing database schema and static media files with:

    sudo -u mayan MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
    MAYAN_DATABASE_PASSWORD=mayandbpass MAYAN_DATABASE_USER=mayan \
    MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media/ \
    /opt/mayan-edms/bin/mayan-edms.py performupgrade
    

    or:

     sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayandbpass','USER':'mayan','HOST':'127.0.0.1'}}" \
     MAYAN_MEDIA_ROOT=/opt/mayan-edms/media/ \
    /opt/mayan-edms/bin/mayan-edms.py performupgrade
    
  10. Start supervisord:

    sudo systemctl start supervisor
    
  11. Clear the browser cache to avoid loading old web assets.

The upgrade procedure is now complete.

Issues closed