# Postfix: postfix/trivial-rewrite[26000]: fatal: proxy:mysql:/etc/postfix/mysql-virtua



## GTB (1. Juni 2011)

Hallo,

ich finde seit einiger Zeit immer wieder diese Meldung im LOG.


```
postfix/trivial-rewrite[26000]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
```
Für den User äussert sich das, dass er die eMail nicht verschicken kann. Probiert man es dann einfach etwas später, dann geht die eMail problemlos durch.

Weiss wer Rat ?

Danke GTB


----------



## planet_fox (1. Juni 2011)

Prüfe mal die Daten in config 




> mysql-virtual_domains.cf


----------



## GTB (3. Juni 2011)

Hi,

die Daten stimmen, ansonsten würde es ja ein paar minuten später nicht problemlos funktionieren....


----------



## Till (6. Juni 2011)

Hast Du sonst irgendwelche Stabilitätsprobleme mit mysql?


----------



## GTB (6. Juni 2011)

Hallo Till,

auf dem Server läuft "nur" ein Forum. Allerdings stark frequentiert und eben der Mailserver dieser Community.

Ich habe vor auftreten der Probleme, Persistente MYSQL Connections deaktiviert, da das tatsächlich Probleme bereitet hatte.

Aber seidem läuft der Server wieder recht normal.


Danke GTB


----------



## GTB (7. Juni 2011)

Ich habe neue Einträge in meinem Logfile:


```
Jun 7 10:17:49 server postfix/proxymap[13619]: warning: mysql query failed: MySQL server has gone away
Jun 7 10:17:49 server postfix/trivial-rewrite[13669]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 7 10:17:50 server postfix/master[31946]: warning: process /usr/lib/postfix/trivial-rewrite pid 13669 exit status 1
Jun 7 10:17:51 server postfix/proxymap[13619]: warning: mysql query failed: MySQL server has gone away
Jun 7 10:17:51 server postfix/trivial-rewrite[21743]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 7 10:17:52 server postfix/smtpd[13618]: warning: problem talking to service rewrite: Success
Jun 7 10:17:52 server postfix/master[31946]: warning: process /usr/lib/postfix/trivial-rewrite pid 21743 exit status 1
Jun 7 10:17:52 server postfix/master[31946]: warning: /usr/lib/postfix/trivial-rewrite: bad command startup -- throttling
Jun 7 10:18:52 server postfix/smtpd[13618]: warning: mysql query failed: MySQL server has gone away
Jun 7 10:18:52 server postfix/smtpd[13618]: warning: mysql:/etc/postfix/mysql-virtual_client.cf: table lookup problem
```


----------



## Till (7. Juni 2011)

Laut Log hat der mysql Server die Verbindung nicht angenommen. Hast Du irgendwelche mysql spezifischen Fehler im syslog oder im mysql log?


----------



## GTB (7. Juni 2011)

syslog:


```
Jun  7 10:17:51 server postfix/proxymap[13619]: warning: mysql query failed: MySQL server has gone away
Jun  7 10:17:51 server postfix/trivial-rewrite[21743]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun  7 10:18:52 server postfix/smtpd[13618]: warning: mysql query failed: MySQL server has gone away
Jun  7 10:18:52 server postfix/smtpd[13618]: warning: mysql:/etc/postfix/mysql-virtual_client.cf: table lookup problem
Jun  7 11:35:28 server amavis[7475]: (07475-08) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN73> line 3.
Jun  7 11:37:51 server amavis[7475]: (07475-09) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN79> line 3.
Jun  7 11:55:47 server amavis[7742]: (07742-04) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN49> line 5.
Jun  7 11:57:03 server amavis[8102]: (08102-02) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN43> line 3.
Jun  7 12:15:11 server amavis[7742]: (07742-05) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN56> line 3.
Jun  7 12:18:02 server amavis[8102]: (08102-03) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN49> line 3.
Jun  7 12:18:50 server mysqld[31816]: 110607 12:18:50 [Note] /usr/sbin/mysqld: Normal shutdown
Jun  7 12:18:50 server mysqld[31816]: 
Jun  7 12:18:53 server mysqld[31816]: 110607 12:18:53  InnoDB: Starting shutdown...
Jun  7 12:18:55 server postfix/proxymap[24079]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)
Jun  7 12:18:55 server postfix/proxymap[24079]: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111)
Jun  7 12:18:55 server postfix/trivial-rewrite[24081]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun  7 12:18:55 server mysqld[31816]: 110607 12:18:55  InnoDB: Shutdown completed; log sequence number 0 535075299
Jun  7 12:18:55 server mysqld[31816]: 110607 12:18:55 [Note] /usr/sbin/mysqld: Shutdown complete
Jun  7 12:18:55 server mysqld[31816]: 
Jun  7 12:18:55 server mysqld_safe[24110]: ended
Jun  7 12:18:56 server mysqld_safe[24327]: started
Jun  7 12:18:56 server mysqld[24330]: 110607 12:18:56  InnoDB: Started; log sequence number 0 535075299
Jun  7 12:18:57 server mysqld[24330]: 110607 12:18:57 [Note] /usr/sbin/mysqld: ready for connections.
Jun  7 12:18:57 server mysqld[24330]: Version: '5.0.51a-24+lenny5-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
Jun  7 12:18:57 server postfix/trivial-rewrite[24441]: fatal: proxy:mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun  7 12:18:57 server /etc/mysql/debian-start[24496]: Upgrading MySQL tables if necessary.
Jun  7 12:18:57 server /etc/mysql/debian-start[24501]: Looking for 'mysql' in: /usr/bin/mysql
Jun  7 12:18:57 server /etc/mysql/debian-start[24501]: Looking for 'mysqlcheck' in: /usr/bin/mysqlcheck
Jun  7 12:18:57 server /etc/mysql/debian-start[24501]: This installation of MySQL is already upgraded to 5.0.51a, use --force if you still need to run mysql_upgrade
Jun  7 12:18:57 server /etc/mysql/debian-start[24511]: Checking for insecure root accounts.
Jun  7 12:18:57 server /etc/mysql/debian-start[24519]: Triggering myisam-recover for all MyISAM tables
Jun  7 12:19:58 server amavis[7742]: (07742-06) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 86) line 166, <GEN68> line 5.
```
mysql Log ist deaktiviert aus Performance Gründen.


----------



## Till (7. Juni 2011)

Die postfix Fehler erscjeinen nr wenn mysql neu gestartet wurde. Es ist also folgerichtig dass sich postfix dann nicht verbinden kann. Wenn also eine Email ankommt während mysql gerade gestoppt ist, dann tritt solch ein Fehler auf.

Hast Du mysql manuell neu gestartet oder passiert das durch irgendeinen Cronjob?


----------



## GTB (7. Juni 2011)

ich hatte MYSQL neu gestartet...


----------



## GTB (15. Juni 2011)

also ich kriege das nicht hin. Es sind immer wieder diese Meldungen in mail.err


```
Jun 14 21:16:40 server postfix/trivial-rewrite[1445]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 14 21:19:42 server postfix/trivial-rewrite[1571]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 00:53:10 server postfix/trivial-rewrite[7472]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:31:49 server postfix/smtp[12661]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:32:49 server postfix/error[13749]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:44:48 server postfix/smtp[13826]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:51:49 server postfix/smtp[14900]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:52:49 server postfix/error[15222]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:56:49 server postfix/smtp[15241]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 02:57:49 server postfix/error[15526]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:06:50 server postfix/smtp[15545]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:11:50 server postfix/smtp[22685]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:12:50 server postfix/error[23002]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:15:50 server postfix/trivial-rewrite[23045]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:25:50 server postfix/trivial-rewrite[23757]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:36:50 server postfix/trivial-rewrite[25176]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:38:50 server postfix/trivial-rewrite[25689]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:39:49 server postfix/trivial-rewrite[25894]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:39:52 server postfix/smtp[25173]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:47:50 server postfix/smtp[26405]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:48:50 server postfix/error[26710]: fatal: mysql:/etc/postfix/mysql-virtual_relaydomains.cf(0,lock|fold_fix): table lookup problem
Jun 15 03:56:50 server postfix/trivial-rewrite[27542]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
Jun 15 09:59:48 server postfix/trivial-rewrite[21097]: fatal: mysql:/etc/postfix/mysql-virtual_domains.cf(0,lock|fold_fix): table lookup problem
```
das eine mal funktioniert der Mailversand, das andere mal nicht.

Hat ncoh wer eine Idee dazu ?

Danke GTB


----------



## GTB (20. Juni 2011)

*Gelöst*

OK, habe die Fehlermeldung weg.

mein wait_timeout in der my.cnf war zu gering.

Danke an Alle für eure Hilfe.


----------

