# Fix startup crashes and inspect logs (https://docs.homemanager-app.de/guide/troubleshooting-startup-errors)





When Homebridge fails to launch after an update or configuration change, it usually enters a restart loop (boot loop): the service crashes during initialization, and the operating system restarts it immediately.

The last lines of the log show why the process stopped.

***

## View the log [#view-the-log]

Open the log using your preferred access method:

<Tabs items="[&#x22;In Homemanager&#x22;, &#x22;In the Web Interface&#x22;, &#x22;Via SSH / Terminal&#x22;]">
  <Tab>
    1. Open Homemanager on your iPhone or iPad.
    2. Go to the **System** tab and tap **Log**.
    3. Error entries are highlighted in red.
    4. Use the **share icon** in the top right corner to copy log entries or export them for troubleshooting help.

    <div className="flex justify-center my-6">
      <ImageZoom src="/images/homebridge/troubleshooting/homemanager-live-log-error.png" alt="Live log in Homemanager showing error output" className="max-w-[240px] rounded-2xl border border-fd-border shadow-md" caption="Live log with red error highlights in Homemanager" />
    </div>
  </Tab>

  <Tab>
    1. Open the Homebridge web UI in your browser (if the UI service is still reachable).
    2. Open the **Status** section or click the console icon in the top navigation bar.
    3. The log window streams new lines as they appear.
  </Tab>

  <Tab>
    Connect to your host system via SSH and read the service logs directly:

    ```bash
    sudo hb-service logs
    ```

    On Linux systems running systemd, you can also query the journal:

    ```bash
    sudo journalctl -u homebridge -n 50 --no-pager
    ```
  </Tab>
</Tabs>

<Callout type="info">
  **Debug mode for detailed logs:** If standard log output does not reveal the cause, enable &#x2A;*Debug Mode (`-D`)** in the Homebridge settings of the web interface to record every network packet and internal event.
</Callout>

***

## Common startup errors [#common-startup-errors]

### 1. Port conflicts (`EADDRINUSE` or Matter ports) [#1-port-conflicts-eaddrinuse-or-matter-ports]

**Log message:**

```text
Error: listen EADDRINUSE: address already in use :::51826
```

or:

```text
Error: Failed to allocate Matter port for child bridge.
Please specify a port manually in the _bridge.matter configuration...
```

* **Cause:** Another service occupies the HomeKit port (default: `51826`), the web port (`8581`), or the Matter port assigned to a child bridge.
* **Fix:**
  * Reboot the host system (`sudo reboot`) to terminate orphaned Node processes.
  * If you run multiple bridges or Matter accessories: assign an unused, fixed port in the bridge settings for that plugin. For more details on Matter configuration, see [Matter and Homebridge](/guide/matter-and-homebridge).

***

### 2. Syntax errors in `config.json` (`SyntaxError`) [#2-syntax-errors-in-configjson-syntaxerror]

**Log message:**

```text
SyntaxError: Unexpected token , in JSON at position 1240
```

* **Cause:** A JSON syntax issue, typically a trailing comma or an unclosed bracket introduced during manual editing.
* **Fix:**
  * **Correct the typo:** Open the configuration file in a terminal editor (such as `sudo nano /var/lib/homebridge/config.json`) and fix the error at the reported line.
  * **Restore a backup on a clean setup:** If the file is badly damaged or the service refuses to start, reinstall Homebridge and restore your latest backup archive during the initial setup wizard. All plugins, settings, and Apple Home pairings remain intact.
  * **Prevent errors with Homemanager:** When editing settings through structured forms in Homemanager, the app validates inputs before saving, preventing JSON syntax errors from happening.

***

### 3. Plugin crash during initialization [#3-plugin-crash-during-initialization]

**Log message:**

```text
[homebridge-plugin] Child bridge will no longer restart after failing 5 times
```

* **Cause:** A plugin throws an unhandled error during startup, often caused by expired account credentials, changed device APIs, or network timeouts.
* **Fix:**
  * **With Child Bridges:** If the plugin runs as a [child bridge](/guide/child-bridges), Homebridge stops restarting it after five failed attempts. The main server stays online. You can edit the plugin settings, disable it, or delete its configuration directly in Homemanager or the web interface. Once corrected, restart the child bridge.
  * **On the main bridge:** If the plugin runs on the main bridge, the crash pulls down the entire Homebridge service into a restart loop.
    * **In Homemanager or the web interface:** If the UI responds briefly between restart attempts, disable the offending plugin or delete its configuration block.
    * **Via terminal (if the UI cannot load):** Open `/var/lib/homebridge/config.json` in an editor (such as `sudo nano /var/lib/homebridge/config.json`) and remove the plugin entry from the `platforms` or `accessories` array.

***

### 4. Native module mismatch after Node.js updates (`NODE_MODULE_VERSION`) [#4-native-module-mismatch-after-nodejs-updates-node_module_version]

**Log message:**

```text
Error: The module '...' was compiled against a different Node.js version
```

* **Cause:** Node.js was upgraded while some plugins still rely on native binary modules compiled for an earlier Node release. For recommended upgrade routines, see [Updating System Software](/guide/updating-system-software).
* **Fix:** Rebuild native dependencies using the service manager:
  ```bash
  sudo hb-service rebuild
  ```

***

### 5. Forgotten web UI credentials [#5-forgotten-web-ui-credentials]

**Log message:**

```text
[Homebridge UI] Failed login attempt.
If you have forgotten your password, you can reset to the default of admin/admin...
```

* **Fix:** Reset the administrator account through the command line:
  ```bash
  sudo hb-service reset-admin
  ```
  Alternatively, remove the authentication file and restart the service:
  ```bash
  sudo rm /var/lib/homebridge/auth.json && sudo hb-service restart
  ```
  This resets your login credentials back to `admin` / `admin`.

***

## Restart the server or child bridges [#restart-the-server-or-child-bridges]

After saving your changes, restart the service:

* **In Homemanager:**
  * Restart the entire server directly from the **Dashboard**.
  * Restart an individual child bridge either by swiping on its entry or via **System** in the bridge detail view.
* **In the web interface:** Click the power icon in the top right corner and choose **Restart**.
* **Via terminal:** Run `sudo hb-service restart`.

***

<Cards>
  <Card icon="<ShieldCheck />" title="Set up Child Bridges" description="Isolate plugins into separate processes so individual crashes do not stop the main server." href="/guide/child-bridges" />

  <Card icon="<AlertTriangle />" title="Accessories Not Responding?" description="Troubleshoot connectivity issues and learn how to safely clear the Homebridge accessory cache." href="/guide/troubleshooting-no-response" />
</Cards>
