# Troubleshoot Smart Contracts

This section describes some of the common issues you might encounter when writing and deploying smart contracts on a Substrate-based blockchain and how you can address them.

### Unexpected epoch change

If you interrupt a running node without properly stopping it—for example, by closing the terminal or if you computer switches to sleep mode—you might see the following error:

```bash
ClientImport("Unexpected epoch change")
```

If you see this error, restart your node with the following command:

```bash
 substrate-contracts-node --log info,runtime::contracts=debug 2>&1
```

This command clears all of the running node state. After restarting the node, repeat any steps you performed before the node was shut down. For example, redeploy any contracts you previously uploaded.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.infrablockchain.net/infrablockchain-docs/infrablockchain/learn/substrate/tutorials/smart-contracts/troubleshoot-smart-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
