# Error with xbstream

**URL:** https://forums.percona.com/t/error-with-xbstream/34275
**Category:** Percona XtraBackup
**Created:** [October 10, 2024, 12:52am UTC](https://forums.percona.com/t/error-with-xbstream/34275 "2024-10-10T00:52:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Abdul\_Hannan\_Sohail](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abdul_hannan_sohail/32/18426_2.png) [@Abdul\_Hannan\_Sohail](https://forums.percona.com/u/Abdul_Hannan_Sohail)
#### Post date: [October 10, 2024, 12:52am UTC](https://forums.percona.com/t/error-with-xbstream/34275/1 "2024-10-10T00:52:54Z")

</div>

I downloaded by xbstream file from gcp bucket  
I used the following

> [@How to use xbstream to restore?](https://forums.percona.com/t/how-to-use-xbstream-to-restore/34233/4):
>
> ```auto
> xbstream -xv -C /path/to/restore < /path/local/DB.xbstream
> 
> ```

but it gave me error

root@resuc1gdmyclb37:/mysql-data/db# xbstream -xv -C /mysql-data/db \< /mysql-data/db/dev01\_backup.xbstream  
xb\_stream\_read\_chunk(): wrong chunk magic at offset 0x0.  
exit code: 1

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 10, 2024, 1:40am UTC](https://forums.percona.com/t/error-with-xbstream/34275/2 "2024-10-10T01:40:15Z")

</div>

Are you 100% certain that DB.xbstream is in fact a proper xbstream file?

`$ dd if=DB.xbstream bs=16 count=2`  
This should return something like the following:  
`XBSTCK01Pworld/countrylangu`

In this example, ‘world/’ is the name of a schema, and ‘countrylanguage.ibd’ is a table inside that db.

Feel free to download and test with an xbstream from our training bucket:  
[https://s3.amazonaws.com/percona-training/imdb\_world\_sakila\_20200320.xbstream](https://s3.amazonaws.com/percona-training/imdb_world_sakila_20200320.xbstream)

---

<div class="post-metadata">

### Author: ![Abdul\_Hannan\_Sohail](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/abdul_hannan_sohail/32/18426_2.png) [@Abdul\_Hannan\_Sohail](https://forums.percona.com/u/Abdul_Hannan_Sohail)
#### Post date: [October 10, 2024, 4:50am UTC](https://forums.percona.com/t/error-with-xbstream/34275/3 "2024-10-10T04:50:59Z")

</div>

I used the following command to create xbstream file:  
xtrabackup --datadir=/var/lib/mysql --port=13306 --host=localhost --stream=xbstream --backup --target-dir=./ | /snap/bin/gsutil cp - “gs://clareity-bucket-dev/dev01\_backup.xbstream”

---

<div class="post-metadata">

### Author: ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)
#### Post date: [October 10, 2024, 1:26pm UTC](https://forums.percona.com/t/error-with-xbstream/34275/4 "2024-10-10T13:26:34Z")

</div>

Did you verify the file contents? Did you test my file?
