# Postchain troubleshooting · Chromia Docs (concept)

> While Postchain is designed to be robust and reliable, issues can still arise from time to time.

Source: https://docs.chromia.com/ecosystem/providers/pmc/troubleshooting/

# Postchain troubleshooting

On this page

* [General troubleshooting steps](#general-troubleshooting-steps)
* [Local node](#local-node)
* [Provider node](#provider-node)
* [Rescuing a stalled Chain0](#rescuing-a-stalled-chain0)
* [Optimizing transaction speed](#optimizing-transaction-speed)
* [Enabling logging](#enabling-logging)
* [Prometheus](#prometheus)
* [Generic logs](#generic-logs)
* [EBFT logging](#ebft-logging)

While Postchain is designed to be robust and reliable, issues can still arise from time to time. This topic covers some
common troubleshooting steps you can take to identify and resolve problems with your Postchain node.

## General troubleshooting steps

### Local node

1. **Check Postchain logs**: The logs are a valuable source of information for diagnosing issues. Look for any error
   messages or indications of what might be going wrong.
2. **Restart Postchain**: A simple restart can often clear temporary glitches. Restart your node using `chr node start`.
3. **Check hardware resources**: Ensure your system has sufficient CPU, RAM, storage space, and network bandwidth to
   handle the workload of the blockchains your node is running. Resource limitations can lead to syncing or processing
   issues.
4. **Check Postchain configuration**: Review your `node.properties` configuration file to ensure all the settings are
   correct, such as ports, databases, etc.

### Provider node

1. **Check Postchain logs**: The logs are a valuable source of information for diagnosing issues. Look for any error
   messages or indications of what might be going wrong.
2. **Check hardware resources**: Ensure your system has sufficient CPU, RAM, storage space, and network bandwidth to
   handle the workload of the blockchains your node is running. Resource limitations can lead to syncing or processing
   issues.
3. **Check Postchain configuration**: Review your `node-config-<dapp | system>.properties` configuration file to ensure
   all the settings are correct, such as ports, databases, etc.

## Rescuing a stalled Chain0

If your chain0 is stuck at a specific height (e.g., stuck at height 1000), follow these steps to revive it:

1. **Create a New Configuration:** Manually create a new configuration file (e.g., `config.0.properties`) for chain0 at
   height 1000:

   Terminal

   ```
   ./chromia-node/postchain-cli.sh add-configuration -nc ./config/config.0.properties -cid 0 -h 1000 -bc ./directory1/manager.xml
   ```
2. **Restart all nodes:** Once the new configuration is added on each node, restart all the nodes in your cluster.

## Optimizing transaction speed

Even with well-optimized code and fast transaction execution, delays can occur. This is because Postchain waits for a
configurable period to gather more transactions into a block before finalizing it. While this strategy aims for
efficiency by maximizing transactions per block, it can lead to unnecessary delays for infrequent transactions.

To address this, you can adjust the `maxtxdelay` parameter under the `blockstrategy` section in your configuration file.
Lowering this value reduces the waiting time for blocks with few transactions.

## Enabling logging

### Prometheus

To enable Prometheus, add `metrics.prometheus.port=<port>` to the `node-config.properties` file. For more information,
see [Set up Prometheus monitoring](https://docs.chromia.com/ecosystem/providers/nodes/setup-prometheus/).

### Generic logs

Docker supports different log drivers that can be used when collecting logs from a running container. For more
information about available log drivers, see the official
[logging drivers](https://docs.docker.com/config/containers/logging/configure/) documentation.

To start a node with a specific log driver, add `log-driver` and, optionally, `log-opt` to the docker run command when
starting the node.

For example:

Terminal

```
docker run -d --name postchain \
    ...
    --log-driver=fluentd
    --log-opt fluentd-address=fluentdhost:24224
    --log-opt fluentd-async=true
    ...
```

#### Subnodes

Since subnodes are started automatically, the log driver and log options need to be added to the node configuration file
as follows:

Properties

```
container.docker-log-driver=fluentd
container.docker-log-opts=fluentd-address=fluentdhost:24224;fluentd-async=true
```

### EBFT logging

To enable EBFT messaging logging, add the following lines to your `log4j2.yml` file:

YAML

```
- name: net.postchain.network.peer.DefaultPeerCommunicationManager
  level: trace
  additivity: false
  AppenderRef:
    - ref: ConsoleAppender
```

[View this page on docs.chromia.com](https://docs.chromia.com/ecosystem/providers/pmc/troubleshooting/)Content mirrored from the live docs
