Loading ...
Sorry, an error occurred while loading the content.

fatal: proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table lookup problem

Expand Messages
  • Simon Brereton
    Hi After years of a smoothly running mail server, my logs are starting to fill with this error message: fatal:
    Message 1 of 5 , Mar 5, 2013
    • 0 Attachment
      Hi

      After years of a smoothly running mail server, my logs are starting to
      fill with this error message:
      fatal: proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table
      lookup problem


      I haven't updated anything or changed any configs (in either mysql or
      postfix) so I'd appreciate some hints as to how to track this down?

      According to mysql postfix is behaving properly (as you'd expect).

      +------+---------+-----------+-------+---------+------+-------+------------------+
      | Id | User | Host | db | Command | Time | State | Info |
      +------+---------+-----------+-------+---------+------+-------+------------------+
      | 379 | postfix | localhost | Mail | Sleep | 25 | | NULL
      |


      So I'm not sure why it thinks there is a lock. I found one stub that
      suggested this happened with the mysql.sock was not in the chroot
      jail. But as I said, it's been running flawlessly for years, so I
      don't forsee that as the issue.

      Nevertheless, here's my postconf -n

      access_map_reject_code = 550
      alias_database = hash:/etc/postfix/aliases
      alias_maps = $alias_database
      allow_untrusted_routing = no
      append_dot_mydomain = no
      biff = no
      body_checks_size_limit = 51200
      bounce_size_limit = 50000
      broken_sasl_auth_clients = yes
      command_directory = /usr/sbin
      config_directory = /etc/postfix
      content_filter = smtp-amavis:[127.0.0.1]:10024
      daemon_directory = /usr/lib/postfix
      debug_peer_level = 1
      default_destination_concurrency_limit = 25
      disable_vrfy_command = yes
      fast_flush_domains = $relay_domains
      header_checks = regexp:/etc/postfix/header_checks
      header_size_limit = 102400
      home_mailbox = Maildir/
      inet_interfaces = all
      invalid_hostname_reject_code = 501
      local_destination_concurrency_limit = 2
      local_recipient_maps = proxy:unix:passwd.byname $virtual_alias_maps $alias_maps
      mail_spool_directory = /var/spool/mail
      mailbox_command = procmail -a "$EXTENSION"
      mailbox_size_limit = 5120000000
      message_size_limit = 20480000
      mydestination =
      mydomain = perlphreak.net
      myhostname = mail.perphreak.net
      mynetworks = 127.0.0.0/8
      mynetworks_style = host
      myorigin = $mydomain
      recipient_delimiter = -
      reject_code = 550
      relay_domains = /etc/postfix/mxbackups
      relay_domains_reject_code = 550
      relayhost =
      smtp_tls_CAfile = /etc/ssl/keys/perlphreak-ca.crt
      smtp_tls_cert_file = /etc/ssl/keys/mail.perlphreak.net.crt
      smtp_tls_key_file = /etc/ssl/private/mail.perlphreak.net.key
      smtp_tls_loglevel = 1
      smtp_tls_note_starttls_offer = yes
      smtp_tls_security_level = may
      smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
      smtp_tls_session_cache_timeout = 3600s
      smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Debian/GNU)
      smtpd_data_restrictions = sleep 1, reject_unauth_pipelining, permit
      smtpd_delay_reject = yes
      smtpd_helo_required = yes
      smtpd_recipient_limit = 250
      smtpd_recipient_restrictions = reject_non_fqdn_sender,
      reject_non_fqdn_recipient, permit_sasl_authenticated,
      reject_sender_login_mismatch,
      reject_authenticated_sender_login_mismatch, check_helo_access
      hash:/etc/postfix/helo_checks, reject_invalid_helo_hostname,
      reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname,
      reject_unknown_sender_domain, reject_unknown_recipient_domain,
      permit_mynetworks, reject_unauth_destination,
      reject_unlisted_recipient, check_recipient_access
      mysql:/etc/postfix/Mail-Disabled.cf, check_helo_access
      hash:/etc/postfix/helo_checks, check_recipient_access
      hash:/etc/postfix/laxdomains, check_client_access
      hash:/etc/postfix/ip_whitelist, check_sender_access
      hash:/etc/postfix/backscatter
      check_reverse_client_hostname_access pcre:/etc/postfix/fqrdns.pcre,
      check_policy_service unix:private/policy-spf, check_policy_service
      inet:127.0.0.1:10031, reject_rbl_client bl.spamcop.net,
      reject_rbl_client zen.spamhaus.org, permit
      smtpd_sasl_auth_enable = yes
      smtpd_sasl_local_domain = perlphreak.net
      smtpd_sasl_path = private/auth
      smtpd_sasl_security_options = noanonymous
      smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
      smtpd_sasl_type = dovecot
      smtpd_timeout = 300s
      smtpd_tls_CAfile = /etc/ssl/keys/perlphreak-ca.crt
      smtpd_tls_auth_only = no
      smtpd_tls_cert_file = /etc/ssl/keys/mail.perlphreak.net.crt
      smtpd_tls_key_file = /etc/ssl/private/mail.perlphreak.net.key
      smtpd_tls_loglevel = 1
      smtpd_tls_received_header = yes
      smtpd_tls_security_level = may
      smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
      smtpd_tls_session_cache_timeout = 3600s
      strict_rfc821_envelopes = yes
      tls_random_source = dev:/dev/urandom
      unknown_address_reject_code = 554
      unknown_client_reject_code = 554
      unknown_hostname_reject_code = 554
      unknown_local_recipient_reject_code = 554
      virtual_alias_maps = hash:/etc/postfix/virtual_user_aliases,
      proxy:mysql:/etc/postfix/mailalias.cf
      virtual_gid_maps = static:115
      virtual_mailbox_base = /var/spool/mail/virtual
      virtual_mailbox_domains = proxy:mysql:/etc/postfix/maildomain.cf
      virtual_mailbox_limit = 5000000000
      virtual_mailbox_limit_inbox = no
      virtual_mailbox_limit_maps = mysql:/etc/postfix/Mail-Quota.cf
      virtual_mailbox_limit_override = yes
      virtual_mailbox_maps = mysql:/etc/postfix/Mail-Mailbox.cf
      virtual_maildir_extended = yes
      virtual_maildir_limit_message = "User over quota, try again later"
      virtual_minimum_uid = 108
      virtual_overquota_bounce = yes
      virtual_transport = dovecot
      virtual_uid_maps = static:108

      The relevant lines from master.cf

      # ==========================================================================
      # service type private unpriv chroot wakeup maxproc command + args
      # (yes) (yes) (yes) (never) (100)
      # ==========================================================================
      smtp inet n - - - - smtpd -v
      submission inet n - n - - smtpd
      -o syslog_name=postfix/submission
      -o smtpd_delay_reject=yes
      -o receive_override_options=no_address_mappings
      -o always_add_missing_headers=yes
      -o content_filter=dksign:[127.0.0.1]:10028
      -o smtpd_enforce_tls=yes
      -o smtpd_sasl_auth_enable=yes
      -o smtpd_tls_security_level=encrypt
      -o smtpd_tls_auth_only=yes
      -o smtpd_recipient_restrictions=reject_non_fqdn_sender,reject_non_fqdn_recipient,permit_sasl_authenticated,reject


      Should submission be chrooted? I can't see why it would need to be if
      smtp isn't. It is working, but I'm happy to change it if that's the
      issue.

      Thanks

      Simon
    • Wietse Venema
      ... I would expcet to see some warning before an uninformative fatal message. BTW the (0,lock|fold_fix) are Postfix-internal flags. It does not mean that
      Message 2 of 5 , Mar 5, 2013
      • 0 Attachment
        Simon Brereton:
        > Hi
        >
        > After years of a smoothly running mail server, my logs are starting to
        > fill with this error message:
        > fatal: proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table
        > lookup problem

        I would expcet to see some warning before an uninformative "fatal" message.
        BTW the "(0,lock|fold_fix)" are Postfix-internal flags. It does not mean
        that there is a problem locking mysql. the lock would be used with
        files such as Berkeley DB.

        Wietse
      • Simon Brereton
        ... Yes, I suppose there would be! I found two different types. Mar 5 08:45:12 mail postfix/smtpd[24830]: connect from unknown[117.6.222.107] Mar 5 08:45:14
        Message 3 of 5 , Mar 5, 2013
        • 0 Attachment
          On 5 March 2013 16:47, Wietse Venema <wietse@...> wrote:
          > Simon Brereton:
          >> Hi
          >>
          >> After years of a smoothly running mail server, my logs are starting to
          >> fill with this error message:
          >> fatal: proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table
          >> lookup problem
          >
          > I would expcet to see some warning before an uninformative "fatal" message.
          > BTW the "(0,lock|fold_fix)" are Postfix-internal flags. It does not mean
          > that there is a problem locking mysql. the lock would be used with
          > files such as Berkeley DB.
          >
          > Wietse

          Yes, I suppose there would be! I found two different types.

          Mar 5 08:45:12 mail postfix/smtpd[24830]: connect from unknown[117.6.222.107]
          Mar 5 08:45:14 mail postfix/proxymap[24831]: warning: mysql query
          failed: MySQL server has gone away
          Mar 5 08:45:14 mail postfix/trivial-rewrite[24833]: fatal:
          proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table lookup
          problem
          Mar 5 08:45:15 mail postfix/master[4283]: warning: process
          /usr/lib/postfix/trivial-rewrite pid 24833 exit status 1
          Mar 5 08:45:16 mail postfix/trivial-rewrite[24854]: fatal:
          proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table lookup
          problem
          Mar 5 08:45:17 mail postfix/smtpd[24830]: warning: problem talking to
          service rewrite: Success
          Mar 5 08:45:17 mail postfix/master[4283]: warning: process
          /usr/lib/postfix/trivial-rewrite pid 24854 exit status 1
          Mar 5 08:45:17 mail postfix/master[4283]: warning:
          /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

          and

          Mar 5 10:53:21 mail postfix/smtpd[29350]: connect from unknown[81.213.239.67]
          Mar 5 10:53:22 mail postfix/proxymap[26043]: warning: connect to
          mysql server localhost: Can't connect to local MySQL server through
          socket '/var/run/mysqld/mysqld.sock' (2)
          Mar 5 10:53:22 mail postfix/trivial-rewrite[26046]: fatal:
          proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table lookup
          problem
          Mar 5 10:53:23 mail postfix/master[4283]: warning: process
          /usr/lib/postfix/trivial-rewrite pid 26046 exit status 1
          Mar 5 10:53:24 mail postfix/trivial-rewrite[29357]: fatal:
          proxy:mysql:/etc/postfix/mailalias.cf(0,lock|fold_fix): table lookup
          problem
          Mar 5 10:53:25 mail postfix/smtpd[29350]: warning: problem talking to
          service rewrite: Success
          Mar 5 10:53:25 mail postfix/master[4283]: warning: process
          /usr/lib/postfix/trivial-rewrite pid 29357 exit status 1
          Mar 5 10:53:25 mail postfix/master[4283]: warning:
          /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling

          mysqld.sock does exist..

          mail:~# ls /var/run/mysqld/mysqld.sock
          srwxrwxrwx 1 mysql mysql 0 Mar 5 12:14 /var/run/mysqld/mysqld.sock



          I rebooted the box and until now I haven't had a repeat of the error.
          I suppose it's just possible that after ~500 days uptime a reset was
          needed, but I'm always wary when problems like this suddenly appear.
          There isn't a heavy load, and so I tend to regard symptoms like this
          as highly suspicious. As per my initial email, I don't think postfix
          caused this in anyway, but of course it felt the force of it. I
          wonder now I can increase the redundancy.

          Simon
        • Wietse Venema
          ... The mysql server closed the connection (or crashed). ... The mysql did not accept connections (probably was not running). Wietse
          Message 4 of 5 , Mar 5, 2013
          • 0 Attachment
            Simon Brereton:
            > Mar 5 08:45:14 mail postfix/proxymap[24831]: warning: mysql query
            > failed: MySQL server has gone away

            The mysql server closed the connection (or crashed).

            > Mar 5 10:53:22 mail postfix/proxymap[26043]: warning: connect to
            > mysql server localhost: Can't connect to local MySQL server through
            > socket '/var/run/mysqld/mysqld.sock' (2)

            The mysql did not accept connections (probably was not running).

            Wietse
          • Simon Brereton
            ... Thanks Wietse - I ll continue looking for a cause elsewhere.. Simon
            Message 5 of 5 , Mar 5, 2013
            • 0 Attachment


              On 5 Mar 2013 19:07, "Wietse Venema" <wietse@...> wrote:
              >
              > Simon Brereton:
              > > Mar  5 08:45:14 mail postfix/proxymap[24831]: warning: mysql query
              > > failed: MySQL server has gone away
              >
              > The mysql server closed the connection (or crashed).
              >
              > > Mar  5 10:53:22 mail postfix/proxymap[26043]: warning: connect to
              > > mysql server localhost: Can't connect to local MySQL server through
              > > socket '/var/run/mysqld/mysqld.sock' (2)
              >
              > The mysql did not accept connections (probably was not running).
              >

              Thanks Wietse - I'll continue looking for a cause elsewhere..

              Simon

            Your message has been successfully submitted and would be delivered to recipients shortly.