1

Topic: FreeBSD Jail: Bug in mlmmjadmin

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: FreeBSD 11.1-RELEASE-p9 jail
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? NO
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

After a fresh install in jail the file /opt/mlmmjadmin-1.1/libs/default_settings.py has:
SYSLOG_SERVER = '/dev/log'
There is no such parameter in settings.py.

The socket '/dev/log' is NOT present in jails, the correct value for syslog socket is '/var/run/log'
This bug blocks completely maillist_admin.py, please fix it.

----

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

2

Re: FreeBSD Jail: Bug in mlmmjadmin

BTW, it still does not work correctly - JSON problem:

mail:/opt/mlmmjadmin/tools@[15:08] # python2.7 maillist_admin.py info info@*****.net
Traceback (most recent call last):
  File "maillist_admin.py", line 119, in <module>
    _json = r.json()
  File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
mail:/opt/mlmmjadmin/tools@[15:08] # python2.7 maillist_admin.py subscribers info@*****.net
Traceback (most recent call last):
  File "maillist_admin.py", line 189, in <module>
    _json = r.json()
  File "/usr/local/lib/python2.7/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

3

Re: FreeBSD Jail: Bug in mlmmjadmin

mail:/opt/mlmmjadmin/tests@[15:18] # bash main.sh
========================================================= test session starts ==========================================================
platform freebsd11 -- Python 2.7.15, pytest-3.4.2, py-1.5.3, pluggy-0.6.0
rootdir: /opt/mlmmjadmin-1.1/tests, inifile:
collected 6 items

test-mlmmj.py F

=============================================================== FAILURES ===============================================================
_________________________________________________________ test_invalid_domain __________________________________________________________

    def test_invalid_domain():
        url = data.url_ml_in_not_exist_domain
>       _json = get(url=url)

test-mlmmj.py:9:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
__init__.py:13: in get
    return r.json()
/usr/local/lib/python2.7/site-packages/requests/models.py:892: in json
    return complexjson.loads(self.text, **kwargs)
/usr/local/lib/python2.7/json/__init__.py:339: in loads
    return _default_decoder.decode(s)
/usr/local/lib/python2.7/json/decoder.py:364: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <json.decoder.JSONDecoder object at 0x806d3dfd0>, s = 'Internal Server Error', idx = 0

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` or ``unicode``
            beginning with a JSON document) and return a 2-tuple of the Python
            representation and the index in ``s`` where the document ended.

            This can be used to decode a JSON document from a string that may
            have extraneous data at the end.

            """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration:
>           raise ValueError("No JSON object could be decoded")
E           ValueError: No JSON object could be decoded

/usr/local/lib/python2.7/json/decoder.py:382: ValueError
======================================================= 1 failed in 0.63 seconds =======================================================
* Clean up temporary files.

4

Re: FreeBSD Jail: Bug in mlmmjadmin

I think mlmmjadmin service is not running. Could you please double check?

5

Re: FreeBSD Jail: Bug in mlmmjadmin

# /usr/local/etc/rc.d/mlmmjadmin status
mlmmjadmin is running.

6 (edited by Peter2121 2018-09-17 22:16:57)

Re: FreeBSD Jail: Bug in mlmmjadmin

Probably, there are some problems between mlmmjadmin and uwsgi services.
ZhangHuangbin, please, could you explain their relationship?

As I understand, uwsgi tries to start mlmmjadmin too, but never finds the ini file...

7

Re: FreeBSD Jail: Bug in mlmmjadmin

I replaced
uwsgi_profiles="mlmmjadmin iredadmin"

with
uwsgi_profiles="iredadmin"

in /etc/rc.conf.local

and restarted the jail.

maillist_admin.py seems to work correctly.

8

Re: FreeBSD Jail: Bug in mlmmjadmin

mlmmjadmin is ran by uwsgi PROGRAM but not controlled by uwsgi SERVICE, it's controlled by its own rc script, you can run:

service mlmmjadmin [start | stop | restart]