rdiff-backupでMemoryError。

IMGP4927

※写真と本文は関係ありません。


バックアップサーバにあるスクリプトでGMOのVPSサーバをバックアップしてる。
公開鍵認証のssh経由でrdiff-backup。ユーザはroot。
バックアップサーバ:rdiff-backup 1.2.8(python2.6)
リモートサーバ:rdiff-backup 1.2.8(python2.7)

このサーバ以外のGMOサーバも同じスクリプトでバックアップしていて問題なし。

結果からいうと、リモートサーバの/root/.bashrc でmailqコマンドをログインするたびに実行させるようにしていて、リモート側のrdiff-backup–serverコマンドssh経由で実行するんだけど、無駄な文字列が帰ってくるせいでローカル側のrdiff-backupのメモリチェックのところでエラーになると思われる。
→mailqの実行やめたらエラーがでなくなった。

バックアップスクリプトのログはこんな感じ。
/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py で python2.6 の path が入っているので、バックアップサーバ側のエラー。

Exception '' raised of class '':
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
    try: Main(arglist)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 321, in Main
    rps = map(SetConnections.cmdpair2rp, cmdpairs)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 76, in cmdpair2rp
    if cmd: conn = init_connection(cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 150, in init_connection
    check_connection_version(conn, remote_cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 158, in check_connection_version
    try: remote_version = conn.Globals.get('version')
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 450, in __call__
    return apply(self.connection.reval, (self.name,) + args)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 368, in reval
    result = self.get_response(req_num)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 315, in get_response
    try: req_num, object = self._get()
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 240, in _get
    data = self._read(length)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 210, in _read
    try: return self.inpipe.read(length)

Traceback (most recent call last):
  File "/usr/bin/rdiff-backup", line 30, in 
    rdiff_backup.Main.error_check_Main(sys.argv[1:])
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
    try: Main(arglist)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 321, in Main
    rps = map(SetConnections.cmdpair2rp, cmdpairs)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 76, in cmdpair2rp
    if cmd: conn = init_connection(cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 150, in init_connection
    check_connection_version(conn, remote_cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 158, in check_connection_version
    try: remote_version = conn.Globals.get('version')
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 450, in __call__
    return apply(self.connection.reval, (self.name,) + args)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 368, in reval
    result = self.get_response(req_num)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 315, in get_response
    try: req_num, object = self._get()
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 240, in _get
    data = self._read(length)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 210, in _read
    try: return self.inpipe.read(length)
MemoryError
Fatal Error: Lost connection to the remote system

–verbosity オプション付けて、–test-serverしてみた。エラーは同様。

[root@backup2012 ~]# rdiff-backup -v9 --test-server mail-16.example.jp::/ignored
Thu Oct 27 11:09:37 2016  Using rdiff-backup version 1.2.8
Thu Oct 27 11:09:37 2016  Executing ssh -C mail-16.example.jp rdiff-backup --server
Thu Oct 27 11:09:37 2016  Client sending (0): ConnectionRequest: Globals.get with 1 arguments
Thu Oct 27 11:09:37 2016  Client sending (0): 'version'
Thu Oct 27 11:09:39 2016  Exception '' raised of class '':
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
    try: Main(arglist)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 321, in Main
    rps = map(SetConnections.cmdpair2rp, cmdpairs)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 76, in cmdpair2rp
    if cmd: conn = init_connection(cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 150, in init_connection
    check_connection_version(conn, remote_cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 158, in check_connection_version
    try: remote_version = conn.Globals.get('version')
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 450, in __call__
    return apply(self.connection.reval, (self.name,) + args)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 368, in reval
    result = self.get_response(req_num)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 315, in get_response
    try: req_num, object = self._get()
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 240, in _get
    data = self._read(length)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 210, in _read
    try: return self.inpipe.read(length)

Traceback (most recent call last):
  File "/usr/bin/rdiff-backup", line 30, in 
    rdiff_backup.Main.error_check_Main(sys.argv[1:])
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
    try: Main(arglist)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/Main.py", line 321, in Main
    rps = map(SetConnections.cmdpair2rp, cmdpairs)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 76, in cmdpair2rp
    if cmd: conn = init_connection(cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 150, in init_connection
    check_connection_version(conn, remote_cmd)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/SetConnections.py", line 158, in check_connection_version
    try: remote_version = conn.Globals.get('version')
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 450, in __call__
    return apply(self.connection.reval, (self.name,) + args)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 368, in reval
    result = self.get_response(req_num)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 315, in get_response
    try: req_num, object = self._get()
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 240, in _get
    data = self._read(length)
  File "/usr/lib64/python2.6/site-packages/rdiff_backup/connection.py", line 210, in _read
    try: return self.inpipe.read(length)
MemoryError

Executing ssh -C mail-16.example.jp rdiff-backup –server を実行しているのがわかる。
Client sending (0): ‘version’のあとでエラー。