Mayan EDMS 2.7.3 and document_analyzer not working

218 views
Skip to first unread message

Eddi

unread,
Jun 6, 2018, 11:07:25 AM6/6/18
to Mayan EDMS
Hi,

I am running Mayan EDMS 2.7.3 on Ubuntu 14. I also tried to install document_analyzer. I pulled the doc_analyzer from https://gitlab.com/startmat/document_analyzer.

When enter the info in local.py as stated under the install section, Mayan EDMS does not work after a reboot or restart of the services.

This is what I entered in local.py:
INSTALLED_APPS += (
    'document_analyzer',
)


When running mayan-edms.py migrate, I get the following error message:

root@Mayan2:/usr/share/mayan-edms/bin# ./mayan-edms.py migrate
Traceback (most recent call last):
  File "./mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named document_analyzer


I also have installed the exiftool software installed and its functioning properly.

How can I fix this issue to have document_analyzer running?

Thanks.

Eddi

Eddi

unread,
Jun 6, 2018, 11:24:39 AM6/6/18
to Mayan EDMS
Hi,

me again. After changing the APPS section in the local.py file to this (removing of the comma after document_analyzer):
INSTALLED_APPS += (
    'document_analyzer'
)

Then I ran the mayan-edms.py migrate again and get this message now:
root@Mayan2:/usr/share/mayan-edms/bin# ./mayan-edms.py migrate
Traceback (most recent call last):
  File "./mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 316, in execute
    settings.INSTALLED_APPS
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/conf/__init__.py", line 53, in __getattr__
    self._setup(name)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
    self._wrapped = Settings(settings_module)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/conf/__init__.py", line 97, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/settings/__init__.py", line 6, in <module>
    from .local import *  # NOQA
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/settings/local.py", line 21, in <module>
    'document_analyzer'
TypeError: can only concatenate tuple (not "unicode") to tuple

I hope this helps Matthias to better understand the problem and advise.

Thanks.

Eddi

Matthias Löblich

unread,
Jun 7, 2018, 3:25:07 AM6/7/18
to Mayan EDMS
Hi Eddi,
looks like the "django app-loader" can not find document_analyzer module.

Have you created the link from the mayan/apps folder to the document_analyzer folder ?

Like that:

cd /yourmayanroot/apps
ln -s /yourgitroot/document_analyzer/document_analyzer/ .

br
Matthias

Eduard Freiter

unread,
Jun 7, 2018, 7:48:40 AM6/7/18
to mayan...@googlegroups.com
Hi Matthias,

Thanks for your response.

I did not create a link but rather copied the document_analyzer folder into the Mayan/apps folder. Is a link required?

Regards,

Eduard Freiter
--

---
You received this message because you are subscribed to a topic in the Google Groups "Mayan EDMS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mayan-edms/dWfo8N_gg-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mayan-edms+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eddi

unread,
Jun 7, 2018, 9:44:12 AM6/7/18
to Mayan EDMS
Hi Matthias,

I followed you advice and created a link to the analyzer. Now when I run mayan-edms.py migrate, it seems to find the document_analyzer app, but it sill does not add it and breaks Mayan EDMS.

This is what I get:
root@Mayan2:/usr/share/mayan-edms# bin/mayan-edms.py migrate
Traceback (most recent call last):
  File "bin/mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/config.py", line 116, in create
    mod = import_module(mod_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/document_analyzer/apps.py", line 8, in <module>
    from documents.models import Document, DocumentVersion
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/documents/models.py", line 17, in <module>
    from acls.models import AccessControlList
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/acls/models.py", line 5, in <module>
    from django.contrib.contenttypes.fields import GenericForeignKey
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/contrib/contenttypes/fields.py", line 5, in <module>
    from django.contrib.contenttypes.models import ContentType
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/contrib/contenttypes/models.py", line 138, in <module>
    class ContentType(models.Model):
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/db/models/base.py", line 105, in __new__
    app_config = apps.get_containing_app_config(module)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 237, in get_containing_app_config
    self.check_apps_ready()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 124, in check_apps_ready
    raise AppRegistryNotReady("Apps aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.


I hope this helps. Thank you for assisting!!!

Eddi

Matthias Löblich

unread,
Jun 7, 2018, 10:55:26 AM6/7/18
to mayan...@googlegroups.com
Hi Eddi,
is there now a link or a copy of the apps folder ?

If you comment out the "document_analyzer" from settings, is it working ?


br
Matthias

--

---
You received this message because you are subscribed to a topic in the Google Groups "Mayan EDMS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mayan-edms/dWfo8N_gg-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mayan-edms+unsubscribe@googlegroups.com.

Eddi

unread,
Jun 7, 2018, 11:01:08 AM6/7/18
to Mayan EDMS
I removed the copy I previously created and created a link as you advised in your previous post. See here:
drwxr-xr-x  5 www-data www-data  41 May 23 21:58 django_gpg/
lrwxrwxrwx  1 www-data www-data  46 Jun  7 13:07 document_analyzer -> /root/git/document_analyzer/document_analyzer//
drwxr-xr-x  5 www-data www-data  27 May 23 21:58 document_comments/

When "cd" into the document_analyser folder, this is the content I see:
root@Mayan2:/usr/share/mayan-edms# ll mayan/apps/document_analyzer/
total 31
drwxr-xr-x 5 www-data www-data   21 Jun  7 13:08 ./
drwxr-xr-x 6 www-data www-data   15 Jun  6 14:15 ../
-rw-r--r-- 1 www-data www-data  334 Jun  6 14:15 __init__.py
-rw-r--r-- 1 www-data www-data  597 Jun  7 13:08 __init__.pyc
-rw-r--r-- 1 www-data www-data  433 Jun  6 14:15 admin.py
-rw-r--r-- 1 www-data www-data 3691 Jun  6 14:15 apps.py
-rw-r--r-- 1 www-data www-data 3811 Jun  7 13:08 apps.pyc
drwxr-xr-x 2 www-data www-data    6 Jun  6 14:15 backends/
-rw-r--r-- 1 www-data www-data  967 Jun  6 14:15 classes.py
-rw-r--r-- 1 www-data www-data  217 Jun  6 14:15 handlers.py
-rw-r--r-- 1 www-data www-data 1730 Jun  6 14:15 links.py
-rw-r--r-- 1 www-data www-data  125 Jun  6 14:15 literals.py
-rw-r--r-- 1 www-data www-data 1181 Jun  6 14:15 managers.py
drwxr-xr-x 2 www-data www-data    6 Jun  6 14:15 migrations/
-rw-r--r-- 1 www-data www-data 2298 Jun  6 14:15 models.py
-rw-r--r-- 1 www-data www-data  935 Jun  6 14:15 permissions.py
-rw-r--r-- 1 www-data www-data  935 Jun  6 14:15 settings.py
-rw-r--r-- 1 www-data www-data 2598 Jun  6 14:15 tasks.py
drwxr-xr-x 2 www-data www-data    7 Jun  6 14:15 tests/
-rw-r--r-- 1 www-data www-data 1300 Jun  6 14:15 urls.py
-rw-r--r-- 1 www-data www-data 5601 Jun  6 14:15 views.py

When I comment out "document_analyzer" from settings/local.py, Mayan starts working after restarting the services.

Hope this helps.

Eddi
To unsubscribe from this group and all its topics, send an email to mayan-edms+...@googlegroups.com.

Matthias Löblich

unread,
Jun 7, 2018, 11:21:27 AM6/7/18
to mayan...@googlegroups.com
one time you are doing:
root@Mayan2:/usr/share/mayan-edms/bin# ./mayan-edms.py migrate
the other time:
root@Mayan2:/usr/share/mayan-edms# bin/mayan-edms.py migrate

what is the command which starts mayan succesfull (without document_analyzer)
what is in your PYTHONPATH ?
which python version are you using ?
which mayan version are you using ?
which django version are you using ?



To unsubscribe from this group and all its topics, send an email to mayan-edms+unsubscribe@googlegroups.com.

Eddi

unread,
Jun 7, 2018, 11:31:16 AM6/7/18
to Mayan EDMS
The first time I am in the "mayan-edms/bin" directory executing mayan-edms.py migrate and the second time I am in "mayan-edms" and than I have to specify the path to mayan-edms.py whitch is in the "bin" directory. Just a matter from where I try to execute the mayan-edms.py. I also could have "cd" into the bin directory and than ran ./mayan-edms.py instead of bin/mayan-edms.py. Hope this makes sense, the result is the same.

I have installed ubuntu 14.4 with the latest updates and than followed the instructions from the mayan-edms main site and installed the Mayan-EDMS 2.7.3. Whatever the default python and django versions are when installing Mayan, thats what is used. Same applies to PYTHONPATH and the command that starts Mayan. I have not changed anything from the default installation.

To restart Mayan, I just reboot.

PS: I would love to answer your questions more specific, bu I do not know, how to get the specific version etc.

Eddi

Matthias Löblich

unread,
Jun 7, 2018, 11:38:54 AM6/7/18
to mayan...@googlegroups.com
please cd into the document_analyzer folder and do an:

git remote -v



To unsubscribe from this group and all its topics, send an email to mayan-edms+unsubscribe@googlegroups.com.

Eddi

unread,
Jun 7, 2018, 11:41:24 AM6/7/18
to Mayan EDMS

Matthias Löblich

unread,
Jun 7, 2018, 11:45:55 AM6/7/18
to mayan...@googlegroups.com
Ok, you are not using the latest version of document analyzer.

To unsubscribe from this group and all its topics, send an email to mayan-edms+unsubscribe@googlegroups.com.

Eddi

unread,
Jun 7, 2018, 12:19:00 PM6/7/18
to Mayan EDMS
Well, I thought I did use that repo, but I guess not ...

Now its:

When running "mayan-edms.py migrate", it looks like it has worked:
Operations to perform:
  Apply all migrations: acls, actstream, admin, auth, authtoken, autoadmin, cabinets, checkouts, common, contenttypes, converter, django_gpg, djcelery, document_analyzer, document_comments, document_indexing, document_parsing, document_signatures, document_states, documents, dynamic_search, events, linking, lock_manager, mailer, mayan_statistics, metadata, motd, ocr, permissions, sessions, sites, sources, tags
Running migrations:
  Applying document_analyzer.0001_initial... OK
  Applying document_analyzer.0002_auto_20160116_1620... OK
  Applying document_analyzer.0003_auto_20160117_2152... OK
  Applying document_analyzer.0004_auto_20171021_2017... OK

However, after a reboot, Mayan EDMS does not start. When opening the website, I get "Internal Server Error".

This are the entries in /var/log/mayan/beat-stderr.log:
Traceback (most recent call last):
  File "/usr/share/mayan-edms/bin/mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named document_analyzer

This is the output of "worker-stderr.log":
Traceback (most recent call last):
  File "/usr/share/mayan-edms/bin/mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named document_analyzer

When I comment out "document_analyzer" from the "local.py" file and reboot, than Mayan does work again.

Thank you for your assistance, it is MUCH appreciated!!!

Eddi

Eddi

unread,
Jun 7, 2018, 3:25:11 PM6/7/18
to Mayan EDMS
I dug a bit deeper and found what PYTHONPATH is. Here is the output:

/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages

Thanks.

Matthias Löblich

unread,
Jun 7, 2018, 3:36:21 PM6/7/18
to mayan...@googlegroups.com
Plesaes sen me the link to the mayan install documentation you followed to install. I need to understand your setup.

To unsubscribe from this group and all its topics, send an email to mayan-edms+unsubscribe@googlegroups.com.

Eddi

unread,
Jun 7, 2018, 3:49:44 PM6/7/18
to Mayan EDMS

Hi,

 

I am on Ubuntu 14.04-trusty. I followed these steps to install mayan: http://mayan.readthedocs.io/en/latest/topics/deploying.html

Following these steps, I did not experience any issues. Everything was working as expected after I finished the installation.

 

One more thing I tried, is, instead restarting the OS, I restarted the services. When I run "supervisorctl start", I get this output:

mayan-uwsgi: started
mayan-worker: ERROR (abnormal termination)
mayan-beat: ERROR (abnormal termination)

When checking the log file for "worker" and "beat", I get the error message as I have posted above.

 

Cheers.

Eddi

unread,
Jun 7, 2018, 5:24:48 PM6/7/18
to Mayan EDMS
Matthias,

I have a production Mayan-EDMS 2.7.3 installation running in a VM (proxmox 4.4-22). I cloned the VM, so that I can try adding the document_analyzer to that installation.

The details are:
Its Debian 8.8 Jessie. The initial VM was created using the TurnKey system (LXC container). The version used in TrunKey is Mayan-EDMS 2.2 and I upgraded that to Mayan 2.7.3.

When follow your steps, I can run "mayan-edms.py" migrate and here is the output:
Operations to perform:
  Apply all migrations: acls, actstream, admin, auth, authtoken, autoadmin, cabinets, checkouts, common, contenttypes, converter, django_gpg, djcelery, document_analyzer, document_comments, document_indexing, document_parsing, document_signatures, document_states, documents, dynamic_search, events, linking, lock_manager, mailer, mayan_statistics, metadata, motd, ocr, permissions, sessions, sites, sources, tags
Running migrations:
  Applying document_analyzer.0001_initial... OK
  Applying document_analyzer.0002_auto_20160116_1620... OK
  Applying document_analyzer.0003_auto_20160117_2152... OK
  Applying document_analyzer.0004_auto_20171021_2017... OK
The following content types are stale and need to be deleted:

    ocr | documentpagecontent

Any objects related to these content types by a foreign key will also
be deleted. Are you sure you want to delete these content types?
If you're unsure, answer 'no'.

    Type 'yes' to continue, or 'no' to cancel: no (also tried yes)
(Just as a side note, I tried answering with "YES" at a previous test run, but the end results are the same.)

After doing all the steps you show in the README, I get the same errors when starting the services:
Traceback (most recent call last):
  File "/usr/share/mayan-edms/bin/mayan-edms.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
    utility.execute()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute
    django.setup()
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/share/mayan-edms/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named document_analyzer

PYTHONPATH:
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/pymodules/python2.7

DJANGO version is: 1.10.7

Python version:
2.7.9 (default, Jun 29 2016, 13:08:31)
[GCC 4.9.2]

Bottom line, I get the same result on 2 installations. Both have Mayan-EDMS 2.7.3 installed, and document_analyzer fails to start and breaks Mayan from starting.

I hope that helps.

Thanks.

Eddi


On Thursday, June 7, 2018 at 1:36:21 PM UTC-6, Matthias Löblich wrote:

Matthias Löblich

unread,
Jun 8, 2018, 2:40:12 AM6/8/18
to mayan...@googlegroups.com
Is it possible that you have a permission problem:

you run: mayan-edms.py" migrate as root -> which is working

and the supervisor is running as www-data

does have www-data have the access rights to the document_analizer folder over the link ?


To unsubscribe from this group and all its topics, send an email to mayan-edms+unsubscribe@googlegroups.com.

Eduard Freiter

unread,
Jun 8, 2018, 7:55:42 AM6/8/18
to mayan...@googlegroups.com
Hi Matthias,

Yes the supervisor has access to the document analyzer folder.

I changed the ownership on that folder to wwwdata to make sure there is no permission issue.

On my production installation of Mayan, Mayan and document analyzer is running as root, but document analyzer does also not work and Mayan does not start when the Apps entry is in local.py.

Eddi

Eddi

unread,
Jun 8, 2018, 12:57:32 PM6/8/18
to Mayan EDMS
I copied the document_analyzer/document_analyzer folder into .../mayan/apps/ and assigned wwwdata owernship.

after a reboot, document analyzer was working ...

Thanks for your help. Not sure, why the link is not working ...
Reply all
Reply to author
Forward
0 new messages