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