As an additional bit of info I've just realised that this only happens if mythbackend is started with the "--daemon" option. I can get exactly the same error at the terminal prompt if I type "mythbackend --daemon". So, what is different about the daemon mode (apart from running in the background?)