Skip to content

18. OBS Can't Connect or the Relay Won't Start

Troubleshooting connection problems between OBS and the relay, and container startup issues.

18.1 Cannot Connect from OBS

18.1.1 Symptoms

  • OBS shows "Failed to connect to server"
  • Connection timeout

18.1.2 Possible Causes

18.1.2.1 Port Not Accessible

Check: Verify port 1935 is exposed:

docker compose ps

Look for 0.0.0.0:1935->1935/tcp

Solution: Ensure docker-compose.yml has correct port mapping:

ports:
  - "1935:1935"

18.1.2.2 IP Address Mismatch

Check: Verify you're using the correct IP address:

ip addr show | grep inet

Solution: - Use the relay PC's local network IP (e.g., 192.168.1.100) - Don't use 127.0.0.1 or localhost from another machine

18.1.2.3 Firewall Blocking

Check: From the machine running OBS, test whether the relay's port is reachable. Replace <RELAY_IP> with the relay machine's LAN address (see the previous check).

Windows (PowerShell):

Test-NetConnection <RELAY_IP> -Port 1935

A reachable port shows TcpTestSucceeded : True. TODO(verify: Test-NetConnection output on Windows)

Linux or macOS:

nc -zv <RELAY_IP> 1935

A reachable port prints a line containing succeeded or open.

Solution: - Open port 1935 in firewall - Ubuntu: sudo ufw allow 1935/tcp - Check if Docker networking is working

18.1.2.4 IP Range Restriction

Check: Look for a denied connection in the logs:

docker compose logs relay | grep "access forbidden"

A denied connection logs the address the relay saw:

[error] 89#89: *1 access forbidden by rule, client: 10.0.0.25, server: 0.0.0.0:1935

Solution: Follow the steps in IP Authentication to add the refused client: address to PUBLISH_IP_RANGE.

18.1.3 Network Connectivity Test

If relay can't reach streaming services:

Check: Test that the relay can open a Real-Time Messaging Protocol (RTMP) connection (TCP port 1935) to each service:

docker compose exec relay nc -zv <TWITCH_ENDPOINT>.contribute.live-video.net 1935
docker compose exec relay nc -zv a.rtmp.youtube.com 1935

Replace <TWITCH_ENDPOINT> with your TWITCH_ENDPOINT value (default use10). A working connection prints open (the IP address will differ):

use10.contribute.live-video.net (35.55.30.14:1935) open

If the command does not print open, outbound port 1935 is blocked between the relay and the service.

Solution: - Check firewall settings - Verify outbound RTMP (port 1935) is allowed - Try different Twitch ingest endpoint (change TWITCH_ENDPOINT)

18.1.4 Confirm the Fix

Start streaming in OBS. OBS shows the stream as live, and this prints nothing new:

docker compose logs relay | grep "access forbidden"

18.2 Container Won't Start

18.2.1 Symptoms

  • docker compose up exits immediately
  • Container status shows "Exited (1)"

18.2.2 Possible Causes

18.2.2.1 Invalid Environment Value

Check: Find the error lines in the log:

docker compose logs relay | grep -E "ERROR|\[!\]"

An invalid value prints the variable name and the script that stopped:

ERROR: TWITCH_FPS must be a number.
[!] pre-init.d - 90_configure_twitch.sh failed. Stopping container.

Solution: Correct the named variable in env/relay.env, then run docker compose up -d --force-recreate.

If the error is ERROR: ARCHIVE_PATH is not writable by the nginx user., the problem is the archive folder mount, not the value: see Archive Folder Not Mounted or Not Writable.

If you can't tell what's wrong and need the relay back quickly, undo your last change to env/relay.env and recreate the container the same way.

18.2.2.2 Port Already in Use

Check: docker compose up -d prints one of these:

Bind for 0.0.0.0:1935 failed: port is already allocated
failed to bind host port 0.0.0.0:1935/tcp: address already in use

Solution:

  • port is already allocated: another container holds the port, often an older copy of the relay. Find it and stop it:

    docker ps --filter publish=1935
    docker stop <CONTAINER_NAME>
    

    <CONTAINER_NAME> is the value in the NAMES column of the first command's output.

  • address already in use: another program holds the port. Find it:

    sudo ss -ltnp 'sport = :1935'
    

    Close that program normally (for example, another streaming server). Only kill it if you know what it is.

Then start the relay: docker compose up -d.

18.2.2.3 Outdated Image

Solution: Rebuild the image against the latest base image, then recreate the container:

docker compose build --pull
docker compose up -d --force-recreate

18.2.3 Confirm the Fix

The container shows Up, and each service you configured is listed as enabled:

docker compose ps relay
docker compose logs relay | grep -E "service enabled|Skipping|ERROR"

18.3 Advanced Diagnostics

18.3.1 Increase Log Verbosity

Warning

The log can contain your full stream URLs, including stream keys, at any level. At info, it does whenever you stream. Do not paste these logs into an issue or chat without removing the keys, and set the level back to error when you're done.

Set the log level in env/relay.env:

NGINX_ERROR_LOG_LEVEL=info

Recreate the container:

docker compose up -d --force-recreate

When you start streaming, a line like this appears for each destination:

relay: create push name='<STREAM_NAME>' ... url='a.rtmp.youtube.com/live2/<YOUTUBE_KEY>' ...

Valid values, least to most verbose: emerg, alert, crit, error (default), warn, notice, info. debug is also accepted, but this image's nginx gives no more output at debug than at info.

18.3.2 Check nginx Configuration

# Test nginx config syntax
docker compose exec relay nginx -t

# View active configuration
docker compose exec relay cat /etc/nginx/nginx.conf

18.4 See Also