1

Topic: Error releasing from quarantine

==== Required information ====
- iRedMail version: v0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Linux/BSD distribution name and version: Centos v6.5, Linux 3.14.5-x86_64-linode42 on x86_64
- Related log if you're reporting an issue: maillog
====

I've recently updated PGSQL to v9.1.14 and currently I'm running amavisd-new v2.9.1;

When I tried releasing an email from quarantine, I received the following maillog error message and the operation failed (and apparently my email was lost from the DB as I then refreshed and checked the table contents after the release attempt):

Aug  4 12:52:56 mail amavis[16604]: (rel-SjATB8bB_-gB) release: no records with msgs.mail_id=SjATB8bB_-gB in a database, trying to read from a quar. anyway
Aug  4 12:52:56 mail amavis[16604]: (rel-SjATB8bB_-gB) Amavis::IO::SQL::open key=SjATB8bB_-gB, p_tag=: no such record
Aug  4 12:52:56 mail amavis[16604]: (rel-SjATB8bB_-gB) (!!)policy_server FAILED: Can't open sql obj for reading: No such file or directory at (eval 109) line 375, <GEN311> line 5.

When I looked in the database for a newly quarantined email (as a test), I see the quarantine ID set as:  XCcuPsb_SaPg

I seem to recall this used to be a random alpha-numeric number so this confuses me. What could have happened?

Thanks.

----

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

2

Re: Error releasing from quarantine

Does it work with below command?

pgsql> ALTER DATABASE amavisd SET bytea_output TO 'escape';

This was reported by another customer before:
http://www.iredmail.org/forum/post30545.html#p30545

3

Re: Error releasing from quarantine

haha, sorry, i forgot i had opened this similar ticket. well, i tried your solution and it still doesn't work. Not sure what I'm missing. Thanks for your help. anything else we can try?

4

Re: Error releasing from quarantine

one more thing to add; after making your config change, that msg id is populated correctly now and i can see it but it still doesn't work and produces the same errant log entry when releasing.

5

Re: Error releasing from quarantine

fsantiago06111979 wrote:

i tried your solution and it still doesn't work

Did you try to restart PGSQL and Amavisd services? Does it work?

If it doesn't work, i have no idea yet. What's the value of parameter "bytea_output" on your PGSQL server for Amavisd db?

6

Re: Error releasing from quarantine

It still doesn't work and the value is escape.

7

Re: Error releasing from quarantine

here's a more detailed log of the problem happening:

Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) preprocess_policy_query: opening in sql: BCYfoJMye12j
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) preprocess_policy_query: missing partition_tag in request, fetching msgs record for mail_id=BCYfoJMye12j
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) sql begin, nontransaction
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) Connecting to SQL database server
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) connect_to_sql: trying 'DBI:Pg:database=amavisd;host=127.0.0.1;port=5432'
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) connect_to_sql: 'DBI:Pg:database=amavisd;host=127.0.0.1;port=5432' succeeded
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) sql: preparing and executing (1 args): SELECT partition_tag FROM msgs WHERE mail_id=?
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) release: no records with msgs.mail_id=BCYfoJMye12j in a database, trying to read from a quar. anyway
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) release: opening mail_id=BCYfoJMye12j, partition_tag=
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) sql begin, nontransaction
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) sql: preparing and executing (2 args): SELECT mail_text FROM quarantine WHERE partition_tag=? AND mail_id=? ORDER BY chunk_ind
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) Amavis::IO::SQL::open r drv=Pg (SELECT mail_text FROM quarantine WHERE partition_tag=? AND mail_id=? ORDER BY chunk_ind); key=BCYfoJMye12j, p_tag=, s:
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) Amavis::IO::SQL::open key=BCYfoJMye12j, p_tag=: no such record
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) TempDir::DESTROY called
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) TempDir removal: empty tempdir is being removed: /var/spool/amavisd/tmp/amavis-20140807T100944-03731-x0UQ6Q7u
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) rmdir_recursively: /var/spool/amavisd/tmp/amavis-20140807T100944-03731-x0UQ6Q7u, excl=
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) (!!)policy_server FAILED: Can't open sql obj for reading: No such file or directory at (eval 109) line 375, <GEN26> line 5.
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) size: 0, TIMING [total 21 ms] - got data: 0.0 (0%)0, mkdir tempdir: 2.2 (10%)10, sql-connect: 12 (55%)66, rmdir: 7 (32%)98, rundown: 0.4 (2%)100
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) switch_to_client_time 480 s, receiving AM.PDP data
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) get_deadline switch_to_my_time(end of AM.PDP session) - deadline in 480.0 s, set to 336.000 s
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) prolong_timer switch_to_my_time(end of AM.PDP session): timer 336, was 480, deadline in 480.0 s
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) exiting process_request
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) idle_proc, bye: was busy, 32.2 ms, total idle 0.000 s, busy 0.032 s
Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) load: 100 %, total idle 0.000 s, busy 0.032 s

8

Re: Error releasing from quarantine

Another note; in my db, all partition_tag table fields are empty. could this be related?

9

Re: Error releasing from quarantine

It looks the same as your old topic:
http://www.iredmail.org/forum/topic7024 … grade.html

I have no idea yet. Can you release newly quarantined mails? i mean emails quarantined after you altered Amavisd db.

10

Re: Error releasing from quarantine

Nope, still doesn't work.

these log lines:

sql: preparing and executing (2 args): SELECT mail_text FROM quarantine WHERE partition_tag=? AND mail_id=? ORDER BY chunk_ind
Aug 11 11:55:22 mail amavis[20653]: (rel-yo2fm1sf0oFv) Amavis::IO::SQL::open r drv=Pg (SELECT mail_text FROM quarantine WHERE partition_tag=? AND mail_id=? ORDER BY chunk_ind); key=yo2fm1sf0oFv, p_tag=, s:
Aug 11 11:55:22 mail amavis[20653]: (rel-yo2fm1sf0oFv) Amavis::IO::SQL::open key=yo2fm1sf0oFv, p_tag=: no such record


they specify key=...

are they looking for a table called "key" when it should really be mailid? The indicated ID value is correct but it claims to not find it. it does exist under mailid. or is key a generic term which references the value under mailid? Sorry for not being fluent in pgsql speak. Thanks.

11

Re: Error releasing from quarantine

fsantiago06111979 wrote:

Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) release: no records with msgs.mail_id=BCYfoJMye12j in a database, trying to read from a quar. anyway

Usually, a quarantined message will have one record in SQL table "amavisd.msgs" with the same value of column "mail_id". But it doesn't exist on your server (amavisd.msgs). That's weird.

fsantiago06111979 wrote:

they specify key=...
are they looking for a table called "key" when it should really be mailid?

When Amavisd inserting a record in "amavisd.msgs", it will generate a private key. iRedMail configures Amavisd to require this private key while releasing quarantined mail.

Which version of iRedAdmin-Pro are you running?

12

Re: Error releasing from quarantine

ZhangHuangbin wrote:
fsantiago06111979 wrote:

Aug  7 10:09:44 mail amavis[3731]: (rel-BCYfoJMye12j) release: no records with msgs.mail_id=BCYfoJMye12j in a database, trying to read from a quar. anyway

Usually, a quarantined message will have one record in SQL table "amavisd.msgs" with the same value of column "mail_id". But it doesn't exist on your server (amavisd.msgs). That's weird.

fsantiago06111979 wrote:

they specify key=...
are they looking for a table called "key" when it should really be mailid?

When Amavisd inserting a record in "amavisd.msgs", it will generate a private key. iRedMail configures Amavisd to require this private key while releasing quarantined mail.

Which version of iRedAdmin-Pro are you running?

V1.4.2

13

Re: Error releasing from quarantine

Is this the same server you mentioned in another thread?
http://www.iredmail.org/forum/post30545.html#p30545

I have no idea yet, could you please paste your whole Amavisd config file (remove password in it before attaching)?

14

Re: Error releasing from quarantine

yes, it's the same server. config file attached.

Post's attachments

amavisd.conf 26.74 kb, 2 downloads since 2014-08-14 

You don't have the permssions to download the attachments of this post.

15

Re: Error releasing from quarantine

Amavisd config file looks just fine. I have no idea.

Did you restart Amavisd and PostgreSQL services after this SQL command?

pgsql> ALTER DATABASE amavisd SET bytea_output TO 'escape';

16

Re: Error releasing from quarantine

ZhangHuangbin wrote:

Amavisd config file looks just fine. I have no idea.

Did you restart Amavisd and PostgreSQL services after this SQL command?

pgsql> ALTER DATABASE amavisd SET bytea_output TO 'escape';

Yes I did.

17

Re: Error releasing from quarantine

We have to debug both iRedAdmin-Pro and Amavisd to figure it out. Is it possible to let me login to your server for further debugging?

18

Re: Error releasing from quarantine

ZhangHuangbin wrote:

We have to debug both iRedAdmin-Pro and Amavisd to figure it out. Is it possible to let me login to your server for further debugging?

Yeh sure. I'll set it up later today and email you the info this evening. Thanks.

19

Re: Error releasing from quarantine

you're all setup and i've emailed the details to you directly. thank you. let me know if you need anything else.

20

Re: Error releasing from quarantine

i just realized something else; i made a domain inactive in the admin but the icons next to the domain list don't reflect the change. it still claims it as active on the overall domain list but in reality / internally the system does recognize it's not. if i open that domain's settings it is set to inactive but the icons on the list (the blue circle) don't reflect the correct status.

So there's something larger going on with my server / db server, ever since my upgrade to v9.1.14. strange?????

21

Re: Error releasing from quarantine

Sounds like a bug in iRedAdmin-Pro, i will try to reproduce this issue and come back to you later.

22

Re: Error releasing from quarantine

ZhangHuangbin wrote:

Sounds like a bug in iRedAdmin-Pro, i will try to reproduce this issue and come back to you later.

Thank you.

I emailed you the missing info you required for testing. Thanks.

23

Re: Error releasing from quarantine

the quarantine issue is fixed. they released an update to amavisd-new and now it works fine after i patched mine. so we can close this case. thanks for your help.

24

Re: Error releasing from quarantine

Where did you get the patch? Could you please share the patch?

25

Re: Error releasing from quarantine

ZhangHuangbin wrote:

Where did you get the patch? Could you please share the patch?

I'm sorry; I had misspoke. I didn't actually install a patch per say. I installed an update via yum that became available named:

amavisd-new-2.9.1-2.el6.noarch

I had also modified my conf file in the following ways:

1.) set log level to 2

2.) commented out a line that set syslog priority to debug.

3.) changed my local domains map from 1 to the actual full list of my domains that was there by default.

After all that and a service restart everything worked fine.