Page 1 of 1

[Solved] Can't access recordings on migrated new machine

Posted: Wed Aug 26, 2020 1:52 pm
by lindsayward
Hi! I have just installed a new Ubuntu 20.04 machine and migrated MythTV to it using backup and restore scripts (from a Ubuntu 14.04 box running MythTV 29). I've changed the hostname and copied all the files, but...
When I try to play a recording, I get "Recording Unavailable".
Backend log:

Code: Select all

Aug 26 23:28:36 lenovohtpc mythbackend: mythbackend[1520]: E ProcessRequest programinfo.cpp:2524 (GetPlaybackURL) ProgramInfo(1005_20111001182700.mpg): GetPlaybackURL: '1005_20111001182700.mpg' should be local, but it can not be found.
Frontend log:

Code: Select all

Aug 26 23:28:36 lenovohtpc mythfrontend.real: mythfrontend[1877]: E PlaybackBoxHelper playbackboxhelper.cpp:94 (CheckAvailability) PlaybackBoxHelper: CHECK_AVAILABILITY 'myth://lenovohtpc/1005_20111001182700.mpg' file not found
Via myth-setup, my storage directory is set to /movies/recordings which is a soft link to an external USB drive:

Code: Select all

lrwxrwxrwx   1 mythtv  mythtv    33 Aug 25 22:27 movies -> /media/lindsay/external4t/movies/
I have tried entering the direct full path in mythtv-setup, and I've tried a few versions (with and without trailing slash) including selecting the folder using the GUI to avoid any typos.
I can play the files in the folder with VLC.

My user 'lindsay' is in the 'mythtv' group and I believe my paths are group readable.
Here are my permissions:

Code: Select all

lindsay@lenovohtpc:~$ ls -ld /movies /movies/recordings/ /media/ /media/lindsay/ /media/lindsay/external4t/ /media/lindsay/external4t/movies/
drwxrwxrwx  3 lindsay lindsay  4096 Aug 26 20:03 /media/
drwxrwx---+ 3 lindsay lindsay  4096 Aug 26 23:26 /media/lindsay/
drwxrwx---  4 lindsay lindsay  4096 Aug 25 22:06 /media/lindsay/external4t/
drwxrwxr-x  6 mythtv  mythtv   4096 Aug 26 23:02 /media/lindsay/external4t/movies/
lrwxrwxrwx  1 mythtv  mythtv     33 Aug 25 22:27 /movies -> /media/lindsay/external4t/movies/
drwxrwxrwx  5 mythtv  mythtv  65536 Aug 26 23:05 /movies/recordings/
Also, my videos storage directory is set to /movies/videos and Myth Frontend CAN see and play these files. Perhaps that means it's something in the database? (As far as I know, videos aren't stored in the DB but just accessed on the disk each time.)
Any help is much appreciated, thanks!.

Re: Can't access recordings on migrated new machine

Posted: Wed Aug 26, 2020 3:59 pm
by bill6502
I would start the backend with --loglevel debug and watch for messages at the
beginning of the log (related to Storage Groups).

Also, from your favorite browser: <yourBackend>:6544/Myth/GetStorageGroupDirs?GroupName=Default
if Default is the Storage Group of interest. Expect contents similar to these:

Code: Select all

                "DirName": "/srv/mythtv-3/recordings/",
                "DirRead": "true",
                "DirWrite": "true",
                "GroupName": "Default",
                "HostName": "mc0",
                "Id": "54",
                "KiBFree": "31023868"
"mc0" is my backend (HostName), so maybe yours would be "lenovohtpc".

The 1st error message fires when the DB hostname for the SG doesn't match
the hostname (profile name) known to MythTV.

Re: Can't access recordings on migrated new machine

Posted: Wed Aug 26, 2020 9:03 pm
by lindsayward
Thank you for the reply, Bill!

Code: Select all

/usr/bin/mythbackend  --loglevel debug
2020-08-27 06:28:45.276775 C  mythbackend version: fixes/31 [v31.0-v31.0] www.mythtv.org
2020-08-27 06:28:45.276796 C  Qt version: compile: 5.12.5, runtime: 5.12.8
2020-08-27 06:28:45.276832 I  Ubuntu 20.04.1 LTS (x86_64)
...
2020-08-27 06:28:45.288816 N  Using runtime prefix = /usr
2020-08-27 06:28:45.288825 N  Using configuration directory = /home/lindsay/.mythtv
2020-08-27 06:28:45.288836 D  appbindir         = /usr/bin/
2020-08-27 06:28:45.288842 D  sharedir          = /usr/share/mythtv/
2020-08-27 06:28:45.288853 D  libdir            = /usr/lib/mythtv/
2020-08-27 06:28:45.288863 D  themedir          = /usr/share/mythtv/themes/
2020-08-27 06:28:45.288868 D  pluginsdir        = /usr/lib/mythtv/plugins/
2020-08-27 06:28:45.288878 D  translationsdir   = /usr/share/mythtv/i18n/
2020-08-27 06:28:45.288883 D  filtersdir        = /usr/lib/mythtv/filters/
2020-08-27 06:28:45.288893 D  cachedir          = /home/lindsay/.mythtv/cache
2020-08-27 06:28:45.288899 D  remotecachedir    = /home/lindsay/.mythtv/cache/remotecache
2020-08-27 06:28:45.288909 D  themebasecachedir = /home/lindsay/.mythtv/cache/themecache
2020-08-27 06:28:45.288918 D  thumbnaildir      = /home/lindsay/.mythtv/cache/thumbnails
2020-08-27 06:28:45.288992 I  Assumed character encoding: en_AU.UTF-8
2020-08-27 06:28:45.289637 I  Empty LocalHostName. This is typical.
2020-08-27 06:28:45.289652 I  Using a profile name of: 'lenovohtpc' (Usually the same as this host's name.)
Then when I run the frontend and try and play a recording:

Code: Select all

2020-08-27 06:52:55.763369 I  MainServer: MainServer::ANN Frontend
2020-08-27 06:52:55.763383 I  MainServer: adding: lenovohtpc(556e69730c30) as a client (events: 0)
2020-08-27 06:52:55.763484 I  BackendContext: Frontend 'lenovohtpc' connected.
2020-08-27 06:52:55.771377 I  MainServer: MainServer::ANN Monitor
2020-08-27 06:52:55.771388 I  MainServer: adding: lenovohtpc(556e696d8560) as a client (events: 1)
2020-08-27 06:53:02.129964 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
2020-08-27 06:53:02.177072 D  PortChecker::checkPort(): host localhost port 3306 timeLimit 30000 linkLocalOnly 1
2020-08-27 06:53:02.294983 E  ProgramInfo(3261_20200605062041.ts): GetPlaybackURL: '3261_20200605062041.ts' should be local, but it can not be found.
2020-08-27 06:53:02.500013 E  ProgramInfo(3261_20200825092700.ts): GetPlaybackURL: '3261_20200825092700.ts' should be local, but it can not be found.
http://127.0.0.1:6544/Myth/GetStorageGr ... me=Default shows:

Code: Select all

<StorageGroupDirList version="1.0" serializerVersion="1.1">
<StorageGroupDirs>
<StorageGroupDir>
<Id>24</Id>
<GroupName>Default</GroupName>
<HostName>lenovohtpc</HostName>
<DirName>/movies/recordings/</DirName>
<DirRead>true</DirRead>
<DirWrite>true</DirWrite>
<KiBFree>1376806140</KiBFree>
</StorageGroupDir>
</StorageGroupDirs>
</StorageGroupDirList>
And for completeness:

Code: Select all

mysql> select * from storagegroup;
+----+-------------+------------+------------------------------+
| id | groupname   | hostname   | dirname                      |
+----+-------------+------------+------------------------------+
| 19 | Videos      | lenovohtpc | /movies/videos/              |
|  3 | Fanart      | lenovohtpc | /var/lib/mythtv/fanart/      |
|  4 | Trailers    | lenovohtpc | /var/lib/mythtv/trailers/    |
|  5 | Coverart    | lenovohtpc | /var/lib/mythtv/coverart/    |
|  7 | Screenshots | lenovohtpc | /var/lib/mythtv/screenshots/ |
|  8 | Banners     | lenovohtpc | /var/lib/mythtv/banners/     |
|  9 | DB Backups  | lenovohtpc | /var/lib/mythtv/db_backups/  |
| 22 | LiveTV      | lenovohtpc | /movies/livetv/              |
| 24 | Default     | lenovohtpc | /movies/recordings/          |
+----+-------------+------------+------------------------------+
9 rows in set (0.00 sec)
So, I can't see anything here to suggest where the problem could be. Perhaps you can?

However:

Code: Select all

mysql> select * from settings;
+----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+--------------+
| value                                              | data                                                                                                                                    | hostname     |
+----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+--------------+
| mythfilldatabaseLastRunEnd                         | 2020-08-25T08:58:28Z                                                                                                                    | NULL         |
| DataDirectMessage                                  |                                                                                                                                         | NULL         |
| HaveRepeats                                        | 1                                                                                                                                       | NULL         |
| DBSchemaVer                                        | 1361                                                                                                                                    | NULL         |
| LiveTVIdleTimeout                                  | 0                                                                                                                                       | lenovohtpc   |
| MythFillGrabberSuggestsTime                        | 1                                                                                                                                       | NULL         |
| BackendServerIP                                    | 192.168.1.222                                                                                                                           | lenovohtpc   |
| BackendServerPort                                  | 6543                                                                                                                                    | lenovohtpc   |
| BackendStatusPort                                  | 6544                                                                                                                                    | lenovohtpc   |
| MasterServerIP                                     | 127.0.0.1                                                                                                                               | NULL         |
| MasterServerPort                                   | 6543                                                                                                                                    | NULL         |
| RecordFilePrefix                                   | /var/lib/mythtv/recordings                                                                                                              | lenovohtpc   |
This shows the BackendServerIP 192.168.1.222 address, which is the old backend, and also RecordFilePrefix, which I don't know about and isn't where my recordings are. So... (where) should I change these?

Thank you!

Re: Can't access recordings on migrated new machine

Posted: Wed Aug 26, 2020 9:19 pm
by lindsayward
Well...
Without doing anything except gathering the data for my post above (no changes, as far as I know), the recordings are now playing.
I went into the website to see if there was an "update/fix database" or something and I saw screenshots of the recordings... went to the frontend, and - they play!
Confused, but happy :)

Re: Can't access recordings on migrated new machine

Posted: Thu Aug 27, 2020 9:34 pm
by lindsayward
OK, so now it makes a bit more sense...
When I ran the command Bill suggested to change the log level:

Code: Select all

/usr/bin/mythbackend  --loglevel debug
it ran the backend as my user, lindsay.
When I run the backend as a service, it's as user, mythtv.

So, I guess this implies that user mythtv doesn't have access to the recordings files... but I'm not sure why.

Re: Can't access recordings on migrated new machine

Posted: Thu Aug 27, 2020 10:30 pm
by lindsayward
Problem solved.
After what seems like a large number of file permission modifications, including setting the a+x permission for parent directories and one ACL, my frontend can access recordings on the backend when run by mythtv user as a service.
I can't really tell what ones were actually needed, but it's there now.
The wiki page was helpful: https://www.mythtv.org/wiki/Troubleshoo ... ermissions
Thanks to people who take the time to edit documentation :)

Re: Can't access recordings on migrated new machine

Posted: Fri Aug 28, 2020 2:35 am
by Steve Goodey
If you're happy with the fix could you possibly added [Solved] to the subject line in the first post?

Ta.