Ubuntu

在 Ubuntu 執行無人值守升級會話後 PHP 引發伺服器錯誤 - 有什麼方法可以確定原因嗎?

  • March 22, 2017

我們剛剛在我們的一個網路伺服器上發生了一起事件。幾個 PHP 應用程序在其上執行並開始吐出以下錯誤消息:

php_network_getaddresses: getaddrinfo failed: Name or service not known

此消息似乎與網路/dns 相關。伺服器日誌清楚地表明,在第一個錯誤發生的時候,Ubuntu 開始了一個unattended-upgrades會話。我將附上dpkg.log下面的輸出。

我們使用外部數據庫伺服器。

我們決定重啟網路伺服器,解決了這個問題,但現在的問題是:

有什麼方法可以找出這個問題的根本原因,以便將來防止它發生?

unattended-upgrades.log 的輸出:

2017-03-21 15:01:56,279 INFO Starting unattended upgrades script
2017-03-21 15:01:56,279 INFO Allowed origins are: ['o=Ubuntu,a=xenial', 'o=Ubuntu,a=xenial-security']
2017-03-21 15:02:03,365 INFO Packages that will be upgraded: libc-bin libc-dev-bin libc6 libc6-dev libfreetype6 locales multiarch-support
2017-03-21 15:02:03,365 INFO Writing dpkg log to '/var/log/unattended-upgrades/unattended-upgrades-dpkg.log'
2017-03-21 15:02:12,851 INFO All upgrades installed

dpkg.log的輸出:

2017-03-21 15:02:03 startup archives unpack
2017-03-21 15:02:03 upgrade libc6-dev:amd64 2.23-0ubuntu5 2.23-0ubuntu6
2017-03-21 15:02:03 status half-configured libc6-dev:amd64 2.23-0ubuntu5
2017-03-21 15:02:03 status unpacked libc6-dev:amd64 2.23-0ubuntu5
2017-03-21 15:02:03 status half-installed libc6-dev:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status half-installed libc6-dev:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status unpacked libc6-dev:amd64 2.23-0ubuntu6
2017-03-21 15:02:04 status unpacked libc6-dev:amd64 2.23-0ubuntu6
2017-03-21 15:02:04 upgrade libc-dev-bin:amd64 2.23-0ubuntu5 2.23-0ubuntu6
2017-03-21 15:02:04 status half-configured libc-dev-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status unpacked libc-dev-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status half-installed libc-dev-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status triggers-pending man-db:amd64 2.7.5-1
2017-03-21 15:02:04 status half-installed libc-dev-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status unpacked libc-dev-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:04 status unpacked libc-dev-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:04 upgrade libc6:amd64 2.23-0ubuntu5 2.23-0ubuntu6
2017-03-21 15:02:04 status triggers-pending libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status half-configured libc6:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status unpacked libc6:amd64 2.23-0ubuntu5
2017-03-21 15:02:04 status half-installed libc6:amd64 2.23-0ubuntu5
2017-03-21 15:02:05 status half-installed libc6:amd64 2.23-0ubuntu5
2017-03-21 15:02:05 status unpacked libc6:amd64 2.23-0ubuntu6
2017-03-21 15:02:05 status unpacked libc6:amd64 2.23-0ubuntu6
2017-03-21 15:02:05 startup packages configure
2017-03-21 15:02:05 configure libc6:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:05 status unpacked libc6:amd64 2.23-0ubuntu6
2017-03-21 15:02:05 status unpacked libc6:amd64 2.23-0ubuntu6
2017-03-21 15:02:05 status half-configured libc6:amd64 2.23-0ubuntu6
2017-03-21 15:02:05 status installed libc6:amd64 2.23-0ubuntu6
2017-03-21 15:02:05 trigproc libc-bin:amd64 2.23-0ubuntu5 <none>
2017-03-21 15:02:05 status half-configured libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:05 status installed libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:05 trigproc man-db:amd64 2.7.5-1 <none>
2017-03-21 15:02:05 status half-configured man-db:amd64 2.7.5-1
2017-03-21 15:02:05 status installed man-db:amd64 2.7.5-1
2017-03-21 15:02:05 startup archives unpack
2017-03-21 15:02:05 upgrade locales:all 2.23-0ubuntu5 2.23-0ubuntu6
2017-03-21 15:02:05 status half-configured locales:all 2.23-0ubuntu5
2017-03-21 15:02:05 status unpacked locales:all 2.23-0ubuntu5
2017-03-21 15:02:05 status half-installed locales:all 2.23-0ubuntu5
2017-03-21 15:02:06 status triggers-pending man-db:amd64 2.7.5-1
2017-03-21 15:02:06 status half-installed locales:all 2.23-0ubuntu5
2017-03-21 15:02:06 status unpacked locales:all 2.23-0ubuntu6
2017-03-21 15:02:06 status unpacked locales:all 2.23-0ubuntu6
2017-03-21 15:02:06 upgrade libc-bin:amd64 2.23-0ubuntu5 2.23-0ubuntu6
2017-03-21 15:02:06 status half-configured libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:06 status unpacked libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:06 status half-installed libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:06 status half-installed libc-bin:amd64 2.23-0ubuntu5
2017-03-21 15:02:06 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:06 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:06 trigproc man-db:amd64 2.7.5-1 <none>
2017-03-21 15:02:06 status half-configured man-db:amd64 2.7.5-1
2017-03-21 15:02:07 status installed man-db:amd64 2.7.5-1
2017-03-21 15:02:07 startup packages configure
2017-03-21 15:02:07 configure libc-bin:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:07 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status installed libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 startup archives unpack
2017-03-21 15:02:07 upgrade multiarch-support:amd64 2.23-0ubuntu5 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured multiarch-support:amd64 2.23-0ubuntu5
2017-03-21 15:02:07 status unpacked multiarch-support:amd64 2.23-0ubuntu5
2017-03-21 15:02:07 status half-installed multiarch-support:amd64 2.23-0ubuntu5
2017-03-21 15:02:07 status half-installed multiarch-support:amd64 2.23-0ubuntu5
2017-03-21 15:02:07 status unpacked multiarch-support:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked multiarch-support:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 startup packages configure
2017-03-21 15:02:07 configure multiarch-support:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:07 status unpacked multiarch-support:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured multiarch-support:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status installed multiarch-support:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 startup archives unpack
2017-03-21 15:02:07 upgrade libfreetype6:amd64 2.6.1-0.1ubuntu2 2.6.1-0.1ubuntu2.1
2017-03-21 15:02:07 status triggers-pending libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured libfreetype6:amd64 2.6.1-0.1ubuntu2
2017-03-21 15:02:07 status unpacked libfreetype6:amd64 2.6.1-0.1ubuntu2
2017-03-21 15:02:07 status half-installed libfreetype6:amd64 2.6.1-0.1ubuntu2
2017-03-21 15:02:07 status half-installed libfreetype6:amd64 2.6.1-0.1ubuntu2
2017-03-21 15:02:07 status unpacked libfreetype6:amd64 2.6.1-0.1ubuntu2.1
2017-03-21 15:02:07 status unpacked libfreetype6:amd64 2.6.1-0.1ubuntu2.1
2017-03-21 15:02:07 trigproc libc-bin:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:07 status half-configured libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status installed libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 startup packages configure
2017-03-21 15:02:07 configure libc-dev-bin:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:07 status unpacked libc-dev-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured libc-dev-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status installed libc-dev-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 configure libc6-dev:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:07 status unpacked libc6-dev:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured libc6-dev:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 status installed libc6-dev:amd64 2.23-0ubuntu6
2017-03-21 15:02:07 configure locales:all 2.23-0ubuntu6 <none>
2017-03-21 15:02:07 status unpacked locales:all 2.23-0ubuntu6
2017-03-21 15:02:07 status unpacked locales:all 2.23-0ubuntu6
2017-03-21 15:02:07 status half-configured locales:all 2.23-0ubuntu6
2017-03-21 15:02:11 status installed locales:all 2.23-0ubuntu6
2017-03-21 15:02:11 configure libfreetype6:amd64 2.6.1-0.1ubuntu2.1 <none>
2017-03-21 15:02:11 status triggers-pending libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:11 status unpacked libfreetype6:amd64 2.6.1-0.1ubuntu2.1
2017-03-21 15:02:11 status half-configured libfreetype6:amd64 2.6.1-0.1ubuntu2.1
2017-03-21 15:02:11 status installed libfreetype6:amd64 2.6.1-0.1ubuntu2.1
2017-03-21 15:02:11 trigproc libc-bin:amd64 2.23-0ubuntu6 <none>
2017-03-21 15:02:11 status half-configured libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:11 status installed libc-bin:amd64 2.23-0ubuntu6
2017-03-21 15:02:11 startup packages configure

我們看到這影響了我們的環境,5 小時後又發生了。考慮回滾到舊版本的 libc6 更新檔。

這是此問題的 Ubuntu 錯誤,它證實了我們所看到的:https ://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1674532

更新:該問題已得到修復。

請參閱上述報告中的評論#16#17#18 。更新libc應該可以解決問題。建議重新啟動以確保在更新期間執行的任何使用此庫的正在執行的程序保持正常執行。

引用自:https://serverfault.com/questions/839659