> For the complete documentation index, see [llms.txt](https://help.security.gallagher.com/knowledge-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.security.gallagher.com/knowledge-hub/products/cc-software/troubleshoot/command-centre-errors/cloud-service-goes-offline-after-restoring-a-template.md).

# Cloud service goes offline after restoring a template

Resolve Cloud service errors that appear after a template or backup is restored on another server.

**Applies to:** sites that restored a template or backup from another server (a different serial) and use the Gallagher API Gateway

The Command Centre Cloud goes offline with a "keyHash … already in use" error after a template (or a backup) from one server was restored on another.

### Symptom

A site created a template on one server and restored it on another server with a different serial. If the Mobile Command Centre was configured to communicate through the Cloud, the Cloud Service may then have issues. The same can happen with Web Clients, REST clients and mobile devices.

On the Command Centre Cloud item, **Status and Overrides** shows:

1. `ApiGatewayClientAuthInfo update failed, client with keyHash …… and AuthenticationMode 'Mobile' already in use`
2. `API Gateway Error: The remote server returned an error: (401) Unauthorized.` This is a different issue. Handle it as a connection problem between the Gallagher server and the API Gateway: see [Cloud service is not accepting registrations](https://help.security.gallagher.com/knowledge-hub/products/cc-hardware/credentials/mobile-connect/troubleshoot/mobile-connect-02-cloud-service-not-ac.md).

![Command Centre Cloud Properties, Status and Overrides: Receive Online, Send Offline, API Gateway Offline; error 1, ApiGatewayClientAuthInfo update failed, client with keyHash (covered) and AuthenticationMode Mobile already in use; error 2, API Gateway Error: The remote server returned an error: (401) Unauthorized.](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-bb3c1e7c428add4455768f27ada90aadb0735420%2FSECHUB-TS-CLOUD-TEMPLATE-01-mobile-key-already-in-use.png?alt=media)

A similar example, for a REST client:

![Command Centre Cloud Properties, Status and Overrides: API Gateway Online, Send Offline, and the error ApiGatewayClientAuthInfo update failed, client with keyHash (covered) and AuthenticationMode Rest already in use](https://328339335-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bM8WhlBE9BYizPWJaPN%2Fuploads%2Fgit-blob-a3fad9d6e3ca74c4e637f56f039141879949ff12%2FSECHUB-TS-CLOUD-TEMPLATE-02-rest-key-already-in-use.png?alt=media)

### How to reproduce it

1. On Site A, register a mobile device or Web Client through the Gallagher API Gateway.
2. Create a template on Site A.
3. Restore the template on Site B.
4. On Site B, create a Command Centre Cloud and enable the Gallagher API Gateway. The Cloud Service goes offline and returns the error above.

### Cause

When these clients connect to the API Gateway, each is given a **unique key hash**. If the site takes a backup and restores it to a test system, or takes a template, those key hashes are no longer unique. The Cloud blocks them, so that the new system does not interfere with the original one.

### Workaround

1. **Delete the Mobile client, REST client or mobile device named in the error**, most probably the one added during or after the backup or the template migration.
2. **Delete and re-create the Cloud Service** (the Command Centre Cloud item), and enable the API Gateway in Command Centre on Site B.

If this does not work, contact Gallagher Technical Support.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.security.gallagher.com/knowledge-hub/products/cc-software/troubleshoot/command-centre-errors/cloud-service-goes-offline-after-restoring-a-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
