1

Topic: Change password user error 502 Bad Gateway nginx

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi. The mail server works fine but when I try to change a user's password via iredadmin, I get the following error:
502 Bad Gateway nginx
If I check the error logs I see the following strings:

2023/04/03 10:36:12 [error] 27527#27527: *208 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xx.xx.xxx, server: _, request: "POST /iredadmin/profile/user/password/xxx@xxxxxxxxxx.xxx HTTP/2.0", upstream: "uwsgi://127.0.0.1:7791", host: "mail.xxxxxxxxx.xxx", referrer: "xxxps://mail.xxxxxxxxx.xxx/iredadmin/profile/user/general/info@xxxxxxxxxxx.xxx"

I have tried checking the firewall and also turned it off and tried running a service uwsgi start but the problem remains. Do you have any suggestions?

----

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

2

Re: Change password user error 502 Bad Gateway nginx

Seems iredadmin service exited. Did you see any error in /var/log/syslog or /var/log/messages?

3

Re: Change password user error 502 Bad Gateway nginx

Hi ZhangHuangbin and thanks for your reply.
In the log after trying to change the password it writes the following strings on the syslog (not on messages which is not present):

Apr  4 09:00:02 servermail postfix/submission/smtpd[28209]: connect from xxx.xxxxxx.net[xxx.xx.xx.xx]
Apr  4 09:00:02 servermail postfix/submission/smtpd[28209]: Anonymous TLS connection established from xxx.xxxxxx.net[xxx.xx.xx.xx]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Apr  4 09:00:02 servermail postfix/submission/smtpd[28209]: 4PrJYG2PTlz6R2gm: client=xxx.xxxxxx.net[xxx.xx.xx.xx], sasl_method=LOGIN, sasl_username=info@xxxxxxx.com
Apr  4 09:00:03 servermail postfix/cleanup[27869]: 4PrJYG2PTlz6R2gm: message-id=<>
Apr  4 09:00:03 servermail postfix/qmgr[13019]: 4PrJYG2PTlz6R2gm: from=<info@xxxxxxx.com>, size=818, nrcpt=1 (queue active)
Apr  4 09:00:03 servermail postfix/submission/smtpd[28209]: disconnect from xxx.xxxxxx.net[xxx.xx.xx.xx] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=8
Apr  4 09:00:03 servermail systemd-resolved[26384]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr  4 09:00:04 servermail systemd-resolved[26384]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Apr  4 09:00:05 servermail systemd[1]: Started Session 184013 of user root.
Apr  4 09:00:05 servermail sftp-server[28386]: session opened for local user root from [150.xx.xx.xxx]
Apr  4 09:00:05 servermail sftp-server[28386]: received client version 3
Apr  4 09:00:06 servermail sftp-server[28386]: realpath "."
Apr  4 09:00:06 servermail sftp-server[28386]: realpath "/var/log"
Apr  4 09:00:06 servermail sftp-server[28386]: opendir "/var/log"
Apr  4 09:00:06 servermail sftp-server[28386]: closedir "/var/log"
Apr  4 09:00:06 servermail sftp-server[28386]: realpath "/var/log/syslog"
Apr  4 09:00:06 servermail sftp-server[28386]: stat name "/var/log/syslog"
Apr  4 09:00:06 servermail sftp-server[28386]: open "/var/log/syslog" flags READ mode 0666

iredadmin works perfectly, only when I go to change a user's password it returns the error and does not perform the operation.

4

Re: Change password user error 502 Bad Gateway nginx

- I'm confused. what's the situation / issue now?
- Which linux distribution and release are you running?
- Which iRedMail and iRedAdmin-Pro releases are you running?

5

Re: Change password user error 502 Bad Gateway nginx

The mail server works perfectly, only that within iredadmin changing a user's password generates a 502 Bad Gateway nginx error

Linux version
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.5 LTS
Release:        18.04
Codename:       bionic

iRedMail version: 1.3.2
iRedAdmin version: 1.2 (MySQL)

6

Re: Change password user error 502 Bad Gateway nginx

Would you like to upgrade iRedMail and iRedAdmin and try again?

7

Re: Change password user error 502 Bad Gateway nginx

Ok ZhangHuangbin, I'll try to run the updates and let you know, thanks