添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • Spider Email Archiver : Lightweight on-premises email archiving software, developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.
  • Join our Telegram group (@iredmail_chat) to get help from other iRedMail users.
  • Topic: Error: ValueError('No JSON object could be decoded',)

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

    Hi,
    I just upgraded both to 0.9.8 and iRedAdmin-Pro 2.9, everything seems to be working fine, except with the mailing list feature.
    as i tried to create a new making list i get this error:
    '"Error: ValueError('No JSON object could be decoded',)"
    I would like some info on how i can debug this further.
    Thank you

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

    Re: Error: ValueError('No JSON object could be decoded',)

    ok,
    first to your questions:
    No errors in Nginx
    Yes, the token is setup.

    I have further looked into this, since my live server went through a few upgrades i have made a fresh installation in a dev jail and i got the same result.
    So i attempted to debug a bit and it looks to me that the issue comes from mlmmjadmin or potentially some python module.
    I tried making a query with curl using this format (taken from  the readme.md):

    curl -X POST \
    --header 'X-MLMMJADMIN-API-AUTH-TOKEN: 43a89b7aa34354089e629ed9f9be0b3b' \
    -d "owner=postmaster@a.io&only_subscriber_can_post=yes"
    http://127.0.0.1:7790/list@domain.com

    of course i replaced the token, postmaster@a.io with an email present in the system as well as 'domain.com' with a domain present in the system (possibly replacing postmaster@a.io and domain.com was not necessary for testing purposes, but...)
    the response i get is "Internal Server Error".
    I added DEBUG = True to /opt/mlmmjadmin/settings.py but i get the same response...

    Any additional debugging that i could run?

    Re: Error: ValueError('No JSON object could be decoded',)

    Try this:

    *) Stop mlmmjadmin service.
    *) Start it this way:

    cd /opt/mlmmjadmin/
    python mlmmjadmin.py

    Now reproduce the error, you should see some error message on console. We need this error message for troubleshooting.

    Re: Error: ValueError('No JSON object could be decoded',)

    here is the error:

    # python mlmmjadmin.py
    Traceback (most recent call last):
    File "mlmmjadmin.py", line 18, in <module>
    from libs.logger import logger
    File "/opt/mlmmjadmin-1.4/libs/logger.py", line 16, in <module>
    facility=settings.SYSLOG_FACILITY)
    File "/usr/local/lib/python2.7/logging/handlers.py", line 761, in __init__
    self._connect_unixsocket(address)
    File "/usr/local/lib/python2.7/logging/handlers.py", line 804, in _connect_unixsocket
    self.socket.connect(address)
    File "/usr/local/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
    socket.error: [Errno 2] No such file or directory

    It seems that it might be an error related to logging.
    My rc.conf has the flowing lines:

    # Prevent syslog to open sockets
    syslogd_enable="YES"
    syslogd_flags="-ss"

    These are recommended settings for a FreeBSD jail but it might affect the logging behavior...
    I can try removing those entries if you think that might be the culprit.
    thanks

    Re: Error: ValueError('No JSON object could be decoded',)

    I found one problem, which solves the error i got from the command line, but doesn't seem to solve the original issue.
    On FreeBSD this line needs to be added to the settings.py file.
    SYSLOG_SERVER = '/var/run/log'
    This is overwrites the default SYSLOG_SERVER = '/dev/log'.

    Now if i ran
    # python mlmmjadmin.py
    I get no error. But if i call it from the IRedAdmin-Pro interface i still get
    Error: ValueError('No JSON object could be decoded',)

    I'll continue to investigate, any suggestion appreciated.

    Re: Error: ValueError('No JSON object could be decoded',)

    2 possible solutions:

    1) What's the local socket file of syslog? Default is /dev/log, does FreeBSD jail have same socket? if it's different, try to add a parameter in /opt/mlmmjadmin/settings.py like this:

    SYSLOG_SERVER = '/dev/path/to/log'

    2) Does your jail support logging to the host syslog service? If yes, try to add 2 parameters in /opt/mlmmjadmin/settings.py like this:

    SYSLOG_SERVER = '<ip>'
    SYSLOG_PORT = 514

    After updated settings.py, you need to restart mlmmjadmin service.

    Re: Error: ValueError('No JSON object could be decoded',)

    iredmail.mb wrote:

    If i submit a new mailing list with the script running from command line, it works!

    Me too,
    when "systemctl restart mlmmjadmin.service"
    this is my /var/log/message :
    Jun  4 15:57:02 mail uwsgi: *** Operational MODE: preforking ***
    Jun  4 15:57:02 mail uwsgi: Traceback (most recent call last):
    Jun  4 15:57:02 mail uwsgi:  File "mlmmjadmin.py", line 16, in <module>
    Jun  4 15:57:02 mail uwsgi:
    Jun  4 15:57:02 mail uwsgi: import settings
    Jun  4 15:57:02 mail uwsgi: ImportError
    Jun  4 15:57:02 mail uwsgi: :
    Jun  4 15:57:02 mail uwsgi: No module named settings
    Jun  4 15:57:02 mail uwsgi:
    Jun  4 15:57:02 mail uwsgi: unable to load app 0 (mountpoint='') (callable not found or import error)

    PS: sorry my  OS is :CentOS7; iRedAdmin-Pro-LDAP-3.1

    Re: Error: ValueError('No JSON object could be decoded',)

    To my understanding in FreeBSD SYSLOG_SERVER needs to be changed to:
    SYSLOG_SERVER = '/var/run/log'
    Looking at this man page it confirms that /var/run/log is the default (but maybe i'm missing something, it is the first time that i look at syslog in detail)
    https://www.freebsd.org/cgi/man.cgi?que … ;sektion=8
    In any case, after many test, i got it to work on my installation with that change alone from the original configuration.

    Generated in 0.014 seconds (73% PHP - 27% DB) with 8 queries