1 (edited by sergiocesar 2020-11-16 22:37:27)

Topic: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.2
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: Centos 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx):Nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Just upgraded to latest iredadmin-pro, followed the procedure here:
https://docs.iredmail.org/iredmail.releases.html

Had issue with the uwsgi path, fixed that. now I get the error:
Error: JSONDecodeError('Expecting value: line 1 column 1 (char 0)',)
when I try to click on a user:

I get this error in the messages log:

Nov 15 18:26:51 localhost iredadmin[1709]: [72.26.55.203] GET /iredadmin/profile/user/general/XXXX@XXXXX.com 303 327 "https://XXXX.XXXX.net/iredadmin/users/X … 9%27%2C%29"
Nov 15 18:26:53 localhost iredadmin[1709]: [72.26.55.203] GET /iredadmin/users/XXXX.com?msg=JSONDecodeError%28%27Expecting%20value%3A%20line%201%20column%201%20%28char%200%29%27%2C%29 200 29267 "https://XXXX.XXXX.net/iredadmin/users/X … 9%27%2C%29"

I have restarted every service and rebooted the machine. I see no apparent error that may give me a clue.

XXXX to protect the innocent.... send me a private email if you need that info.

----

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

2

Re: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

Seems mlmmjadmin service is not running?
Try to create a testing mailing list account with /opt/mlmmjadmin/tools/maillist_admin.py script, then remove it. This way we can verify it's working or not.

3

Re: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

ZhangHuangbin wrote:

Seems mlmmjadmin service is not running?
Try to create a testing mailing list account with /opt/mlmmjadmin/tools/maillist_admin.py script, then remove it. This way we can verify it's working or not.

The list gets created and deleted OK but cant edit or enter the list via the web admin.
I get this:
[root@mail tools]#  python3 maillist_admin.py create list@dmain.net only_subscriber_can_post=yes disable_archive=no
Traceback (most recent call last):
  File "maillist_admin.py", line 140, in <module>
    _json = r.json()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib64/python3.6/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[root@mail tools]#  python3 maillist_admin.py delete list@domain.net
Traceback (most recent call last):
  File "maillist_admin.py", line 169, in <module>
    _json = r.json()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib64/python3.6/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib64/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)



I also see this in the log file: when I try to enter the list via the manager
Nov 17 08:06:56 localhost mlmmjadmin[1704]: Traceback (most recent call last):#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 290, in process#012    return self.handle()#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 281, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 527, in _delegate#012    mod = __import__(mod, None, None, [""])#012  File "/opt/mlmmjadmin-3.0.4/controllers/profile.py", line 3, in <module>#012    from controllers.decorators import api_acl#012  File "/opt/mlmmjadmin-3.0.4/controllers/decorators.py", line 3, in <module>#012    from libs.utils import get_auth_token, api_render#012  File "/opt/mlmmjadmin-3.0.4/libs/utils.py", line 12#012    def str2bytes(s) -> bytes:#012                     ^#012SyntaxError: invalid syntax
Nov 17 08:06:56 localhost mlmmjadmin[1704]:
Nov 17 08:06:56 localhost mlmmjadmin[1704]: [127.0.0.1] GET /api/list@domain.net 500 84 "-"

and this:
Nov 17 08:11:13 localhost mlmmjadmin[1704]: Traceback (most recent call last):#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 290, in process#012    return self.handle()#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 281, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 527, in _delegate#012    mod = __import__(mod, None, None, [""])#012  File "/opt/mlmmjadmin-3.0.4/controllers/profile.py", line 3, in <module>#012    from controllers.decorators import api_acl#012  File "/opt/mlmmjadmin-3.0.4/controllers/decorators.py", line 3, in <module>#012    from libs.utils import get_auth_token, api_render#012  File "/opt/mlmmjadmin-3.0.4/libs/utils.py", line 12#012    def str2bytes(s) -> bytes:#012                     ^#012SyntaxError: invalid syntax
Nov 17 08:11:13 localhost mlmmjadmin[1704]:
Nov 17 08:11:13 localhost mlmmjadmin[1704]: [127.0.0.1] DELETE /api/list@domain.net 500 84 "-"



Note: python2.7 in the above cmd

try to set the default python with the cmd below but nothing changes:
alternatives --set python /usr/bin/python3
[root@mail tools]# python --version
Python 3.6.8

4

Re: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

- What's the full content of file /opt/mlmmjadmin/rc_scripts/uwsgi/rhel8.ini?
- What's the full content of file /etc/systemd/system/multi-user.target.wants/mlmmjadmin.service?

5

Re: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

ZhangHuangbin wrote:

- What's the full content of file /opt/mlmmjadmin/rc_scripts/uwsgi/rhel8.ini?
- What's the full content of file /etc/systemd/system/multi-user.target.wants/mlmmjadmin.service?

[root@ired3 ]# cat /opt/mlmmjadmin/rc_scripts/uwsgi/rhel8.ini
cat: /opt/mlmmjadmin/rc_scripts/uwsgi/rhel8.ini: No such file or directory


[root@ired3 postfix]# cat /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini
[uwsgi]
plugins = python,syslog
master = true
vhost = true
enable-threads = true
processes = 5
logger = syslog:mlmmjadmin,local5
log-format = [%(addr)] %(method) %(uri) %(status) %(size) "%(referer)"

http-socket = 127.0.0.1:7790
uid = mlmmj
gid = mlmmj

chdir = /opt/mlmmjadmin
wsgi-file = mlmmjadmin.py


root@ired3 ]# cat /etc/systemd/system/multi-user.target.wants/mlmmjadmin.service
[Unit]
Description=RESTful API server used to manage mlmmj mailing list manager
After=network.target local-fs.target remote-fs.target

[Service]
Type=simple
ExecStartPre=-/usr/bin/mkdir /var/run/mlmmjadmin
ExecStartPre=/usr/bin/chown mlmmj:mlmmj /var/run/mlmmjadmin
ExecStartPre=/usr/bin/chmod 0755 /var/run/mlmmjadmin
ExecStart=/usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pi
ExecStop=/usr/bin/uwsgi --stop /var/run/mlmmjadmin/mlmmjadmin.pid
ExecStopPost=/usr/bin/rm -rf /var/run/mlmmjadmin
KillSignal=SIGTERM
TimeoutStopSec=5
PrivateTmp=true

[Install]
WantedBy=multi-user.target

6

Re: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

sergiocesar wrote:

[root@ired3 postfix]# cat /opt/mlmmjadmin/rc_scripts/uwsgi/rhel.ini
[uwsgi]
plugins = python,syslog

Please replace "python," by "python36,", then restart mlmmjadmin service.

7 (edited by sergiocesar 2020-11-18 21:43:50)

Re: Upgrade to 4.6 FAIL: Can't see or edit user data. JSON Error:

No joy. same error.
Error: JSONDecodeError('Expecting value: line 1 column 1 (char 0)',)

The log still show python2.7
I already try that as someone else had this fix his issue, but they are using centos 7 and I have centos 8.


Nov 18 07:32:07 ired3 mlmmjadmin[12158]: Traceback (most recent call last):#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 290, in process#012    return self.handle()#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 281, in handle#012    return self._delegate(fn, self.fvars, args)#012  File "/usr/lib/python2.7/site-packages/web/application.py", line 527, in _delegate#012    mod = __import__(mod, None, None, [""])#012  File "/opt/mlmmjadmin-3.0.4/controllers/subscriber.py", line 3, in <module>#012    from controllers.decorators import api_acl#012  File "/opt/mlmmjadmin-3.0.4/controllers/decorators.py", line 3, in <module>#012    from libs.utils import get_auth_token, api_render#012  File "/opt/mlmmjadmin-3.0.4/libs/utils.py", line 12#012    def str2bytes(s) -> bytes:#012                     ^#012SyntaxError: invalid syntax
Nov 18 07:32:07 ired3 mlmmjadmin[12158]:
Nov 18 07:32:07 ired3 mlmmjadmin[12158]: [127.0.0.1] GET /api/subscriber/b@domain.net/subscribed?query_all_lists=no&email_only=yes 500 84 "-"