Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
Dear team,

I get this error messages in my logfile more frequently:

May 21 21:23:51 xxxx kernel: May 21 21:23:51 xxxx postfix/postscreen[77391]: fatal: btree:/var/db/postfix/postscreen_cache: unable to get exclusive lock: Resource temporarily unavailable

Can you tell me what exactly goes wrong and how to solve this? Thanks.

Best regards,
Jos Chrispijn

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Wietse Venema
Jos Chrispijn:
> Dear team,
>
> I get this error messages in my logfile more frequently:
>
> May 21 21:23:51 xxxx kernel: May 21 21:23:51 xxxx
> postfix/postscreen[77391]: fatal: btree:/var/db/postfix/postscreen_cache:
> unable to get exclusive lock: Resource temporarily unavailable

postscreen needs exclusive access to the btree file, and some other
program other program already has access to the file (exclusive or
non-exclusive). That could be another postscreen, or postmap, or
some other program.

> Can you tell me what exactly goes wrong and how to solve this? Thanks.

Some other program already has access to the file. Don't do that.
Or someone has messed with Postfix source code. Don't do that.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 22-5-19 13:11, Wietse Venema wrote:
postscreen needs exclusive access to the btree file, and some other
program other program already has access to the file (exclusive or
non-exclusive). That could be another postscreen, or postmap, or
some other program.

As far as I know there are no other programs using the btree file.
I will check further, thanks for your reply.

/jos

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Wietse Venema
Jos Chrispijn:
> On 22-5-19 13:11, Wietse Venema wrote:
> > postscreen needs exclusive access to the btree file, and some other
> > program other program already has access to the file (exclusive or
> > non-exclusive). That could be another postscreen, or postmap, or
> > some other program.
>
> As far as I know there are no other programs using the btree file.
> I will check further, thanks for your reply.

It is also possible that your kernel can't handle the exclusive
lock request because it is running out of kernel resources. How
often are you restarting/reloading Postfix?

I have some supicions, but let's hear from you first.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 23-5-19 14:27, Wietse Venema wrote:
It is also possible that your kernel can't handle the exclusive
lock request because it is running out of kernel resources. How
often are you restarting/reloading Postfix?

I have some supicions, but let's hear from you first.
Interesting that you ask, as I just checked postfix after a restart and it all goes well again.
Decided to restart from cron every 12 hours, but I guess that is just symptom suppression

/jos

  



	
	
	
	
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 29-5-19 19:21, Jos Chrispijn wrote:
Interesting that you ask, as I just checked postfix after a restart and it all goes well again.
Decided to restart from cron every 12 hours, but I guess that is just symptom suppression

A friend advised me to run /postfix/update and it looks as if this did the trick. Part of that file contains:
 
newaliases
postalias hash:/etc/aliases
postfix reload
postfix flush


Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

@lbutlr
On 30 May 2019, at 02:39, Jos Chrispijn <[hidden email]> wrote:
> A friend advised me to run /postfix/update and it looks as if this did the trick. Part of that file contains:
>  
> newaliases
> postalias hash:/etc/aliases
> postfix reload
> postfix flush

Wher
e did that come from? (It doesn't exist on my system).

I don't know about you, but new aliases and postalias and postmap are tools that I run extremely rarely. I think the last made I made to aliases might have been as much as 10 years ago. I've changed virtual more frequently, but still rarely.

postfix flush is nearly always a bad idea, and I can't imagine it's useful after a reload, or at least I can't think of a reason you'd want to do that; if you've reloaded, postfix will requeue the mail on its own.


--
"If you make people think they're thinking, they'll love you; But if you
really make them think, they'll hate you." - Don Marquis


Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 30-5-19 12:52, @lbutlr wrote:
On 30 May 2019, at 02:39, Jos Chrispijn [hidden email] wrote:
Where did that come from? (It doesn't exist on my system).
Amongst others (updating tables), this is now standard on my Postfix upgrade batch.
I don't know about you, but new aliases and postalias and postmap are tools that I run extremely rarely. I think the last made I made to aliases might have been as much as 10 years ago. I've changed virtual more frequently, but still rarely.

postfix flush is nearly always a bad idea, and I can't imagine it's useful after a reload, or at least I can't think of a reason you'd want to do that; if you've reloaded, postfix will requeue the mail on its own.

I had to trace the cause of the issue; found out that running this on a regular basis (at least after postfix and/or Dovecot) update this did the trick for me.

Wietse, does this match the cause you expected it to be?

Thanks, Jos

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Wietse Venema
Jos Chrispijn:
> Wietse, does this match the cause you expected it to be?

On a sane system (LINUX included), Postfix can run without ever
needing a baby sitter cronjob.

What I suspected was an effed-up system; your need to run a baby
sitter cronjob confirms my suspicion.

Are you running Postfix on real hardware, or on some mini-size box
like a Raspberry, or some other resource-constrained environment
like a VPS or jail?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 30-5-19 13:50, Wietse Venema wrote:
On a sane system (LINUX included), Postfix can run without ever
needing a baby sitter cronjob.
OK - never experienced this issue but only for the last few weeks.
What I suspected was an effed-up system; your need to run a baby
sitter cronjob confirms my suspicion.

I ran Postfix' update batch that contains (amongst others)

newaliases
postalias hash:/etc/aliases
postfix reload
postfix flush

and it seems that this did the trick - no errors anymore.

Are you running Postfix on real hardware, or on some mini-size box
like a Raspberry, or some other resource-constrained environment
like a VPS or jail?

The issue I had was on a real server.
My other server runs on a Raspberry indeed, on which I have no Postfix issues - running smoothly.
No VPS or Jail involved.


-- With both feet on the ground you can't make any step forward

Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Wietse Venema
Jos Chrispijn:
> On 30-5-19 13:50, Wietse Venema wrote:
> > On a sane system (LINUX included), Postfix can run without ever
> > needing a baby sitter cronjob.

> OK - never experienced this issue but only for the last few weeks.

What has changed? Not Postfix as far as I can tell.

> > What I suspected was an effed-up system; your need to run a baby
> > sitter cronjob confirms my suspicion.
>
> I ran Postfix' update batch that contains (amongst others)
>
> newaliases
> postalias hash:/etc/aliases
> postfix reload
> postfix flush
>
> and it seems that this did the trick - no errors anymore.

Again, this confirms my suspicion that the system has gotten messed
up. Postfix has been around for decennia and it does not require
restarts to stay functional.

BTW I set the Reply-To header to 'postfix-users'. Please do not
send a duplicate of every response to my personal email address.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 30-5-19 14:25, Wietse Venema wrote:
Again, this confirms my suspicion that the system has gotten messed
up. Postfix has been around for decennia and it does not require
restarts to stay functional.

Ok, thanks y'all for helping out. Everything is fine now.

/jos

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jan Ceuleers
On 30/05/2019 14:41, Jos Chrispijn wrote:
> On 30-5-19 14:25, Wietse Venema wrote:
>> Again, this confirms my suspicion that the system has gotten messed
>> up. Postfix has been around for decennia and it does not require
>> restarts to stay functional.
>
> Ok, thanks y'all for helping out. Everything is fine now.
>
Jos, what I think everybody is trying to tell you is that your cron job
has swept the problem under the rug, for now, but that it is still there.
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
Hi Jan,

On 30-5-19 14:47, Jan Ceuleers wrote:
Jos, what I think everybody is trying to tell you is that your cron job
has swept the problem under the rug, for now, but that it is still there.

Yes, I noted, thanks for that.

What I have done is running this batch after a Postfix or Dovecot update and the issue has gone away.

#! /bin/sh -x
newaliases
postalias hash:/etc/aliases
postmap hash:/postfix/tables/transport
postmap hash:/postfix/tables/virtual_alias_domains
postmap hash:/postfix/tables/virtual_alias_maps
postmap hash:/postfix/tables/helo_checks
postmap hash:/postfix/tables/sender_checks
postmap hash:/postfix/tables/spamtrap
postfix reload
postfix flush

/jos

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Wietse Venema
Jos Chrispijn:

> Hi Jan,
>
> On 30-5-19 14:47, Jan Ceuleers wrote:
> > Jos, what I think everybody is trying to tell you is that your cron job
> > has swept the problem under the rug, for now, but that it is still there.
>
> Yes, I noted, thanks for that.
>
> What I have done is running this batch after a Postfix or Dovecot update
> and the issue has gone away.
>
> #! /bin/sh -x
> newaliases alias maps are not used by postscreen
> postalias hash:/etc/aliases that is like newaliases all over again
> postmap hash:/postfix/tables/transport not used by postscreen
> postmap hash:/postfix/tables/virtual_alias_domains not used by postscreen
> postmap hash:/postfix/tables/virtual_alias_maps not used by postscreen
> postmap hash:/postfix/tables/helo_checks not used by postscreen
> postmap hash:/postfix/tables/sender_checks not used by postscreen
> postmap hash:/postfix/tables/spamtrap what is this?
> postfix reload
> postfix flush

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Jos Chrispijn-3
On 3-6-19 13:09, Wietse Venema wrote:
postmap hash:/postfix/tables/spamtrap what is this?

# spamtrap 180711
partmaps@                       DISCARD

in main.cf
check_recipient_access  hash:/postfix/tables/spamtrap,

I added this some time ago referring to

http://postfix.1071664.n5.nabble.com/Need-to-clarfiy-how-to-implement-spamtrap-address-checking-amp-discard-with-before-queue-filtering-td761.html

/jos


-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Postscreen - fatal: btree:/var/db/postfix/postscreen_cache

Wietse Venema
Jos Chrispijn:
[ Charset windows-1252 converted... ]

> On 3-6-19 13:09, Wietse Venema wrote:
> > postmap hash:/postfix/tables/spamtrap what is this?
>
> # spamtrap 180711
> partmaps@?????????????????????? DISCARD
>
> in main.cf
> check_recipient_access? hash:/postfix/tables/spamtrap,
>
> I added this some time ago referring to
>
> http://postfix.1071664.n5.nabble.com/Need-to-clarfiy-how-to-implement-spamtrap-address-checking-amp-discard-with-before-queue-filtering-td761.html

This is also not used by postscreen. Happy cargo-culting...

        Wietse