FreeBSD Installation will not start

Reverse proxies, SSL termination, web servers, helm charts, integrations, batch files, anything having to do with installing Mayan.
Post Reply
boybert
Posts: 7
Joined: Fri Sep 21, 2018 4:37 pm

FreeBSD Installation will not start

Post by boybert »

Hi all,

I am trying to install Mayan EDMS in a FreeBSD jail on a FreeNAS 11.2 system. I was able to successfully follow all the steps in the Advanced Deployment section of the documentation.

When I start Supervisord, however, all of the processes except mayan-gunicorn immediately fail. I checked the logs in /tmp and all of the processes report the following error over and over again:

Code: Select all

Error loading: *; while scanning an alias
  in "<unicode string>", line 1, column 1:
    *
    ^
I have limited Python knowledge so I'm kind of learning as I go, but this seems like a pretty fundamental problem must be happening; can anyone point me in the right direction as to how to troubleshoot?

Thanks!

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: FreeBSD Installation will not start

Post by rosarior »

I think we missed a changed in the documentation.

The MAYAN_ALLOWED_HOSTS setting changed format.

Before: MAYAN_ALLOWED_HOSTS="*",

Now: MAYAN_ALLOWED_HOSTS='["*"]',

Change that in the supervisor file and it should work.

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: FreeBSD Installation will not start

Post by rosarior »

The wiki was updated but we forgot the documentation steps: https://wiki.mayan-edms.com/index.php?t ... deployment

Thanks for the heads up, we'll do a micro release to update the docs.

boybert
Posts: 7
Joined: Fri Sep 21, 2018 4:37 pm

Re: FreeBSD Installation will not start

Post by boybert »

That was it! Thanks so much for the quick help. Happy to inadvertently contribute.

Thanks to your help, I'm closer but still not quite up and running. mayan-celery-beat still won't start. I see some DB-related messages in its log that I'm not sure how to address:

Code: Select all

/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/common/apps.py:90: UserWarning: Your database backend is set to use SQLite. SQLite should only be used for development and testing, not for production.
warnings.warn(force_text(MESSAGE_SQLITE_WARNING))
[2018-09-21 20:15:12,398: CRITICAL/MainProcess] beat raised exception <class 'django.db.utils.OperationalError'>: OperationalError('unable to open database file',)
I wonder if I don't have some configuration correct... I confirmed the supervisor config says:

Code: Select all

MAYAN_DATABASE_ENGINE=django.db.backends.postgresql
I assume sqlite shouldn't be in the picture; is there somewhere else I should be looking?

Thanks again!

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: FreeBSD Installation will not start

Post by rosarior »

Awesome, I'm looking forward to your feedback on running Mayan on a BSD system. Check that all the lines in the supervisor environment section end with a comma except the last one. Also make sure all have 4 spaces at the beginning.

boybert
Posts: 7
Joined: Fri Sep 21, 2018 4:37 pm

Re: FreeBSD Installation will not start

Post by boybert »

Thank you Roberto! Indeed, there were some formatting problems in the supervisor config. With those fixes and a couple other tweaks, now I've got the system stood up. :D

I am able to perform most operations and can upload documents, but the OCR and thumbnail/page preview jobs seem to be failing. In the logs (and in the OCR Errors view) I see a lot of mentions of 'NoneType' object has no attribute 'mode' but am having a hard time tracking down the culprit. Perhaps I have the wrong version of a dependency or another incomplete configuration?

Here's an excerpt from the mayan-worker-fast stderr log:

Code: Select all

[2018-09-24 13:06:22,498: ERROR/Worker-1] Error creating page cache file "page-cache-1f938865-660c-4e5b-816c-e85318447dc9-71-43"; 'NoneType' object has no attribute 'mode'
[2018-09-24 13:06:22,500: ERROR/MainProcess] Task documents.tasks.task_generate_document_page_image[e373751a-0c89-46a7-9d2a-b1bb3e228d86] raised unexpected: AttributeError("'NoneType' object has no attribute 'mode'",)
Traceback (most recent call last):
  File "/opt/mayan-edms/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/mayan-edms/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/documents/tasks.py", line 86, in task_generate_document_page_image
    return document_page.generate_image(*args, **kwargs)
  File "/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/documents/models.py", line 843, in generate_image
    image = self.get_image(transformations=transformation_list)
  File "/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/documents/models.py", line 949, in get_image
    page_image = converter.get_page()
  File "/opt/mayan-edms/lib/python2.7/site-packages/mayan/apps/converter/classes.py", line 193, in get_page
    new_mode = self.image.mode
AttributeError: 'NoneType' object has no attribute 'mode'
I'll be happy to feedback about my experience on FreeBSD and I was thinking I could write a guide for FreeBSD/FreeNAS jail installation and setup once everything's good to go. So far so good, the interface is very snappy and assuming I can get all the features working I think FreeNAS is a great place for a Mayan EDMS installation to live.

Thanks, Roberto, for being so helpful to a noob!

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: FreeBSD Installation will not start

Post by rosarior »

Glad to hear!

It seems the image generator is encountering an unexpected exception. This could mean an issue with Pillow the Python image library of the system dependencies of it (libpng-dev, libjpeg-dev, libtiff-dev). Could also mean an issue with the PDF to image convert binary pdftoppm which is part of the the Poppler-utils OS package. Check that libmagic is installed as Mayan uses it to determine the file type of documents from their content itself and not from their extensions. Check the output during the Pillow installation, it think that is the most likely culprit since graphics libraries are location dependent and change between OS and even architectures of the same OS and Pillow doesn't always find them.

If the issue is Pillow not being to find the graphics libraries you can use a symbolic link as a quick remedy. An example on the issue when using ARM CPUs: https://gitlab.com/mayan-edms/mayan-edm ... erfile#L63

User avatar
rosarior
Developer
Developer
Posts: 522
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: FreeBSD Installation will not start

Post by rosarior »

That would be a welcomed addition! The Wiki is open so feel free to add content at any time: https://wiki.mayan-edms.com/index.php?title=Main_Page

boybert
Posts: 7
Joined: Fri Sep 21, 2018 4:37 pm

Re: FreeBSD Installation will not start

Post by boybert »

Thanks again Roberto so much for your kind help.

Turns out Mayan wasn't finding pdftoppm, as you suggested, so all it needed was a symbolic link to /usr/bin (the binary is in /usr/local/bin as I installed it from the package manager).

Of course, I wish I had checked that first instead of going down lots of other Poppler and Pillow rabbit holes :? but I learned a lot!

Now that I'm fully (I think!) up and running, soon I'll start again from scratch in another jail and document the process for your wiki. Thanks again and I look forward to diving in with getting my system set up.

Post Reply