---
title: Troubleshooting Run Script
url: https://www.tines.com/docs/self-hosted/troubleshooting/troubleshooting-run-script/
updated: 2026-03-24T12:54:14+00:00
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Self-Hosted](https://www.tines.com/llm/docs/self-hosted.md) › [Troubleshooting](https://www.tines.com/llm/docs/self-hosted/troubleshooting.md)*

# Troubleshooting Run Script

*[View on tines.com](https://www.tines.com/docs/self-hosted/troubleshooting/troubleshooting-run-script/)*

## Troubleshooting

This guide contains some common commands and areas to check in order to troubleshoot any setup issues with your self-hosted run script deployment using `tines-command-runner` and `tines-app`.

### docker-compose

**exec into **`**tines-command-runner**`** container**

```bash
docker ps (grab the <tcr_container_id>)
docker exec -it <tcr_container_id> /bin/bash
```

**Review docker logs for **`**tines-command-runner**`

```bash
docker logs -f <tcr_container_id>
```

**Stop / Start all services**

```bash
docker compose down && docker compose up -d
```

**Stop only tines-command-runner service**

```bash
docker stop <tcr_container_id>
docker start <tcr_container_id>
```

**Review docker env variables for tines-command-runner:**

```bash
docker inspect <tcr_container_id> | jq '.[0].Config.Env'
```

or if `jq` is not installed:

```bash
docker inspect <tcr_container_id> | grep -A 20 "Env"
```

### Environment Variables

**tines-command-runner**

- `PIP_INDEX_URL`: Specifies the primary Python Package Index. Default is `https://pypi.org/simple`. This can be overridden to use a custom package index.
- `PIP_EXTRA_INDEX_URL`: Allows specifying a fallback package index. Default is `http://pypi-server:8080/simple/`, which is the default local PyPI server(`pypi-server`) running alongside the command runner.
- `NO_PIP_INDEX`: If set, disables all package indexes, including `PIP_INDEX_URL` and `PIP_EXTRA_INDEX_URL`, relying only on packages included in the container.
- `TRUSTED_HOST`: Specifies a trusted package index host. Default is `pypi-server`, ensuring that the local PyPI server is trusted.
- `LOG_LEVEL` - Configures the logging level for the Python harness. Set to `DEBUG`, `INFO`, `WARNING`, `ERROR`, or `CRITICAL` (defaults to `INFO`). Set `LOG_LEVEL=DEBUG` to enable debug logging for troubleshooting. Logs are written to `/tmp/tcr-logs/harness-{environment_id}-{stdout,stderr}.log`.
- `UV_NATIVE_TLS` [optional] - When set (e.g. UV_NATIVE_TLS=1), uv uses the platform's native TLS certificate store. This is used to enable corporate proxies or custom CAs in the system store. When not set the variable is not used.

**tines-app**

- `TINES_COMMAND_RUNNER_PORT` - defaults to `4400`
- `TINES_COMMAND_RUNNER_HOST` - defaults to `tines-command-runner`

**capacity configuration**

`tines-command-runner` can be configured to handle different levels of concurrent requests through two key environment variables:

- `TINES_COMMAND_RUNNER_WORKERS` - Controls the number of Puma worker processes. (Default is 2).
- `TINES_COMMAND_RUNNER_THREADS` - Controls the number of threads per worker. (Default is 5).

These values determine the total concurrent requests the command runner can handle (workers × threads). For example, with default values, the service can handle 10 concurrent requests (2 workers × 5 threads).

### APP_USER

Ensuring `APP_USER` can `sudo` into Users

As part of the permissions structure for run script we generate users within in the container via the Dockerfile.

This has a number of variables which can be overridden if necessary:

```bash
APP_USER=${APP_USER:-2000}
NUM_USERS=${NUM_USERS:-1000}
GROUP_ID=${GROUP_ID:-1000}
GROUP_NAME=${GROUP_NAME:-tines-team-group}
```

**Check User Existence in **`**/etc/passwd**`

```bash
getent passwd | grep tines-tcr-team-user
```

**Check for Users Created with Specific UID Range:**

```bash
awk -F: '$3 >= 2000 && $3 < 3000 {print $1, $3}' /etc/passwd
```

**Verify Home Directories Exist**

```bash
ls -ld /home/tines-tcr-team-user-*
```

**Check Group Membership**

```bash
getent group tines-team-group
```

**Check file write permissions for a user (in the case of permissions errors)**

```bash
sudo -u tines-tcr-team-user-2000 touch /specify-the-dir-path
```

### UID Mappings

**Check permissions on team-uid-mappings**

```bash
ls -ld /team-uid-mappings
cat /team-uid-mappings
```

**View UID to Username Mapping (for All Users)**

```bash
getent passwd
```

**Check UID for a Specific User**

```bash
id tines-tcr-team-user-2000
```

### Connectivity

This command should be run from within the `tines-app` container. It will attempt to connect to the `tines-command-runner` in a way that’s very similar to how the `tines-app` itself does it. It loads the host and port and then makes a POST request to the endpoint.

```bash
curl -vvv "http://${TINES_COMMAND_RUNNER_HOST:-tines-command-runner}:${TINES_COMMAND_RUNNER_PORT:-4400}/run_script" \
    -H "Content-Type: application/json" \
    -d '{
        "action_id": 1,
        "script_type": "python",
        "script_content": "def main(input_data):\n    print(f\"Received input_data: {input_data}\")\n    result = \"2\" + str(2)\n    return \"result is \" + str(result)\n",
        "pre_run_command": "uv pip install $TINES_DEPENDENCIES_LIST",
        "dependencies": [],
        "environment_id": "1234",
        "team_id": 100,
        "timeout": 60
    }'
```
