Skip to content

Server crashing - panic: runtime error: index out of range [0] with length 0 #208

@convicte

Description

@convicte

Hi all,

My apologies if this issue falls under any of the existing tickets, but I was not able to identify similarities or lack there of.

My setup was working flawlessly and was providing nearly no latency with six 4K streams, loading immediate on a single card.
Unfortunately, recently the server start to crash intermittently.
Since I updated to HA 2022.8.X, did a Mikrotik update to fw v.7.1.X, as well as played with a lot of different things over the last weeks, it's really difficult to narrow what exactly changed in my setup.

The error I am getting is the following:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-rtsp-to-web: executing...
[01:20:50] INFO: Updating configuration
[cont-init.d] 01-rtsp-to-web: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[01:20:50] INFO: Starting discovery service
[01:20:50] INFO: Starting RSTPtoWeb
time="2022-08-17T01:20:50+02:00" level=info msg="Server CORE start" func=main module=main
time="2022-08-17T01:20:50+02:00" level=info msg="Server HTTP start" call=Start func=RTSPServer module=http_server
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.stairs
time="2022-08-17T01:20:50+02:00" level=info msg="Server start success a wait signals" func=main module=main
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.gate
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.garden
time="2022-08-17T01:20:50+02:00" level=info msg="Server RTSP start" call=Start func=RTSPServer module=rtsp_server
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.taras_2
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.vto
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.backyard
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.vto_main
time="2022-08-17T01:20:50+02:00" level=info msg="Run stream" call=Run channel=0 func=StreamServerRunStreamDo module=core stream=camera.garden_ptz
[01:20:50] INFO: Successfully send discovery information to Home Assistant (8083).
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.taras_2
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.stairs
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.garden
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.vto
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.backyard
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.gate
time="2022-08-17T01:20:51+02:00" level=info msg="Success connection RTSP" call=Start channel=0 func=StreamServerRunStream module=core stream=camera.garden_ptz
time="2022-08-17T01:20:51+02:00" level=error msg="Stream error restart stream Camera send statusRTSP/1.0 404 Not Found" call=Restart
panic: runtime error: index out of range [0] with length 0
goroutine 37 [running]:
main.StreamServerRunStreamRTMP(0xc00040b4c0, 0xa, 0x12dd5e0, 0x1, 0xc0000beb00, 0x0, 0x0, 0x0)
/workspace/streamCore.go:265 +0x1291
main.StreamServerRunStream(0xc00040b4c0, 0xa, 0x12dd5e0, 0x1, 0xc0000beb00, 0x0, 0x0, 0x0)
/workspace/streamCore.go:67 +0x14cb
main.StreamServerRunStreamDo(0xc00040b4c0, 0xa, 0x12dd5e0, 0x1)
/workspace/streamCore.go:47 +0x4fa
created by main.(*StorageST).StreamChannelRunAll
/workspace/storageStreamChannel.go:42 +0x18a
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

I am running the HA_OS in a VirtualBox VM, with 6 cores passed onto the machin, and 8GB of RAM.

Any assistance would be greatly appreciated.
If I am missing any pertinent information, please let me know.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions