livekit / egress

Export and record WebRTC sessions and tracks
https://blog.livekit.io/livekit-universal-egress-launch/
Apache License 2.0
168 stars 68 forks source link

[BUG] Twirp error unavailable: no response from servers #682

Closed BisarAhmed closed 3 months ago

BisarAhmed commented 3 months ago

Describe the bug could not solve the issue be reading this some title error i set up the environment in WSL2, run the services in this order

  1. livekit-server --dev --bind 0.0.0.0
  2. docker network create livekit-network i create this network so the Redis and egress can connect
  3. docker run --rm --name db-redis --network livekit-network -d -v redis-data:/data -v ./redis-custom.conf:/usr/local/etc/redis/redis.conf -p 6379:6379 redis:latest
  4. docker run --rm \ --cap-add=SYS_ADMIN \ --network livekit-network \ -e EGRESS_CONFIG_FILE=/out/config.yaml \ -v ~/livekit-egress:/out \ livekit/egress

when i try to start recording get this error in Golang twirp error unavailable: no response from servers

Egress Version latest

Egress Request

    fileRequest := &livekit.RoomCompositeEgressRequest{
        RoomName: roomName,
        Output: &livekit.RoomCompositeEgressRequest_File{
            File: &livekit.EncodedFileOutput{
                FileType: livekit.EncodedFileType_MP4,
                Filepath: "public/my-room-test.mp4",
            },
        },
    }

    info, err = egress.egressClient.StartRoomCompositeEgress(context.Background(), fileRequest)

Additional context my redis config file

# Comment out the line that restricts Redis to only listen to the localhost
# bind 127.0.0.1

# Disable protected mode to allow connections from outside the local system
protected-mode no

my live egress config.yaml

api_key: devkey
api_secret: secret
ws_url: ws://192.168.15.222:7880
insecure: true
redis:
  address: db-redis:6379
  username:
  password:
  db: 1
log_level: debug

Logs when running the egress i get this, the second line looks like error failed cgroup

2024-05-26T13:39:18.745Z        INFO    egress  redis/redis.go:142      connecting to redis     {"nodeID": "NE_8cxiPb22eTgV", "clusterID": "", "simple": true, "addr": "db-redis:6379"}
2024-05-26T13:39:18.748Z        INFO    egress  hwstats/cpu_linux.go:76 failed reading cgroup specific cpu stats, falling back to system wide implementation   {"nodeID": "NE_8cxiPb22eTgV", "clusterID": ""}
2024-05-26T13:39:18.748Z        INFO    egress  stats/monitor.go:134    cpu available: 8.000000 max cost: 4.000000     {"nodeID": "NE_8cxiPb22eTgV", "clusterID": ""}
2024-05-26T13:39:18.750Z        DEBUG   egress  server/server.go:140    starting service        {"nodeID": "NE_8cxiPb22eTgV", "clusterID": "", "version": "1.8.4"}
2024-05-26T13:39:18.750Z        INFO    egress  server/server.go:146    service ready   {"nodeID": "NE_8cxiPb22eTgV", "clusterID": ""}
2024-05-26T13:39:18.751Z        DEBUG   egress  server/server.go:132    starting template server on address localhost:7980     {"nodeID": "NE_8cxiPb22eTgV", "clusterID": ""}
BisarAhmed commented 3 months ago

solved by updating the config.yaml to

api_secret: secret
ws_url: ws://172.17.0.1:7880
insecure: true
redis:
  address: 172.17.0.1:6379
log_level: debug

and running the livekit server with this commnad livekit-server --dev --redis-host=172.17.0.1:6379 --bind 0.0.0.0

but still the egress livekit-cli list-egress has this error
twirp error internal: unexpected HTTP status code 301 "Moved Permanently" received, Location="/twirp/livekit.Egress/ListEgress"

new issue is need for that error