Bug #5255
closedAPI call "filemoved" crashes TVH
0%
Description
I'm using a post process script after a recording has finished which converts the .ts file into a .mkv via ffmpeg. It creates the .mkv file in parallel and when the conversion has finished, it calls the TVH API to inform TVH about the filechange:
_TVH_IP="10.0.6.2" _TVH_PORT="9981" _API_ENDPOINT="/api/dvr/entry/filemoved" _BIN_CURL="/usr/bin/curl" .... success=0 repeat=0 while [ "$repeat" -lt 10 ]; do if ${_BIN_CURL} -s "http://${_TVH_IP}:${_TVH_PORT}${_API_ENDPOINT}" \ --data-urlencode "src=${TSVIDEO}" \ --data-urlencode "dst=${MKVIDEO}" > /dev/null; then echo -e "$(date): Notification successful!" echo -e "$(date): Notification successful!" >> $logfile success=1 break else echo -e "$(date): Notification attempt failed ..." echo -e "$(date): Notification attempt failed ..." >> $logfile sleep 30 fi repeat=$((repeat+1)) done ....
Unfortunately in 80% of all cases TVH crashes right when the API is called the first time. When the TVH server has restarted, the notification usually works right after the server came back. But the next recording which calls the API leads again to the crash.
Logfile entries:
Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: Signal: 11 in PRG: /usr/bin/tvheadend (4.3-1457~gc45bfdc) [d4aa275ef2596f88911b7d617b1e87c97ab8e5da] CWD: / Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: Fault address (nil) (Address not mapped) Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: Loaded libraries: /usr/lib/x86_64-linux-gnu/libdvbcsa.so.1 /lib/x86_64-linux-gnu/libssl.so.1.0.0 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 /usr/lib/x86_64-linux-gnu/liburiparser.so.1 /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 /lib/x86_64-linux-gnu/libdbus-1.so.3 /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libpthread.so.0 /lib/x86_64-linux-gnu/libm.so.6 /lib/x86_64-linux-gnu/librt.so.1 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libsystemd.so.0 /lib64/ld-linux-x86-64.so.2 /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/libselinux.so.1 /lib/x86_64-linux-gnu/liblzma.so.5 /lib/x86_64-linux-gnu/libgcrypt.so.20 /lib/x86_64-linux-gnu/libpcre.so.3 /lib/x86_64-linux-gnu/libgpg-error.so.0 /lib/x86_64-linux-gnu/libnss_compat.so.2 /lib/x86_64-linux-gnu/libnsl.so.1 /lib/x86_64-linux-gnu/libnss_nis.so.2 /lib/x86_64-linux-g Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: Register dump [23]: 00007fbe5c00165000000000040000010000000000000001000000000000020600007fbe5c00249c0000000000000000000055cd8149f1390000000000000000000000000000000000007fbe5c00249c000055cd8149e200000055cd8149f1100000000000000000000000000000049c000000000000000000007fbe729f83a800007fbe8ce3358a000000000001028300000000000000330000000000000004000000000000000efffffffe7ffbba130000000000000000 Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: STACKTRACE Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d0cf6ed 0x55cd7cec0000 Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: ??:0 0x7fbe8da02390 0x7fbe8d9f1000 Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: ??:0 0x7fbe8ce3358a 0x7fbe8cd94000 Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d119fa2 0x55cd7cec0000 Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d0fe04f 0x55cd7cec0000 Oct 13 17:26:30 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d12e29f 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d09e893 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d09fd04 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d09ee03 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d0a009b 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d0a0388 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d096e2d 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x55cd7d091f75 0x55cd7cec0000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: ??:0 0x7fbe8d9f86ba 0x7fbe8d9f1000 Oct 13 17:26:31 FlairTV tvheadend[31506]: CRASH: clone+0x6d (/lib/x86_64-linux-gnu/libc.so.6) Oct 13 17:26:31 FlairTV kernel: [6230486.457888] tvh:tcp-start[31822]: segfault at 0 ip 00007fbe8ce3358a sp 00007fbe729f83a8 error 4 in libc-2.23.so[7fbe8cd94000+1c0000] Oct 13 17:26:32 FlairTV systemd[1]: tvheadend.service: Main process exited, code=killed, status=11/SEGV Oct 13 17:26:32 FlairTV systemd[1]: tvheadend.service: Unit entered failed state. Oct 13 17:26:32 FlairTV systemd[1]: tvheadend.service: Failed with result 'signal'. Oct 13 17:27:01 FlairTV CRON[31852]: (hts) CMD (/home/hts/convert.sh >/dev/null 2>&1) Oct 13 17:27:26 FlairTV systemd[1]: tvheadend.service: Service hold-off time over, scheduling restart. Oct 13 17:27:26 FlairTV systemd[1]: Stopped Tvheadend - a TV streaming server and DVR. Oct 13 17:27:26 FlairTV systemd[1]: Starting Tvheadend - a TV streaming server and DVR... Oct 13 17:27:26 FlairTV systemd[1]: Started Tvheadend - a TV streaming server and DVR. Oct 13 17:27:26 FlairTV tvheadend[31866]: main: Log started Oct 13 17:27:26 FlairTV tvheadend[31866]: http: Starting HTTP server 0.0.0.0:9981 Oct 13 17:27:26 FlairTV tvheadend[31866]: htsp: Starting HTSP server 0.0.0.0:9982 Oct 13 17:27:26 FlairTV tvheadend[31866]: config: loaded Oct 13 17:27:26 FlairTV tvheadend[31866]: config: scanfile (re)initialization with path <none>
If there is any workaround or alternative method to inform TVH about the file change, I'd be happy to use this until the issue is fixed. This has a huge impact to my installation as we're mostly doing recordings and watch them later.