1 (edited by Tony-admincujae 2015-04-07 22:14:19)

Topic: Iredap stops working

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx):Apache
- Linux/BSD distribution name and version: Ubuntu 14.04
- Related log if you're reporting an issue:
====
Thanks for your advices. Sorry that Ididnt make my self clear in my last post. Now it turns out that I have another issue. My iredap stops working and I dont now why. I have seen some solutions posted here
http://www.iredmail.org/forum/topic2457 … fused.html
http://www.iredmail.org/forum/topic2490 … domly.html
and I even upgrade my DBUtils to version 1.0 but the iredap stop working and I dont now why. Then I start it nad it works fine.

This are the iredap.log (after I restart it, sorry about that) and output the mail.log (before the restart).

MAIL.LOG
Apr  7 09:35:57 areasmail2 postfix/smtpd[25799]: disconnect from localhost[127.0.0.1]
Apr  7 09:35:57 areasmail2 postfix/smtpd[26195]: warning: connect to 127.0.0.1:7777: Connection refused
Apr  7 09:35:57 areasmail2 postfix/smtpd[26195]: warning: problem talking to server 127.0.0.1:7777: Connection refused
Apr  7 09:35:58 areasmail2 postfix/smtpd[26195]: warning: connect to 127.0.0.1:7777: Connection refused
Apr  7 09:35:58 areasmail2 postfix/smtpd[26195]: warning: problem talking to server 127.0.0.1:7777: Connection refused

IREDAP.LOG
my3daztggi2tcljvgzsgiljumiydcljzgbsdqllcgy4dcztgmqztkmlegm5xezdfnrtwczdpibrwk3lboqxgg5lkmfss4zleouxgg5i=@bounce.researchgate.net -> rdelgado@cemat.cujae.edu.cu, DUNNO
2015-04-07 09:38:14 INFO [10.8.6.212] 5510-893-8-0000172713@sbr37.net -> jgarrido@cemat.cujae.edu.cu, DUNNO
2015-04-07 09:38:14 INFO [10.8.6.212] rosita@movitel.co.cu -> drprieto@cemat.cujae.edu.cu, DUNNO
2015-04-07 09:38:14 INFO [10.8.6.212] trabajadores-bounces@listas.cujae.edu.cu -> willians@cemat.cujae.edu.cu, DUNNO
2015-04-07 09:38:15 INFO [10.8.6.212] notification+zj4yo9oyf2_9@facebookmail.com -> amirabal@cemat.cujae.edu.cu, DUNNO
2015-04-07 09:38:15 INFO [10.8.6.212] tomas@electrica.cujae.edu.cu -> nelsonh@cemat.cujae.edu.cu, DUNNO

What does the DUNNO word means.
Sorry for your troubles.
Greetins from Cuba

----

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

2

Re: Iredap stops working

DUNNO means that it doesn't have enough reason to either Force-PASS or force-FAIL It, it is a common word in SMTP. It just means that the check hasn't rejected the message but hasn't forced to skip ahead of all the checks. The iRedAPD log doesn't show why its shutting down though, any other logs?

Need the iRedAPD Log after it crashes

3

Re: Iredap stops working

This is really weird. I keep checking the iredap.log and this happens. I dont know if this has anything to do with the error that I post. This is the output:

2015-04-07 12:33:20 ERROR Error while creating Amavisd database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections
2015-04-07 12:33:20 INFO [10.8.6.212] todos-bounces@listas.cujae.edu.cu -> ale@cemat.cujae.edu.cu, DUNNO
2015-04-07 12:33:20 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections
2015-04-07 12:33:20 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections
2015-04-07 12:33:20 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections
2015-04-07 12:33:20 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections

I'll keep looking in the log file

4

Re: Iredap stops working

How much memory does your server have?

5

Re: Iredap stops working

Yes. Definitly this is the cause. At the time that the server stop working the same ERROR happened. But that time the error was fixed when I restart the iredap daemon. This time it fixed by himself??!?!?!
This is the log when the server failed

2015-04-06 17:04:32 INFO [10.8.6.212] trabajadores-bounces@listas.cujae.edu.cu -> pablog@cemat.cujae.edu.cu, DUNNO
2015-04-06 17:04:33 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:35 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:36 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:37 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:38 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:39 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:41 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:04:42 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-06 17:05:08 ERROR Error while creating database connection: FATAL:  remaining connection slots are reserved for non-replication superuser conn$
2015-04-07 09:37:46 INFO Starting iRedAPD (version: 1.4.4, backend: pgsql), listening on 127.0.0.1:7777.
2015-04-07 09:37:46 INFO Loading plugin: reject_null_sender
2015-04-07 09:37:46 INFO Loading plugin: amavisd_message_size_limit
2015-04-07 09:37:46 INFO Loading plugin: amavisd_wblist
2015-04-07 09:37:46 INFO Loading plugin: sql_alias_access_policy
2015-04-07 09:37:58 INFO [10.8.2.110] prueba@cemat.cujae.edu.cu -> jalvarez@cujae.edu.cu, DUNNO
2015-04-07 09:37:59 INFO [10.8.2.110] prueba@cemat.cujae.edu.cu -> jalvarez@cujae.edu.cu, DUNNO

6

Re: Iredap stops working

7t3chguy wrote:

How much memory does your server have?

Its a virtualizated server (using LXC) sharing 3GB of RAM memory. Theres only another server in that cluster and it also has an iredmail server (version 0.8) but that one works without any problems.

7

Re: Iredap stops working

Do I dare ask why you're running two instances of iRedMail instead of just one to run all the domains?

8 (edited by Tony-admincujae 2015-04-08 01:51:33)

Re: Iredap stops working

7t3chguy wrote:

Do I dare ask why you're running two instances of iRedMail instead of just one to run all the domains?

Of course. Its only a matter of organization and that if one of the servers failed I wouldnt lose all of my domains.
The one thats causing me headaches was installed to migrate an old MDaemon that we had. I didnt know how would the old one would behaive if we add more and more domains. I know that the documentation said that we can add countless domains but Iwasnt convinced.
Its this a problem??

9

Re: Iredap stops working

I've never used LXC Virtualization but from what I've read its container based similar to OpenVZ. I'm running an iRedMail Server on a 6GB Container and at peak it hits 1.1GB + caching so I think 3GB should be barely enough for a LOT of domains.
Are they sharing a DB or individual DBs? Both PgSQL?

10

Re: Iredap stops working

7t3chguy wrote:

I've never used LXC Virtualization but from what I've read its container based similar to OpenVZ. I'm running an iRedMail Server on a 6GB Container and at peak it hits 1.1GB + caching so I think 3GB should be barely enough for a LOT of domains.
Are they sharing a DB or individual DBs? Both PgSQL?

You are right. LXC its like Openvz but it can use a more updated kernel. They have both individual databases. They are both PGSQL because thats the one that Im more used to. Remember that Im using the free version so I have to add the domain admins directly on the database. I dont think its a problem of memory or CPU because the machine runs well (Im checking it with Nagios all the time) and when I run top it seems fine. Maybe its a bug on iredap?

11

Re: Iredap stops working

Any chance I could get SSH Access to the server, I'd take some debug logs after updating iRedAPD to the latest,unreleased version? To elimitate the possibility of a bug in iRedAPD

12

Re: Iredap stops working

7t3chguy wrote:

Any chance I could get SSH Access to the server, I'd take some debug logs after updating iRedAPD to the latest,unreleased version? To elimitate the possibility of a bug in iRedAPD

I really cant do that. Thats the policy over here. Im really really sorry for that. How can I update the iRedAPD? Maybe I could do that and post the logs here? Im really thankfull for your help.

13

Re: Iredap stops working

https://bitbucket.org/zhb/iredapd
Download it from there
extract it into /opt
fix the symlink
and copy the settings.py across

14

Re: Iredap stops working

How can I check the iredapd version that Im using??

15

Re: Iredap stops working

Name of the folder in /opt/
`file /opt/iredapd` will return something like `/opt/iRedAPD-1.4.4` which has the current version

16

Re: Iredap stops working

I dont understand. I've downloaded the version thats in https://bitbucket.org/zhb/iredapd but thats the same version that I already have (1.4.4, like you said). What do I do? Run it anyway like this http://www.iredmail.org/docs/upgrade.iredapd.html?

17

Re: Iredap stops working

Yes, the version number hasn't been bumped up but there have been some changes to a few of the scripts, if the issue persists with this build then enable Debug and send the Debug logs over to us please.

18

Re: Iredap stops working

This is the output of the iredap.log. It seems to be working fine for now. I'll keep an eye on it for a while and if it crashes again i'll post it here again. Or do you prefer me to run debug mode right now?

2015-04-07 15:18:08 INFO Starting iRedAPD (version: 1.4.4, backend: pgsql), listening on 127.0.0.1:7777.
2015-04-07 15:18:08 INFO Loading plugin: reject_null_sender
2015-04-07 15:18:09 INFO Loading plugin: amavisd_message_size_limit
2015-04-07 15:18:09 INFO Loading plugin: amavisd_wblist
2015-04-07 15:18:09 INFO Loading plugin: sql_alias_access_policy
2015-04-07 15:18:56 INFO [10.71.0.62] fmena@cemat.cujae.edu.cu -> , DUNNO
2015-04-07 15:19:36 INFO [10.8.2.110] prueba@cemat.cujae.edu.cu -> jalvarez@cujae.edu.cu, DUNNO
2015-04-07 15:19:36 INFO [10.8.2.110] prueba@cemat.cujae.edu.cu -> jalvarez@cujae.edu.cu, DUNNO

19

Re: Iredap stops working

if it crashes again, start debugging until it crashes again, no point going excessive on logging if nothing is wrong

20

Re: Iredap stops working

Thanks for all your help.

21

Re: Iredap stops working

I'm afraid that on a busy server, iRedAPD may establish too many SQL connections to SQL server (and close them immediately when request finished), this causes it reaches max connection set in PGSQL server. The questions are:

*) Is your mail server busy? process how many emails per-day?
*) What's the max connection number set in PGSQL server?

22 (edited by Tony-admincujae 2015-04-10 00:24:58)

Re: Iredap stops working

ZhangHuangbin wrote:

I'm afraid that on a busy server, iRedAPD may establish too many SQL connections to SQL server (and close them immediately when request finished), this causes it reaches max connection set in PGSQL server. The questions are:

*) Is your mail server busy? process how many emails per-day?
*) What's the max connection number set in PGSQL server?

Thanks for your reply Zhang. Im really sorry that i havent seen your post until now. This could have save me a lot of work.

I think that your right. After I updated my iredap daemon like 7t3chguy sugested I keep checking my iredap.log and it keep doing the same:
2015-04-09 11:34:40 ERROR Error while creating Amavisd database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections
2015-04-09 11:34:44 ERROR Error while creating Amavisd database connection: FATAL:  remaining connection slots are reserved for non-replication superuser connections
I think check that this only happens when a mail was sent from a mail list (Mailman). So I figure out the same thing that you told here (iRedAPD may establish too many SQL connections to SQL server). So I check the max connection set in PGSQL server and it was of only 100. I replace it for 200 (the number that I use on my other IredMail, wich works great).
Lets see if this solves the problem for good.
Thanks to both of you by your time.
And by the way IredMail rocks.
Greetings from Cuba

23

Re: Iredap stops working

This is caused by iRedAPD, it should use a SQL connection pool instead of creating a new SQL connection for each request. I will improve this in future release.