记一次诡异的 WordPress 故障排查

再靠谱的东西也有不靠谱的时候。前些天 XeHost 连续两天在大片区域访问困难,连 ping VPS 的网关都狂丢包,最后还是解决了,说是机房那边的人手滑了。无所谓,最多就损失点流量什么的,我也没太在意。不过最近却发现 VPS 上的 WordPress 发不了文章了。具体的表现还相当诡异,对于不同的文章,标题 + 正文超过一定长度之后就无法正常地保存草稿了,点保存以后反应超慢,最后还跳到了文章列表。

一开始就想到是网络问题。其实我的这个判断是对的,不过接下来按照兲朝人的惯性思维我自然会想到是某 MGC 在作怪,于是 SSH 连上 VPS ,再发,发现 SSH 居然死掉了。莫非前些天那个探测加密通信内容的论文是真的?不大可能吧。

又折腾了好一阵子,我错误地认为是 VPS 本身有问题。重启 Apache 无果,重装 WP 无果,最后把 Apache 、PHP 、MySQL 都犁了一遍,还是不行。这是肿么回事啊?

于是开始在 VPS 上翻各种日志,别的没看到啥有趣的,不过 MySQL 的日志里面却惊现了“ ERROR: 1064  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ALTER TABLE user ADD column Show_view_priv enum(‘N’,’Y’) CHARACTER SET utf8 NOT ‘ at line 1 ”这样的内容,我在想不会 Ubuntu 源里面的 wp 有 SQL 注入的漏洞吧?

于是兴高采烈地升级 WordPress 到 3.4.1 ,发现这个版本相比于以前实在是太好用了!可惜我遇到的问题仍然没解决。

然后 MySQL 的日志里面还有“

120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_commentmeta' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_commentmeta'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_comments' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_comments'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_links' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_links'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_options' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_options'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_postmeta' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_postmeta'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_posts' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_posts'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_term_relationships' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_term_relationships'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_term_taxonomy' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_term_taxonomy'
120707  4:44:40 [ERROR] /usr/sbin/mysqld: Table './dwordblog/wp_usermeta' is marked as crashed and should be repaired
120707  4:44:40 [Warning] Checking table:   './dwordblog/wp_usermeta'

”这样的玩意。回想起来每次 XeHost 维护似乎都会把 VPS 挂起到硬盘而不是关机(从 VPS 的 uptime 和内核日志可以看出来),所以这也不太可能是意外,应该是网络出现问题时自己尝试通过 Control panel 重启 VPS 造成的。

后来透过 SSH 发现只要发送的请求稍微一多 SSH 就卡死,虽然电信会掐这些玩意但是以前似乎从来没这样啊?再结合用“ sudo mtr -u -t -i 0.5 -s 1000 -n dword1511.info ” trace 到 VPS 的时候在一段时间后会从学校里面开始丢包,我开始怀疑这抠门学校会不会开始限制出国上行流量了?

很快,我就证明了自己的猜想。我随便抓了一个国内 HTTP 代理(这样做真是好危险的!学弟学妹们请勿模仿!但是我懒 =。=),然后把保存在本地的文章 POST 了一下…… 成功了!

最后结论是,学校限制了出国连接每连接的上行流量,意思是你们以后浏览点小网页就好了。可以理解,不能原谅。这篇文章正是依靠那些来历不明的国内 HTTP 代理才得以发出来。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据