Giter Site home page Giter Site logo

blocksync.py python3 bug about blocksync HOT 8 CLOSED

shodanshok avatar shodanshok commented on August 15, 2024
blocksync.py python3 bug

from blocksync.

Comments (8)

shodanshok avatar shodanshok commented on August 15, 2024 1

You are right, an issue remained when destination was a blockdev. I fixed it, let it try now.

from blocksync.

shodanshok avatar shodanshok commented on August 15, 2024

I just commited a patch on the python3 branch to fix the issue, please let me know if it works.

from blocksync.

devZer0 avatar devZer0 commented on August 15, 2024

thanks very much!

unfortunately, still errors out with the same error

from blocksync.

devZer0 avatar devZer0 commented on August 15, 2024

i'm really sorry, but it still doesn't work

/root/borg extract --stdout /backup/test::second | mbuffer -q | /root/blocksync3.py - localhost /dev/sdc

Dry run : False
Local : True
Block size : 128.0 KB
Skipped : 0 blocks
Hash alg : sha512
Crypto alg : aes128-cbc
Compression : False
Read cache : True
SRC command : /root/blocksync3.py - localhost /dev/sdc
DST command : /root/blocksync3.py server /dev/sdc -a sha512 -b 131072 -k 0

Synching...
Traceback (most recent call last):
File "/root/blocksync3.py", line 392, in
sync(srcpath, dsthost, dstpath)
File "/root/blocksync3.py", line 250, in sync
for (l_block, l_sum) in getblocks(f):
File "/root/blocksync3.py", line 110, in getblocks
block = f.read(options.blocksize)
File "/usr/lib/python3.9/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xeb in position 0: invalid continuation byte
mbuffer: error: outputThread: error writing to at offset 0x20000: Broken pipe
mbuffer: warning: error during output to : Broken pipe
Local Exception
Traceback (most recent call last):
File "borg/archiver.py", line 5168, in main
File "borg/archiver.py", line 5099, in run
File "borg/archiver.py", line 183, in wrapper
File "borg/archiver.py", line 198, in wrapper
File "borg/archiver.py", line 917, in do_extract
File "borg/archive.py", line 781, in extract_item
BrokenPipeError: [Errno 32] Broken pipe

Platform: Linux debian 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64
Linux: Unknown Linux
Borg: 1.2.3 Python: CPython 3.9.16 msgpack: 1.0.4 fuse: llfuse 1.4.2 [pyfuse3,llfuse]
PID: 7324 CWD: /root
sys.argv: ['/root/borg', 'extract', '--stdout', '/backup/test::second']
SSH_ORIGINAL_COMMAND: None

from blocksync.

shodanshok avatar shodanshok commented on August 15, 2024

Don't be sorry, rather, thanks for your help!

This issue turned to be a rather fundamental problem with how python3 encodes string (compared to python2). I hope to have fixed it, can you try it now?

from blocksync.

devZer0 avatar devZer0 commented on August 15, 2024

i'm very happy that things moving forward !

it loooks good now and seems to work. i did not yet test for consistency/data validity, but restore works.

i observe slightly performance loss. the old version does about 255MB/s whereas the new one does not perform above 242MB/s. it was no real performance test, though... not an issue, just wanted to let you know.

thank you very much !

from blocksync.

shodanshok avatar shodanshok commented on August 15, 2024

I'm glad to hear that it now works!

it loooks good now and seems to work. i did not yet test for consistency/data validity, but restore works.

Be sure to thoroughly test it, taking and comparing some hashes from both source and destination, before using it for anything valuable.

from blocksync.

devZer0 avatar devZer0 commented on August 15, 2024

looks good, so far

# /root/borg extract --stdout /backup/test::second | mbuffer -q | /root/blocksync3.py - localhost /dev/sdc


Dry run     : False
Local       : True
Block size  : 128.0 KB
Skipped     : 0 blocks
Hash alg    : sha512
Crypto alg  : aes128-cbc
Compression : False
Read cache  : True
SRC command : /root/blocksync3.py - localhost /dev/sdc
DST command : /root/blocksync3.py server /dev/sdc -a sha512 -b 131072 -k 0


Synching...
skipped: 0, same: 262135, diff: 9, 262144/1, 220.8 MB/s

Completed in 148 seconds

# md5sum /dev/sdc
ff27c3dd96d7abd93bfb76176eaf6293  /dev/sdc

# dd if=/dev/urandom of=/dev/sdc1 bs=1024k count=1
1+0 Datensätze ein
1+0 Datensätze aus
1048576 Bytes (1,0 MB, 1,0 MiB) kopiert, 0,00430363 s, 244 MB/s

# dd if=/dev/urandom of=/dev/sdc2 bs=1024k count=1
dd: Fehler beim Schreiben von '/dev/sdc2': Auf dem Gerät ist kein Speicherplatz mehr verfügbar
1+0 Datensätze ein
0+0 Datensätze aus
1024 Bytes (1,0 kB, 1,0 KiB) kopiert, 0,00460056 s, 223 kB/s

# dd if=/dev/urandom of=/dev/sdc3 bs=1024k count=1
1+0 Datensätze ein
1+0 Datensätze aus
1048576 Bytes (1,0 MB, 1,0 MiB) kopiert, 0,00327241 s, 320 MB/s


# /root/borg extract --stdout /backup/test::second | mbuffer -q | /root/blocksync3.py - localhost /dev/sdc


Dry run     : False
Local       : True
Block size  : 128.0 KB
Skipped     : 0 blocks
Hash alg    : sha512
Crypto alg  : aes128-cbc
Compression : False
Read cache  : True
SRC command : /root/blocksync3.py - localhost /dev/sdc
DST command : /root/blocksync3.py server /dev/sdc -a sha512 -b 131072 -k 0


Synching...
skipped: 0, same: 262135, diff: 9, 262144/1, 218.1 MB/s

Completed in 150 seconds

# md5sum /dev/sdc
ff27c3dd96d7abd93bfb76176eaf6293  /dev/sdc

from blocksync.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.