TVHeadend not working

tvheadend doesn’t work after update (always the backup “/home/osmc/.hts/tvheadend/backup/unknown.tar.bz2” is restarting):

root@osmc:~# /etc/init.d/tvheadend status
● tvheadend.service - TVHeadend Server
   Loaded: loaded (/lib/systemd/system/tvheadend.service; enabled)
   Active: active (running) since Mi 2017-08-02 00:59:59 CEST; 5s ago
  Process: 1050 ExecStop=/bin/rm /run/tvheadend.pid (code=exited, status=0/SUCCESS)
  Process: 1186 ExecStart=/usr/bin/tvheadend -f -p /run/tvheadend.pid -C -u osmc -g video (code=exited, status=0/SUCCESS)
  Process: 1184 ExecStartPre=/bin/sleep 10 (code=exited, status=0/SUCCESS)
 Main PID: 1188 (tvheadend)
   CGroup: /system.slice/tvheadend.service
           ├─1188 /usr/bin/tvheadend -f -p /run/tvheadend.pid -C -u osmc -g video
           ├─1194 /bin/tar cjf /home/osmc/.hts/tvheadend/backup/unknown.tar.bz2 --exclude backup --exclude epggrab/*.sock --exclude timeshift/buffer .
           └─1196 bzip2

Aug 02 00:59:59 osmc tvheadend[1188]: main: Log started
Aug 02 00:59:59 osmc tvheadend[1188]: tcp: No systemd socket: creating a new one
Aug 02 00:59:59 osmc tvheadend[1188]: http: Starting HTTP server 0.0.0.0:9981
Aug 02 00:59:59 osmc tvheadend[1188]: tcp: No systemd socket: creating a new one
Aug 02 00:59:59 osmc tvheadend[1188]: htsp: Starting HTSP server 0.0.0.0:9982
Aug 02 00:59:59 osmc systemd[1]: Started TVHeadend Server.
Aug 02 00:59:59 osmc tvheadend[1188]: config: backup: migrating config from unknown (running 4.2.2)
Aug 02 00:59:59 osmc tvheadend[1188]: config: backup: running, output file /home/osmc/.hts/tvheadend/backup/unknown.tar.bz2
Aug 02 00:59:59 osmc tvheadend[1188]: spawn: Executing "/bin/tar"

It’s running – did you wait long enough for the migration?

tvheadend doesn’t work after update:

root@osmc:~# /etc/init.d/tvheadend start
[ ok ] Starting tvheadend (via systemctl): tvheadend.service.
root@osmc:~# /etc/init.d/tvheadend status
● tvheadend.service - TVHeadend Server
   Loaded: loaded (/lib/systemd/system/tvheadend.service; enabled)
   Active: active (running) since Mi 2017-08-02 00:59:59 CEST; 5s ago
  Process: 1050 ExecStop=/bin/rm /run/tvheadend.pid (code=exited, status=0/SUCCESS)
  Process: 1186 ExecStart=/usr/bin/tvheadend -f -p /run/tvheadend.pid -C -u osmc -g video (code=exited, status=0/SUCCESS)
  Process: 1184 ExecStartPre=/bin/sleep 10 (code=exited, status=0/SUCCESS)
 Main PID: 1188 (tvheadend)
   CGroup: /system.slice/tvheadend.service
           ├─1188 /usr/bin/tvheadend -f -p /run/tvheadend.pid -C -u osmc -g video
           ├─1194 /bin/tar cjf /home/osmc/.hts/tvheadend/backup/unknown.tar.bz2 --exclude backup --exclude epggrab/*.sock --exclude timeshift/buffer .
           └─1196 bzip2

After backup:
After 10 seconds tvheadend restart:

  root@osmc:/home/osmc/.hts/tvheadend/backup# /etc/init.d/tvheadend status
    ● tvheadend.service - TVHeadend Server
       Loaded: loaded (/lib/systemd/system/tvheadend.service; enabled)
       Active: activating (start-pre) since Mi 2017-08-02 01:10:45 CEST; 7s ago
      Process: 1425 ExecStop=/bin/rm /run/tvheadend.pid (code=exited, status=0/SUCCESS)
      Process: 1405 ExecStart=/usr/bin/tvheadend -f -p /run/tvheadend.pid -C -u osmc -g video (code=exited, status=0/SUCCESS)
     Main PID: 1406 (code=exited, status=1/FAILURE);         : 1428 (sleep)
       CGroup: /system.slice/tvheadend.service
               └─control
                 └─1428 /bin/sleep 10

Moved your second post to the new thread. Please post in one topic only.

yes I wait long enough for the migration.

Hi,

We’ve updated from TVH 4.0.9 to 4.2 in this update.
The migration process in TVH seems to certainly be an afterthought and as such doesn’t always work well. There were some efforts by @grahamh to help with this.

  • Did you have custom accounts? Can you paste your old TVH config? This will help us improve the migration and possibly spot the problem.

If you are not heavily invested in your current configuration, you may find it easier to simply remove the current .hts directory and start over.

Thank you for your quick response!

To paste the TVH config: How does this work?

Go to paste.osmc.tv and paste the config, then save, you should see a link then that you’ll post here.

Or you can use paste-log <logfile> :wink:

The current config is the whole tree ~/.hts/tvheadend/*. But what we need is the backup file /home/osmc/.hts/tvheadend/backup/unknown.tar.bz2.

The reason it’s called unknown is that tvh changed their config file format and their migrator doesn’t know it LOL.

Had a similar issue after the update. In my case, the upgrade process had some problem with the old access control file:

Aug 02 01:12:33 rpi tvheadend[887]: main: Log started
Aug 02 01:12:33 rpi tvheadend[887]: tcp: No systemd socket: creating a new one
Aug 02 01:12:33 rpi tvheadend[887]: http: Starting HTTP server 0.0.0.0:9981
Aug 02 01:12:33 rpi tvheadend[887]: tcp: No systemd socket: creating a new one
Aug 02 01:12:33 rpi tvheadend[887]: htsp: Starting HTSP server 0.0.0.0:9982
Aug 02 01:12:33 rpi systemd[1]: Started TVHeadend Server.
Aug 02 01:12:33 rpi tvheadend[887]: config: backup: migrating config from unknown (running 4.2.2)
Aug 02 01:12:33 rpi tvheadend[887]: config: backup: running, output file /home/osmc/.hts/tvheadend/backup/unknown.tar.bz2
Aug 02 01:12:33 rpi tvheadend[887]: spawn: Executing “/bin/tar”
Aug 02 01:12:35 rpi tvheadend[887]: config: backup: completed
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v17 to v18
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v18 to v19
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v19 to v20
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v20 to v21
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v21 to v22
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v22 to v23
Aug 02 01:12:35 rpi tvheadend[887]: config: migrating config from v23 to v24
Aug 02 01:12:35 rpi tvheadend[887]: START: filename /home/osmc/.hts/tvheadend/accesscontrol/1 is invalid
Aug 02 01:12:35 rpi systemd[1]: tvheadend.service: main process exited, code=exited, status=1/FAILURE
Aug 02 01:12:35 rpi systemd[1]: Unit tvheadend.service entered failed state.
Aug 02 01:12:41 rpi systemd[1]: tvheadend.service holdoff time over, scheduling restart.

Solved by deleting /home/osmc/.hts/tvheadend/accesscontrol/1 and reconfiguring user permissions through the tvheadend web ui after it started.

After removing the old config and new configuration: TVHeadend works!
:slight_smile:

This is annoying. Any chance of posting a failed accesscontrol/1 file? It should be in backup/unknown.tar.bz2.

this is my old accesscontrol/1 file:

root@osmc:/home/osmc/.hts/tvheadend_old/accesscontrol# cat 1 
{
        "enabled": 1,
        "username": "osmc",
        "comment": "Default access entry",
        "prefix": "0.0.0.0/0,::/0",
        "dvrallcfg": 1,
        "webui": 1,
        "admin": 1,
        "id": "1",
        "wizard": true,
        "streaming": [
        ],
        "dvr": [
        ]
}

Thank you. Not sure how it got to be like that, but tvh would choke on the "streaming": [] syntax when trying to migrate it because they didn’t use that in 4.0.9.

Such error was also in this case.It seems that both default user and “Unverified” should have streaming rights enabled?

Yes. If it didn’t happen automatically, just set them in the webui.