Recording Failed - missing $n in format string?
Added by Adam Clarke about 6 years ago
Morning,
My family has been running Tvheadend for a few months now on three separate machines after moving from a MediaPortal configuration. All machines are currently running at version 4.3-1387 on Ubuntu Server 18.04.1
Two of these machines were set to record X-Factor last night at 8PM. One machine worked fine, but the other machine failed with the following information from the syslog:
Sep 30 19:57:30 tvh-tc tvheadend[330]: dvr: "New: The X Factor" on "ITV HD" recorder starting
Sep 30 19:57:30 tvh-tc tvheadend[330]: mpegts: 634MHz in DVB-T Network - tuning on Silicon Labs Si2168 #3 : DVB-T #0
Sep 30 19:57:30 tvh-tc tvheadend[330]: subscription: 0069: "DVR: New: The X Factor" subscribing on channel "ITV HD", weight: 500, adapter: "Silicon Labs Si2168 #3 : DVB-T #0", network: "DVB-T Network", mux: "634MHz", service: "ITV HD", profile="pass"
Sep 30 19:58:00 tvh-tc tvheadend[330]: dvr: /mnt/Media/Recordings/New_ The X Factor/ITV HD - 2018-09-30 - 20-00.ts from adapter: "Silicon Labs Si2168 #3 : DVB-T #0", network: "DVB-T Network", mux: "634MHz", provider: "<N/A>", service: "ITV HD"
Sep 30 19:58:00 tvh-tc tvheadend[330]: dvr: # type lang resolution aspect ratio sample rate channels
Sep 30 19:58:00 tvh-tc tvheadend[330]: dvr: 1 H264 1920x1080 ?
Sep 30 19:58:00 tvh-tc tvheadend[330]: dvr: 2 AAC eng 96000 ?
Sep 30 19:58:00 tvh-tc tvheadend[330]: dvr: 3 AAC eng 96000 ?
Sep 30 19:58:00 tvh-tc tvheadend[330]: dvr: 4 DVBSUB eng
Sep 30 19:58:58 tvh-tc tvheadend[330]: dvr: unable to create unique name (missing $n in format string?)
Sep 30 19:58:58 tvh-tc tvheadend[330]: dvr: Recording error: "/mnt/Media/Recordings/New_ The X Factor/ITV HD - 2018-09-30 - 20-00.ts": Unable to create file
Sep 30 19:59:00 tvh-tc tvheadend[330]: subscription: 0069: "DVR: New: The X Factor" unsubscribing from "ITV HD"
Sep 30 19:59:00 tvh-tc tvheadend[330]: dvr: "New: The X Factor" on "ITV HD": End of program: File not created
This resulted in a file of 500kb being generated on the file system. The mount path is configured to a CIFS share on a Windows VM on the same Proxmox VM Host.
Not too sure what this error means but obviously its not an ideal situation. Does anyone have any ideas as to what has caused this error? The only thing I found was this post https://tvheadend.org/issues/4958 but I am running a much newer version than discussed.
Regards
Replies (13)
RE: Recording Failed - missing $n in format string? - Added by Em Smith about 6 years ago
In Config->Recording, click "expert". The "format string" needs a "$n" to ensure each file generated has a unique name, since you said you have two systems recording to the same path so the filename will clash otherwise.
RE: Recording Failed - missing $n in format string? - Added by Adam Clarke about 6 years ago
Sorry I should have clarified that each Tvheadend setup points to its own CIFS share on a Windows VM on separate Proxmox hosts. Each setup is located in different households.
The configuration is mirrored though to ease management of each setup.
RE: Recording Failed - missing $n in format string? - Added by Adam Clarke about 6 years ago
Hello again,
Faced the same issue on the same system again last night:
Oct 18 22:42:30 tvh-tc tvheadend[592]: dvr: "Question Time" on "BBC ONE HD" recorder starting
Oct 18 22:42:30 tvh-tc tvheadend[592]: mpegts: 634MHz in DVB-T Network - tuning on Silicon Labs Si2168 #3 : DVB-T #0
Oct 18 22:42:30 tvh-tc tvheadend[592]: subscription: 0035: "DVR: Question Time" subscribing on channel "BBC ONE HD", weight: 500, adapter: "Silicon Labs Si2168 #3 : DVB-T #0", network: "DVB-T Network", mux: "634MHz", service: "BBC ONE HD", profile="pass"
Oct 18 22:42:30 tvh-tc tvheadend[592]: linuxdvb: Unable to provide BER value.
Oct 18 22:42:30 tvh-tc tvheadend[592]: linuxdvb: Unhandled ERROR_BLOCK_COUNT scale: 0
Oct 18 22:42:30 tvh-tc tvheadend[592]: linuxdvb: Unable to provide UNC value.
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: /mnt/Media/Recordings/Question Time/BBC ONE HD - 2018-10-18 - 22-45.ts from adapter: "Silicon Labs Si2168 #3 : DVB-T #0", network: "DVB-T Network", mux: "634MHz", provider: "<N/A>", service: "BBC ONE HD"
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: # type lang resolution aspect ratio sample rate channels
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: 1 H264 1920x1080 ?
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: 2 AAC eng 96000 ?
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: 3 AAC eng 96000 ?
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: 4 DVBSUB eng
Oct 18 22:47:09 tvh-tc tvheadend[592]: dvr: unable to create unique name (missing $n in format string?)
Oct 18 22:47:09 tvh-tc tvheadend[592]: dvr: Recording error: "/mnt/Media/Recordings/Question Time/BBC ONE HD - 2018-10-18 - 22-45.ts": Unable to create file
Oct 18 22:47:09 tvh-tc tvheadend[592]: subscription: 0035: "DVR: Question Time" unsubscribing from "BBC ONE HD"
Oct 18 22:47:09 tvh-tc tvheadend[592]: dvr: "Question Time" on "BBC ONE HD": End of program: File not created
This has resulted in a 382KB file generated named BBC ONE HD - 2018-10-18 - 22-45.ts within the Recordings\Question Time directory.
Can someone help?
RE: Recording Failed - missing $n in format string? - Added by Mark Clarkstone about 6 years ago
Sure, what is your current format string?
The default in 4.3 is..
$c/$t$n.$x
HTH
RE: Recording Failed - missing $n in format string? - Added by Adam Clarke about 6 years ago
The format string we use is:
$t/$c - $e%F - %R.$x
Thanks
RE: Recording Failed - missing $n in format string? - Added by Mark Clarkstone about 6 years ago
Yeah, you need to throw in an $n somewhere!
RE: Recording Failed - missing $n in format string? - Added by Adam Clarke about 6 years ago
But that doesn't explain why a file is actually created without issue and for some reason TVHeadend thinks the file wasn't created and then logs about the $n format string missing?
RE: Recording Failed - missing $n in format string? - Added by Mark Clarkstone about 6 years ago
Adam Clarke wrote:
But that doesn't explain why a file is actually created without issue and for some reason TVHeadend thinks the file wasn't created and then logs about the $n format string missing?
Sorry, I missed that. Looks like you may have stumbled onto a bug, you might want to open an issue.
1 Make sure to upgrade to 1480 (available on apt.tvheadend.org). We're in the process of phasing out Bintray, you can check AptRepositories for details (feedback welcome in #5264)
RE: Recording Failed - missing $n in format string? - Added by Adam Clarke about 6 years ago
OK I've created a bug pointing to this post, I've also updated to 1480 and added a $n at the end of the string before the filename.
I will continue to monitor but it does appear quite intermittent.
RE: Recording Failed - missing $n in format string? - Added by Jaroslav Kysela about 6 years ago
I think that it's not error at all - check logs which tvh instance created file "BBC ONE HD - 2018-10-18 - 22-45.ts" . Without $n in the format string, tvh does not know, how to create another filename to not overwrite the previous file. More information should be in debug logs.
RE: Recording Failed - missing $n in format string? - Added by Adam Clarke about 6 years ago
Can I just be clear and confirm that each instance is setup independent of each other. They all use their own CIFS storage to record to presented from individual Windows Virtual Machines. Each setup is located in a different household.
Cheers
RE: Recording Failed - missing $n in format string? - Added by Jaroslav Kysela about 6 years ago
I looked more to your logs, here is created the file:
Oct 18 22:43:00 tvh-tc tvheadend[592]: dvr: /mnt/Media/Recordings/Question Time/BBC ONE HD - 2018-10-18 - 22-45.ts from adapter: "Silicon Labs Si2168 #3 : DVB-T #0", network: "DVB-T Network", mux: "634MHz", provider: "<N/A>", service: "BBC ONE HD"
and here tvh tries to create another one (probably stream parameter change - PMT - or so):
Oct 18 22:47:09 tvh-tc tvheadend[592]: dvr: unable to create unique name (missing $n in format string?)
I would upgrade to latest (some related fixes are there) and if the problem persist, create "--trace service,tbl-base" log (https://tvheadend.org/projects/tvheadend/wiki/Traces).
RE: Recording Failed - missing $n in format string? - Added by Jaroslav Kysela about 6 years ago
Attach the logs to the bug #5275 .