# Problem with gateway restore file - invalid END header

**URL:** <https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097>\
**Category:** Ignition\
**Created:** [April 6, 2022, 10:15am UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097 "2022-04-06T10:15:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 6, 2022, 10:15am UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/1 "2022-04-06T10:15:36Z")

</div>

We had a Windows Server 2012 crash, have reinstalled it, upgraded to Ignition 8.1.15 and are restoring our gateway backups. We’re getting a message:

```auto
Error writing to restore file: java.util.zip.ZipException: 
invalid END header (bad central directory offset)

```

![Invalid END header](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/9/391b639090b9c9722d1866ae43fb3e1e78f2777f.png)

A web search shows that the message is common on Java systems and is not unique to Ignition.

Has anyone any suggestions we can try while waiting for Oregon to get to work?

Thanks.

_Further info:_

- We rename the .gwbk to .zip and open with 7-Zip.
- We find a .gwbk inside our renamed file. (Why? This is a bit like Russian dolls.)
- Inside that we find **db\_backup\_sqlite.idb**.
- Extracting that file we get `CRC failed db_backup_sqlite.idb`.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 6, 2022, 12:08pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/2 "2022-04-06T12:08:01Z")

</div>

Sounds like this zip file is corrupt or truncated 😬

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 6, 2022, 12:30pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/3 "2022-04-06T12:30:36Z")

</div>

Did the storage location for your automatic backups run out of space?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 6, 2022, 1:41pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/4 "2022-04-06T13:41:18Z")

</div>

Thanks, Phil.  
The nightly backups are by FTP to a NAS box with almost 2 TB free space. The .gwbk files are a little over 109 MB.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 6, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/5 "2022-04-06T15:42:47Z")

</div>

The server had been saving backups locally until 26th January and we have successfully restored the most recent of those.

Our backup task calls the command line ftp utility taking its instructions from a script file.

```auto
:: Run DailyFTP txt file
ftp -s:DailyFTP.txt

:: Delete new backup
del *.gwbk

```

The `ftp -s` script file contents are,

```auto
FTP
open 10.11.12.13
ftp_ignition
ftp_password
cd homes/ftp_Ignition_Gateway/IgnitionDailyBackups
send IgnitionDailyBackup_*
bye

```

One thing I notice here is that we haven’t specified binary transfer and that it may have defaulted to ASCII transfer. Is this likely to be the problem?

The locally saved files are 104 MB. Those on the FTP backup are 109 MB which would be expected due to the additional work done since January.

Are the FTPed .gwbk files useless? 7-Zip is able to go two levels deep into the files before returning the CRC error. That suggests that the FTP may have worked to some extent.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 6, 2022, 3:49pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/6 "2022-04-06T15:49:58Z")

</div>

> [@Transistor](#):
>
> 7-Zip is able to go two levels deep into the files before returning the CRC error. That suggests that the FTP may have worked to some extent.

I don't think there is supposed to be 2 levels to go into in a backup that isn't b0rked somehow. When you open the older ones in 7zip is it 2 levels?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/263bd7fe493db7db883c9c150b48a2899d5aa9a9.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 6, 2022, 4:10pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/7 "2022-04-06T16:10:41Z")

</div>

I think “b0rked” is right!

We have a backup of the drive contents. Can we just restore folders such as `C:\Program Files\Inductive Automation\Ignition\data`?  
That would give me the latest projects. What else do I need to restore to get the IdPs, tags, OPC devices, database connections, transaction groups, etc.?

Many thanks.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 6, 2022, 4:12pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/8 "2022-04-06T16:12:20Z")

</div>

The `data` folder probably has everything that matters. I’m not sure if the crashed system is 7.9 or 8.x, but either way it has the internal DB and `projects` folder if it’s 8.x.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [April 6, 2022, 6:31pm UTC](https://forum.inductiveautomation.com/t/problem-with-gateway-restore-file-invalid-end-header/58097/9 "2022-04-06T18:31:51Z")

</div>

Thanks, Kevin. It was 8.1.10 and we’ve taken the opportunity to upgrade to 8.1.15 while we fix this.

I’ll try copying in the data file in the morning.
