> For the complete documentation index, see [llms.txt](https://uci.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://uci.sunbird.org/use/developer/development-environment/debug-services.md).

# Debug services

### 1. Overview

A service can be debugged via a IDE tool if you are using one to run the services or via checking the docker conatiner logs if you are using the docker image to run it.

### 2. Order of debugging services

To debug any issue or error, follow below order. We should check the service in this order as the message processes in this order only.

1. Inbound
2. Orchestrator
3. Transformer
4. Outbound

A message will be first received in the inbound service to convert the message to XMessage format then it will be sent to the kafka topic which is being listened by the orchestrator service. To check the build/execution flow of the services [click chere](broken://pages/n9210QJpaXYg3krHXy1T).

### 3. Debug on IDE Tool

When a service is started from a IDE tool, it will also show the logs associated with the service. If you are not receiving message reply or the service is not starting, please see the logs to check the issue, and work on the solution accordingly.

You can also add debugger to the IDE tool to add break points in the code to check where the issues is generating from. If you don't know how to, check below videos for reference.

* How to add debugger in [Spring boot tool](https://www.youtube.com/watch?v=w5woL3znVuA)
* How to add debugger in [intellij](https://www.youtube.com/watch?v=1bCgzjatcr4)

### 4. Debug for Docker Image

If you have started the services using docker images, you should follow below steps to debug them.

**1. Check All Services logs**

* Run command below to check logs for all the running services.

  `docker-compose logs --follow --tail 10`

**2. Check Single Service logs**

* If you are sure about the service which is giving error, we can check the logs for that particular service. First check the container id by running the command below.

  `docker ps`

It will return a list of running containers. Each container has a container id as shown in the image.

![](/files/YolbXKPL1YyWMr9OQ7SE)

* To check logs for the container, run command

  `docker logs --follow --tail 10 container_id`

To check the logs for kafka/redis etc services, you should follow the above steps.

### **5. Common mistakes or errors**

1. Missing environment variables
2. Connection issues with kafka/cassandra/postgresql etc.
3. Port in use by another service.
4. Java version conflict


---

# 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 dynamically by asking a question.

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

```
GET https://uci.sunbird.org/use/developer/development-environment/debug-services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
