1

Topic: Internal Server Error FreeBSD 10.4 & 11.1

hi zhang,
i tried Fresh Install on FreeBSD 10.4 & 11.1 for LDAP based. But i get same errors on both Version of FreeBSD.
is this a bug?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.97
- Linux/BSD distribution name and version: FreeBSD 10.4 & 11.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.


i get from log :

root@mail:/usr/home/andy # tail -f /var/log/httpd-error.log
[Thu Feb 01 19:57:21.580165 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]   File "/usr/local/www/iredadmin/controllers/ldap/basic.py", line 11, in <module>
[Thu Feb 01 19:57:21.580178 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]     from libs.ldaplib import auth, decorators, admin as adminlib, ldaputils
[Thu Feb 01 19:57:21.580190 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]   File "/usr/local/www/iredadmin/libs/ldaplib/admin.py", line 7, in <module>
[Thu Feb 01 19:57:21.580201 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]     from libs.ldaplib import core, attrs, ldaputils, iredldif, deltree, connUtils, decorators
[Thu Feb 01 19:57:21.580214 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]   File "/usr/local/www/iredadmin/libs/ldaplib/deltree.py", line 5, in <module>
[Thu Feb 01 19:57:21.580226 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]     class DeleteLeafs(ldap.async.AsyncSearchHandler):
[Thu Feb 01 19:57:21.580237 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]   File "/usr/local/www/iredadmin/libs/ldaplib/deltree.py", line 11, in DeleteLeafs
[Thu Feb 01 19:57:21.580255 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]     _entryResultTypes = ldap.async._entryResultTypes
[Thu Feb 01 19:57:21.580282 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653] AttributeError: 'module' object has no attribute '_entryResultTypes'
[Thu Feb 01 19:57:21.580298 2018] [wsgi:error] [pid 2202] [remote 202.52.14.xxx:50653]

====

thank you before..

cheers,
andy

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Internal Server Error FreeBSD 10.4 & 11.1

Seems a bug of Python module 'py-ldap'. May i know the version number of package 'net/py-ldap' running on your server?
Did you update the ports tree before installing iRedMail?

3

Re: Internal Server Error FreeBSD 10.4 & 11.1

the version is py27-ldap-2.5.2

yess i use the latest ports...

4

Re: Internal Server Error FreeBSD 10.4 & 11.1

Hi.

I had the same problem on 11.1.

Downgrade to py27-ldap-2.4.45, works.

5

Re: Internal Server Error FreeBSD 10.4 & 11.1

Dear @m1m1n,

I cannot reproduce this issue with a fresh FreeBSD OS with iRedMail. Is it possible to give me direct ssh access to reproduce this issue and fix it?

6 (edited by bluesbro1982 2018-02-14 07:57:45)

Re: Internal Server Error FreeBSD 10.4 & 11.1

I'm having the same issue on 11.1, with a fresh ports tree and bone-stock install.  I'm on py-ldap 2.5.2.  I'll tray a portdowngrade and see what comes of it.

iRedMail version (check /etc/iredmail-release): 0.9.8-beta1 & 0.9.7
- Linux/BSD distribution name and version: FreeBSD 11.1 and Ubuntu 16.04-17.10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache or ngnix
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.

This is on iredadmin 0.9.8-beta1, but I had a similar issue on 0.9.7, using both apache and ngnix, and with similar results on ubuntu.

roundcube works and email can get delivered. I can login through roundcube and I can also login using an MUA to the default postmaster, but I definitely see the same errors in my /var/log/uwsgi-iredadmin.log file

EDIT: Perhaps this change in November may have borked things?:

r455210 | mat | 2017-11-30 15:50:30 +0000 (Thu, 30 Nov 2017) | 35 lines

Convert Python ports to FLAVORS.

  Ports using USE_PYTHON=distutils are now flavored.  They will
  automatically get flavors (py27, py34, py35, py36) depending on what
  versions they support.

  There is also a USE_PYTHON=flavors for ports that do not use distutils
  but need FLAVORS to be set.  A USE_PYTHON=noflavors can be set if
  using distutils but flavors are not wanted.

  A new USE_PYTHON=optsuffix that will add PYTHON_PKGNAMESUFFIX has been
  added to cope with Python ports that did not have the Python
  PKGNAMEPREFIX but are flavored.

  USES=python now also exports a PY_FLAVOR variable that contains the
  current python flavor.  It can be used in dependency lines when the
  port itself is not python flavored.  For example, deskutils/calibre.

  By default, all the flavors are generated.  To only generate flavors
  for the versions in PYTHON2_DEFAULT and PYTHON3_DEFAULT, define
  BUILD_DEFAULT_PYTHON_FLAVORS in your make.conf.

  In all the ports with Python dependencies, the *_DEPENDS entries MUST
  end with the flavor so that the framework knows which to build/use.
  This is done by appending '@${PY_FLAVOR}' after the origin (or
  @${FLAVOR} if in a Python module with Python flavors, as the content
  will be the same).  For example:

    RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}

PR:             223071
Reviewed by:    portmgr, python
Sponsored by:   Absolight
Differential Revision:  https://reviews.freebsd.org/D12464

 test.mydomain.com [pid: 3124|app: 0|req: 3/3] xx.xx.xx.xx () {52 vars in 884 bytes} [Tue Feb 13 23:14:26 2018] GET /iredadmin => generated 13 bytes in 30 msecs (HTTP/1.1 303) 3 headers in 257 bytes (2 switches on core 0)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 239, in process
    return self.handle()
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 230, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/lib/python2.7/site-packages/web/application.py", line 458, in _delegate
    mod = __import__(mod, None, None, [''])
  File "/usr/local/www/iRedAdmin-0.9/controllers/ldap/basic.py", line 11, in <module>
    from libs.ldaplib import auth, decorators, admin as adminlib, ldaputils
  File "/usr/local/www/iRedAdmin-0.9/libs/ldaplib/admin.py", line 7, in <module>
    from libs.ldaplib import core, attrs, ldaputils, iredldif, deltree, connUtils, decorators
  File "/usr/local/www/iRedAdmin-0.9/libs/ldaplib/deltree.py", line 5, in <module>
    class DeleteLeafs(ldap.async.AsyncSearchHandler):
  File "/usr/local/www/iRedAdmin-0.9/libs/ldaplib/deltree.py", line 11, in DeleteLeafs
    _entryResultTypes = ldap.async._entryResultTypes
AttributeError: 'module' object has no attribute '_entryResultTypes' 

7

Re: Internal Server Error FreeBSD 10.4 & 11.1

Fixed when I downgraded the port of py-ldap to 2.4.45...  now to figure out how to configure ngnix vhosts and libressl...

8

Re: Internal Server Error FreeBSD 10.4 & 11.1

I'm trying to reproduce this issue.

9

Re: Internal Server Error FreeBSD 10.4 & 11.1

it may also have to do with building from ports hanging up the build.  There were several times I had to do a make uninstall of certain ports, and upon restarting bash iredmail.sh things may not be getting cleaned up properly.

Nevertheless, I CAN verify that I saw this behavior, it defintiely provided me with several days of frustration, and using the older py-ldap library fixed the issue.

10

Re: Internal Server Error FreeBSD 10.4 & 11.1

Did another testing today, latest ports tree works fine. Seems this only occurs for existing FreeBSD users after upgrading py-ldap.

Unfortunately, i don't have a server with this issue, so it's hard for me to reproduce it and fix it. Could anyone grant me direct ssh access to fix it?