# Xtrabackup Error Message: "xb\_stream\_read\_chunk(): wrong chunk magic at offset 0x0"

**URL:** <https://forums.percona.com/t/xtrabackup-error-message-xb-stream-read-chunk-wrong-chunk-magic-at-offset-0x0/7464>\
**Category:** Percona XtraBackup\
**Created:** [March 10, 2020, 10:26pm UTC](https://forums.percona.com/t/xtrabackup-error-message-xb-stream-read-chunk-wrong-chunk-magic-at-offset-0x0/7464 "2020-03-10T22:26:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![y721](https://avatars.discourse-cdn.com/v4/letter/y/46a35a/32.png) [@y721](https://forums.percona.com/u/y721)\
**Post date:** [March 10, 2020, 10:26pm UTC](https://forums.percona.com/t/xtrabackup-error-message-xb-stream-read-chunk-wrong-chunk-magic-at-offset-0x0/7464/1 "2020-03-10T22:26:10Z")

</div>

Hi:  
I tried to use Xtrabackup, compress, and streaming. But when I Unpack the backup stream, I got an error message. “xb\_stream\_read\_chunk(): wrong chunk magic at offset 0x0”. It seem like the stream file has some problem.

My machine is Ubuntu 16.04 LTS, Both docker version and installed-in-host version of Xtrabackup 2.4 have the same problem.

$sudo docker run --rm --network dev\_rf-quote-net -it -v /home/robin/aurora/rf-quote/docker/dev/db\_data:/var/lib/mysql   
-v /home/steve/rf-quote-db-backup-comp:/xtrabackup\_backupfiles perconalab/percona-xtrabackup   
–backup --host=172.12.0.3 --user=root --password=xxx --compress --stream=xbstream

## I got a compressed file backup.xbstream. the file size is about 5MB. then I $vi backup.xbstream

## encryption: using gcrypt 1.6.3 200310 08:41:00 version\_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql\_read\_default\_group=xtrabackup;host=172.12.0.3;port=3306;mysql\_socket=/var/run/mysqld/mysqld.sock’ as ‘root’ (using password: YES). 200310 08:41:00 version\_check Connected to MySQL server 200310 08:41:00 version\_check Executing a version check against the server… 200310 08:41:00 version\_check Done. 200310 08:41:00 Connecting to MySQL server host: 172.12.0.3, user: root, password: set, port: 3306, socket: /var/run/mysqld/mysqld.sock Using server version 5.7.27 xtrabackup version 2.4.11 based on MySQL server 5.7.19 Linux (x86\_64) (revision id: b4e0db5) xtrabackup: uses posix\_fadvise(). xtrabackup: cd to /var/lib/mysql xtrabackup: open files limit requested 0, set to 1048576 xtrabackup: using the following InnoDB configuration: xtrabackup: innodb\_data\_home\_dir = . xtrabackup: innodb\_data\_file\_path = ibdata1:12M:autoextend xtrabackup: innodb\_log\_group\_home\_dir = ./ xtrabackup: innodb\_log\_files\_in\_group = 2 xtrabackup: innodb\_log\_file\_size = 50331648 InnoDB: Number of pools: 1 200310 08:41:00 \>\> log scanned up to (1980823392) xtrabackup: Generating a list of tablespaces InnoDB: Allocated tablespace ID 21 for sys/sys\_config, old maximum was 0 200310 08:41:01 [01] Compressing and streaming ./ibdata1 200310 08:41:01 [01] …done … // the following is binary.

$xbstream -x \< backup.xbstream  
The Error Message shows up: “xb\_stream\_read\_chunk(): wrong chunk magic at offset 0x0.”

It seem like the output message is also streamed into the file. Could it be the reason to fail? I don’t know. I don’t know how to fix this issue.  
Could anyone help me to fix it?  
Thank you in advance.

Steve

---

<div class="post-metadata">

**Author:** ![jzzaresk](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jzzaresk](https://forums.percona.com/u/jzzaresk)\
**Post date:** [April 23, 2020, 6:59am UTC](https://forums.percona.com/t/xtrabackup-error-message-xb-stream-read-chunk-wrong-chunk-magic-at-offset-0x0/7464/2 "2020-04-23T06:59:47Z")

</div>

You can hexdump the backup.xbstream to check if there was other output streamed into the file. But yes, having anything other than the output of _xtrabackup --backup --stream=xbstream …_ in the xbstream file will break the file format.
