AmesCornish / buttersink

Buttersink is like rsync for btrfs snapshots
GNU General Public License v3.0
193 stars 18 forks source link

Fails on snapshot transmittion with type error #13

Closed youam closed 8 years ago

youam commented 8 years ago

I'm trying to run buttersink for the first time, but it aborts when copying the snapshot. Running it with the dryrun flag finishes successfully, but the actual transmittion of the snapshot fails, with the following log snippet:

2015-11-13 21:35:03,800: DEBUG:Butter.py[226]: Waiting for send process to finish... 2015-11-13 21:35:03,801: ERROR:Butter.py[230]: btrfs send errors 2015-11-13 21:35:03,802: DEBUG:Butter.py[147]: Waiting for receive process to finish... 2015-11-13 21:35:03,805: DEBUG:buttersink.py[268]: Trace information for debugging Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/buttersink/buttersink.py", line 251, in main diff.sendTo(dest, chunkSize=args.part_size << 20) File "/usr/local/lib/python2.7/dist-packages/buttersink/Store.py", line 352, in sendTo transfer(sendContext, receiveContext, chunkSize) File "/usr/local/lib/python2.7/dist-packages/buttersink/Store.py", line 264, in transfer data = reader.read(chunkSize) File "/usr/local/lib/python2.7/dist-packages/buttersink/Butter.py", line 250, in read self.diff.fromGen, File "/usr/local/lib/python2.7/dist-packages/buttersink/send.py", line 237, in replaceIDs crc = calcCRC() File "/usr/local/lib/python2.7/dist-packages/buttersink/send.py", line 223, in calcCRC crc = crc32c(btrfs_cmd_header.write(header), crc) File "/usr/local/lib/python2.7/dist-packages/crcmod/crcmod.py", line 450, in crcfun return xorOut ^ fun(data, xorOut ^ crc, table) File "/usr/local/lib/python2.7/dist-packages/crcmod/_crcfunpy.py", line 73, in _crc32r crc = table[ord(x) ^ int(crc & 0xFFL)] ^ (crc >> 8) TypeError: ord() expected string of length 1, but int found 2015-11-13 21:35:03,812: ERROR:buttersink.py[269]: ERROR: ord() expected string of length 1, but int found.

buttersink is running from yesterdays 'pip' install, the system is running a current debian essie with kernel 4.2.0-0.bpo.1-amd64. upgrading btrfs-tools from jessie's 3.17-1.1 to stretch's 4.3 did not change the error.

youam commented 8 years ago

Forgot to check the closed issues first. This seems to be a recurrence of #2, but with newer versions, my python is at 2.7.9-2 (and buttersink at 0.6.7)

mswart commented 8 years ago

Please ensure that python-crcmod is build with its C extension (the module should contain a _crcfunext.so shared library). This should fix the issue.

Backgroud: python-crcmod has CRC implemented as C extension and as fallback in pure python. Although these two implementation have the same interface, the python implementation is more restrictive to used types.

I looks like that buttersink currently only works with the C extension implementation.

Due to wrong build-dependencies the python-crcmod version from Ubuntu trusty and Debian jessie (1.7-1) is NOT build with the C extension. Later versions (Debian jessie-backports & stretch and Ubuntu wily) fixed the issue and are build with the C extension. If you use the distribution package, upgrade it. If you installed python-crcmod manual / with pip etc, ensure that the python developer files and build essentials are installed and reinstall python-crcmod.

youam commented 8 years ago

Yes, that solved it, thank you! (upgraded python-crcmod to 1.7-2~bpo8+1)