> For the complete documentation index, see [llms.txt](https://docs.ragnasync.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ragnasync.com/monitoring/server-monitoring/crash-logs.md).

# Crash Logs

Automatic crash reporting for your Ragnarok server

RagnaSync can automatically capture and report server crashes, helping you diagnose and fix issues quickly. When your server crashes, detailed debugging information is sent to your RagnaSync dashboard.

## How It Works

When you run your server through the RagnaSync launcher scripts (`ragnasync.sh` on Linux or `ragnasync.bat` on Windows), your server runs under GDB (GNU Debugger). If a crash occurs, the launcher:

1. **Captures the crash** with full debugging information
2. **Generates a report** with backtrace, thread info, and variables
3. **Sends it to RagnaSync** automatically
4. **Notifies you** via your configured channels

## Setup

The launcher starts **all** your sub-servers (login, char, map) under crash capture for you — you don't start them one at a time. Use the `start`, `stop`, `restart`, and `status` commands instead of running the server binaries directly.

### Linux

Use the provided `ragnasync.sh` script:

```bash
# Instead of starting ./login-server, ./char-server, ./map-server yourself:
./ragnasync.sh start     # start all servers under crash capture
./ragnasync.sh status    # see which servers are running
./ragnasync.sh stop      # stop all servers
./ragnasync.sh restart   # stop, then start again
```

### Windows

Use the provided `ragnasync.bat` script the same way:

```batch
ragnasync.bat start
```

The first run installs its dependencies (GDB, curl) automatically.

## What's Captured

When a crash occurs, the report includes:

| Information         | Description                                |
| ------------------- | ------------------------------------------ |
| **Server Type**     | Which server crashed (login, char, or map) |
| **Hostname**        | Machine where the crash occurred           |
| **Timestamp**       | Exact time of the crash (UTC)              |
| **Backtrace**       | Full stack trace showing where it crashed  |
| **Thread Info**     | State of all running threads               |
| **Registers**       | CPU register values at crash time          |
| **Local Variables** | Variable values in the crashing function   |

## Example Crash Report

```
========== RAGNASYNC CRASH REPORT ==========
Server: map-server
Time: 2026-01-27 12:00:00

---------- Backtrace ----------
#0  0x00007f... in npc_click () at npc.cpp:123
#1  0x00007f... in clif_parse_NpcClicked () at clif.cpp:456
#2  0x00007f... in parse_char () at clif_parse.cpp:789
...

---------- All Threads ----------
Thread 1 (Main Thread):
#0  0x00007f... in npc_click () at npc.cpp:123
...

---------- Registers ----------
rax            0x0
rbx            0x7f...
...

---------- Local Variables ----------
sd = 0x7f... (player session data)
nd = 0x0 (null - this caused the crash!)
...

========== END CRASH REPORT ==========
```

## Viewing Crash Logs

Crash logs are available in your RagnaSync dashboard:

1. Log into your RagnaSync account
2. Navigate to your server's dashboard
3. Click on **Crash Logs** in the sidebar
4. View recent crashes with full details

## Discord Notifications

There's no `channels.conf` setting for this — crash logs aren't sent to Discord. They show up automatically in your dashboard's **Crash Logs** page as soon as they're uploaded, with no configuration needed.

## Troubleshooting Tips

### GDB Not Found

If you get an error about GDB not being installed:

**Linux (Ubuntu/Debian):**

```bash
sudo apt-get install gdb
```

**Linux (CentOS/RHEL):**

```bash
sudo yum install gdb
```

### Permissions Issues

Make sure the launcher script is executable:

```bash
chmod +x ragnasync.sh
```

### Server Won't Start

If your server doesn't start through the launcher:

1. Check that your normal server starts without the launcher
2. Verify GDB is installed correctly
3. Check the RagnaSync error logs

## Benefits

* **Fast Debugging** - See exactly where and why crashes happen
* **Automatic Capture** - No manual steps needed when crashes occur
* **Remote Monitoring** - Get notified even when you're away
* **Historical Data** - Track crash patterns over time
* **Detailed Context** - Full stack traces and variable values

## Notes

* Crash logs are only sent for crashes (SIGSEGV, SIGABRT, etc.)
* Normal server shutdowns are not reported as crashes
* Reports are sent securely to RagnaSync servers
* Only you have access to your server's crash data
