[mythtv-users] Error parsing config.xml?

Michael T. Dean mtdean at thirdcontact.com
Fri May 11 16:57:09 UTC 2012


On 05/11/2012 11:21 AM, John Pilkington wrote:
> On 11/05/12 15:11, Michael T. Dean wrote:
>> On 05/10/2012 03:50 PM, Stefan D wrote:
>>> On Thu, May 10, 2012 at 9:31 PM, Stefan D wrote:
>>>
>>>> I have a little problem that occurred when i updated today. When i
>>>> try to
>>>> start mythbackend i get:
>>>>
>>>> 2012-05-10 21:16:03.314086 E [31899/31899] CoreContext
>>>> configuration.cpp:67 (Load) - Error parsing:
>>>> /home/mythtv/.mythtv/config.xml at line: 1 column: 1
>>>>
>>>> I do have a valid config.xml at that location, i have checked the
>>>> settings
>>>> and verified that changes does get written to the file. Everyone have
>>>> permission to read the file.
>>>>
>>>> This only happens when i use my upstart script and use "--user
>>>> mythtv", if
>>>> i start it from the console with only "mythbackend" everything works
>>>> fine.
>>>>
>>>> I have probably missed something obvious, but what? I probably always
>>>> had
>>>> this problem but it shows now when support for mysql.txt has been
>>>> removed.
>>> My fault, there wasn't a valid config.xml at that location. Brain 
>>> freeze.
>>>
>>
>> Yes, there's an issue with 0.25-fixes that can result in your config.xml
>> getting deleted. It's a race condition that's been there for a long time
>> (forever?), but that only became apparent due to some major "behind the
>> scenes" changes between 0.24 and 0.25.
>>
>> The fix was too invasive to go into 0.25, so until 0.26 is released,
>> you'll just have to watch for issues when starting applications (and
>> might want to keep a backup copy of the config.xml for each host to make
>> restoring it easier). Or, just modify your start script temporarily
>> (you'll definitely want to remove this for unstable/development or 0.26)
>> to copy the backup config.xml into place before starting
>> mythbackend/mythfrontend. If config.xml is lost while mythbackend is
>> running and your mythpreviewgen/mythcommflag/mythtranscode jobs fail,
>> you can always restart those jobs after restoring the backup config.xml.
>
> A script that I submitted some time ago needed editing to provide DB 
> password etc, and Raymond Wagner suggested using mysql.txt instead. 
> Now that mysql.txt is deprecated - or worse - it's not obvious to me 
> how I ought to use config.xml to get the same result;  maybe browsing 
> around other scripts would help, but can I ask here?
>
> http://www.mythtv.org/wiki/Talk:Mythcutprojectx

Probably best would be to use a language designed for parsing text, 
rather than using shell scripting (which was designed to run other 
programs).

Else, you can use awk and/or sed to read the appropriate information 
from the config.xml.  It's just a lot of extra work, which becomes easy 
in other languages--or even "automatic" if using a language with MythTV 
bindings (such as Python or (if you must) Perl (as the Perl bindings are 
much less capable/useful than the Python bindings)).

Mike


More information about the mythtv-users mailing list