Can't Access Documents After Upgrade to 4.0

When things don't work as they should.
Post Reply
ammar
Posts: 8
Joined: Tue Mar 23, 2021 7:52 pm

Can't Access Documents After Upgrade to 4.0

Post by ammar »

Hello,

I completed the upgrade from 3.5 to 4.0. The upgrade went smoothly without error messaged. The system is working on the new version except that the documents cannot be accessed. mayan-worker-fast-stderr shows the following error message:

mayan.apps.file_caching.models.CachePartitionFile.DoesNotExist: CachePartitionFile matching query does not exist.

I checked the cache and media directories and the files are there. I also purged the caches, but the issue persists.

Any idea how to resolve this?

Thank you.
crypta
Posts: 3
Joined: Sun Jan 24, 2021 11:01 am

Re: Can't Access Documents After Upgrade to 4.0

Post by crypta »

Same here.
tholmes
Posts: 1
Joined: Wed May 19, 2021 6:28 pm

Re: Can't Access Documents After Upgrade to 4.0

Post by tholmes »

I am also seeing this error. I upgraded my container (and manually upgraded the database) running with Docker.

Following the line

Code: Select all

mayan.apps.file_caching.models.CachePartitionFile.DoesNotExist: CachePartitionFile matching query does not exist.
I also see this line:

Code: Select all

FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/mayan/document_file_storage/ca3a722b-2982-4d96-ae31-fdcdd74a88d9'
However, when connected to bash in my container, this file exists:

Code: Select all

root@d69ac21a0774:/# ls -al /var/lib/mayan/document_storage | grep ca3a
-rw-rw-r--+ 1 mayan mayan  197452 Apr 30 15:41 ca3a722b-2982-4d96-ae31-fdcdd74a88d9
But note "document_file_storage" vs "document_storage". This feels like maybe something was missed in the upgrade process documentation? Or was supposed to be automatic?

Edit: I just did a rename to "document_file_storage" and documents are back, visible, with neither the CachePartitionFile nor FileNotFoundError errors in the Mayan logs.
Obelix1981
Posts: 8
Joined: Tue Dec 31, 2019 6:10 am

Re: Can't Access Documents After Upgrade to 4.0

Post by Obelix1981 »

Hello everybody,
I also have the problem that the upgrade process does not run properly and I suspect that the current instructions are incomplete or contain small errors.

I use EDMS as a direct installation and the upgrade process up to version 3.5.8 went perfectly and then I was able to see all the documents.

So far I have been using the published documentation, as shown in the attached file.

The arrows show the way I used to upgrade.

The documentation for the upgrade process to version 4.0 shows commands that cause me errors:

"Update the Redis configuration to keep 3 databases:

Replace:

databases 2

with:

databases 3 "


In my redis.conf there is the entry "databases 16" What should i do?

"Edit the config file at /opt/mayan-edms/media//config.yml:

Replace:

MAYAN_LOCK_MANAGER_BACKEND = "redis: // ..."
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS = ...

with:

MAYAN_LOCK_MANAGER_BACKEND = "mayan.apps.lock_manager.backends.redis_lock.RedisLock"
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS = "{'redis_url': 'redis: //: mayanredispassword@172.17.0.1: 6379"


does not exist in my config.yml.

There is the entry: "LOCK_MANAGER_BACKEND: mayan.apps.lock_manager.backends.file_lock.FileLock" and "LOCK_MANAGER_BACKEND_ARGUMENTS: {}" What do I have to do here?

Can someone help me please?

thx
Attachments
Bildschirmfoto 2021-05-20 um 21.40.39.png
Bildschirmfoto 2021-05-20 um 21.40.39.png (220.66 KiB) Viewed 278 times
User avatar
michael
Developer
Developer
Posts: 135
Joined: Sun Apr 19, 2020 6:21 am

Re: Can't Access Documents After Upgrade to 4.0

Post by michael »

Hello:
"Update the Redis configuration to keep 3 databases:

Replace:

databases 2

with:

databases 3

In my redis.conf there is the entry "databases 16" What should i do?
This means you missed an upgrade from a previous installation. Redis must serve at least 3 databases. If your setting has 16 (Redis default) that will work too but you might waste a bit of memory on 13 other database that are not going to be used. Set the value to 3.
"Edit the config file at /opt/mayan-edms/media//config.yml:

Replace:

MAYAN_LOCK_MANAGER_BACKEND = "redis: // ..."
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS = ...

with:

MAYAN_LOCK_MANAGER_BACKEND = "mayan.apps.lock_manager.backends.redis_lock.RedisLock"
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS = "{'redis_url': 'redis: //: mayanredispassword@172.17.0.1: 6379"

does not exist in my config.yml.

There is the entry: "LOCK_MANAGER_BACKEND: mayan.apps.lock_manager.backends.file_lock.FileLock" and "LOCK_MANAGER_BACKEND_ARGUMENTS: {}" What do I have to do here?
This typo was fixed but does not show yet on the documentation until a new build is triggered. It now reads:

Replace:

LOCK_MANAGER_BACKEND = "..."
LOCK_MANAGER_BACKEND_ARGUMENTS = "..."

with:

LOCK_MANAGER_BACKEND = "mayan.apps.lock_manager.backends.redis_lock.RedisLock"
LOCK_MANAGER_BACKEND_ARGUMENTS = "{'redis_url': 'redis: //: mayanredispassword@172.17.0.1: 6379"

Perform those two changes and let us know how it went.

Cheers!
Obelix1981
Posts: 8
Joined: Tue Dec 31, 2019 6:10 am

Re: Can't Access Documents After Upgrade to 4.0

Post by Obelix1981 »

Hi, thanks for your reply.

i tested the following:
check the current versions:
- Mayan-EDMS = 3.5.8
- Redis-Server = 5.0.7
- psycopq2 = 2.8.4

then i do this:
#sudo systemctl stop supervisor
#sudo -u mayan /opt/mayan-edms/bin/pip install -U pip (upgrade from 21.1.1 to 21.1.2)
#sudo cp /etc/supervisor/conf.d/mayan-edms.conf /etc/supervisor/conf.d/mayan-edms.conf.bck
#sudo -u mayan /opt/mayan-edms/bin/pip install redis==3.5.3 psycopg2==2.8.6
#echo "requirepass mayanredispassword" | sudo tee -a /etc/redis/redis.conf
#echo "databases 3" | sudo tee -a /etc/redis/redis.conf
#echo "maxmemory-policy allkeys-lru" | sudo tee -a /etc/redis/redis.conf
#sudo systemctl restart redis
#sudo -u mayan curl https://gitlab.com/mayan-edms/mayan-edm ... movals.txt -o /tmp/removals.txt && sudo -u mayan /opt/mayan-edms/bin/pip uninstall -y -r /tmp/removals.txt
#sudo -u mayan /opt/mayan-edms/bin/pip install mayan-edms==4.0.1
#sudo -u mayan mkdir /opt/mayan-edms/media/user_settings
#sudo -u mayan mkdir --parents /opt/mayan-edms/media/
#sudo -u mayan touch /opt/mayan-edms/media/__init__.py
#sudo nano /opt/mayan-edms/media/config.yml
Replace:
MAYAN_LOCK_MANAGER_BACKEND = "redis: // ..."
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS = ...
with:
MAYAN_LOCK_MANAGER_BACKEND: mayan.apps.lock_manager.backends.redis_lock.RedisLock
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS= {'redis_url':'redis://:mayanredispassword@127.0.0.1:6379/2'}

In my case it was important to leave out the quotation marks (") and to set the IP address of the Redis server to the correct IP address.
#sudo -u mayan MAYAN_MEDIA_ROOT=/opt/mayan-edms/media/ /opt/mayan-edms/bin/mayan-edms.py performupgrade
#sudo systemctl start supervisor

Open my Firefoxbrowser http://ip-server:8000 an login with my credetials

All Documents flaged with an red X and i can´t access the documents... :(

ok next:

#sudo systemctl stop supervisor
#sudo nano /etc/supervisor/conf.d/mayan-edms.conf
check all entries... -> ok close nano
#sudo nano /opt/mayan-edms/media/config.yml
Replace these entries:
DOCUMENTS_CACHE_STORAGE_BACKEND -> DOCUMENTS_FILE_PAGE_IMAGE_CACHE_STORAGE_BACKEND
DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS -> DOCUMENTS_FILE_PAGE_IMAGE_CACHE_STORAGE_BACKEND_ARGUMENTS
DOCUMENTS_STORAGE_BACKEND -> DOCUMENTS_FILE_STORAGE_BACKEND
DOCUMENTS_STORAGE_BACKEND_ARGUMENTS -> DOCUMENTS_FILE_STORAGE_BACKEND_ARGUMENTS
Check DOCUMENTS_FILE_PAGE_IMAGE_CACHE_STORAGE_BACKEND_ARGUMENTS in my case location: /opt/mayan-edms/media/document_file_page_image_cache
check DOCUMENTS_FILE_STORAGE_BACKEND_ARGUMENTS in my case location: /opt/mayan-edms/media/document_file_storage
#sudo mv document_cache document_file_page_image_cache
#sudo mv document_storage document_file_storage
as a precaution #sudo reboot
Open my Firefoxbrowser http://ip-server:8000 an login with my credetials
All Documents also flaged with an red X and i can´t access the documents... :(
ok next:
check in mayan-edms under "SYSTEM" -> "FACILITY" -> "SETTINGS" -> "DOCUMENTS" the entries: DOCUMENTS_FILE_PAGE_IMAGE_CACHE_STORAGE_BACKEND_ARGUMENTS and DOCUMENTS_FILE_STORAGE_BACKEND_ARGUMENTS
In my case the entries not correct, i don´t know why... ok i type the correct locations in these entries.
ok as a precaution #sudo systemctl restart supervisor
close firefoxbrowser and reopen with my edms url and logged in with my credentials...

And now i see all my documents correctly... and can access to this... perfect... i am so happy... :) :)

But after upgrading, I see a translation error. Since I use EDMS in German, the entry "Recently created" on the left navigation bar is not translated into German. Can I enter this manually somewhere? And what I also noticed: the left navigation bar becomes independent and automatically switches to the "folded version".
Attachments
navleiste2.PNG
navleiste2.PNG (10.48 KiB) Viewed 231 times
navleiste1.PNG
navleiste1.PNG (16.71 KiB) Viewed 231 times
bwakkie
Posts: 38
Joined: Fri Feb 14, 2020 8:28 pm

Re: Can't Access Documents After Upgrade to 4.0

Post by bwakkie »

Had the same problem!
I have a direct install and my media folder and mayan are in non standard places e.g.:

/data/mayan/media/..
/data/mayan/media/static/..
/data/mayan37/lib/python3.7/site-packages/...
/data/mayan38/lib/python3.8/site-packages/...
/data/mayan39/lib/python3.9/site-packages/...

I only needed to ...

mv document_cache document_file_page_image_cache
mv document_storage document_file_storage

... in the media folder.

thanks @Obelix1981
gytoth67
Posts: 5
Joined: Wed Dec 02, 2020 3:23 pm

Re: Can't Access Documents After Upgrade to 4.0

Post by gytoth67 »

Yes, this solution works for me as well:
mv document_cache document_file_page_image_cache
mv document_storage document_file_storage
Thank you!
Bastian
Posts: 17
Joined: Tue Dec 04, 2018 6:18 pm

Re: Can't Access Documents After Upgrade to 4.0

Post by Bastian »

Hi @all

thanks for the tip.
Renaming the two folders solved the problem for me as well.

Best regards
Bastian
User avatar
michael
Developer
Developer
Posts: 135
Joined: Sun Apr 19, 2020 6:21 am

Re: Can't Access Documents After Upgrade to 4.0

Post by michael »

But after upgrading, I see a translation error. Since I use EDMS in German, the entry "Recently created" on the left navigation bar is not translated into German. Can I enter this manually somewhere? And what I also noticed: the left navigation bar becomes independent and automatically switches to the "folded version".
You can submit the missing translations via Mayan's project at Transifex. => https://www.transifex.com/rosarior/mayan-edms/
It is free to join. Just create an account and join the German team. We have registered a Google Translate API key which will help by giving you an initial translation that then you can tweak.

More detail about this in the documentation chapter => https://docs.mayan-edms.com/chapters/de ... tions.html
Post Reply