Bug #1003

find_orphans.py uses different backend connections for read and write operations

Added by thekingofspain over 1 year ago. Updated 9 months ago.

Status:Closed Start date:07/12/2016
Priority:Low Due date:
Assignee:brfransen % Done:

0%

Category:Packages: Core Spent time: -
Target version:-

Description

the find_orphans.py script is able to connect to backend to retrieve information that could be deleted. However when trying to delete items, the scripts fails to connect to the backend. Assuming the gets are using localhost of ip4 while the deletes are using ip6 specific.

[root@mythtvquad ~]# find_orphans.py
Recordings with missing files
mythtvquad: Celebrity Food Fight - Tom Arnold and Melissa Rivers: Down and Dirty Dinner Battle 9064_20160602060000.mpg
mythtvquad: Criminal Minds: Beyond Borders - Citizens of the World 9189_20160421020000.mpg
mythtvquad: Epic 9337_20151213190000.mpg
mythtvquad: Independent Lens - Bully 9020_20160131043000.mpg
mythtvquad: Independent Lens - The Trials of Muhammad Ali 9191_20160226040000.mpg
mythtvquad: Independent Lens - Twin Sisters 9369_20160502030000.mpg
mythtvquad: Law & Order: Special Victims Unit - Community Policing 9005_20151015010000.mpg
mythtvquad: My Cat From Hell - Breaking Bald 9066_20160501000100.mpg
mythtvquad: My Cat From Hell - Four Blind Cats 9066_20160417000000.mpg
mythtvquad: My Cat From Hell - Crazy Cat Opens Doors 9066_20160410020300.mpg
mythtvquad: My Cat From Hell - Scary Tails 9066_20160424000000.mpg
mythtvquad: My Cat From Hell - Brooklyn Cat Fight 9066_20160508000000.mpg
mythtvquad: My Cat From Hell - Gotham Feral Cats 9066_20160515000000.mpg
mythtvquad: My Cat From Hell - Twinkle, Twinkle, Little Scar 9066_20160522000000.mpg
mythtvquad: Soundstage - GeorgeFest 9191_20160508040000.mpg
mythtvquad: The Facts of Life - Come Back to the Truck Stop, Natalie Green, Natalie Green 9030_20150907233600.mpg
mythtvquad: The Live Room - Dwight Yoakam 9209_20160517050000.mpg
mythtvquad: The Rachel Maddow Show 9317_20160602010000.mpg
mythtvquad: True Life - True Life Presents: Hooked 9296_20160519050000.mpg
Count: 19
Orphaned video files
mythtvquad: /data/storage/raid30/media/tv/9042_20160606000000.ts 1.9GB
mythtvquad: /data/storage/raid30/media/tv/9189_20160605230000.ts 15.3GB
mythtvquad: /data/storage/raid30/media/tv/9208_20160602171200.ts 1.5GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160603050000.ts 1.9GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605100000.ts 1.8GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605110000.ts 1.8GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605120000.ts 1.7GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605130000.ts 1.6GB
mythtvquad: /data/storage/raid30/media/tv/9317_20160604100000.ts 1.5GB
mythtvquad: /data/storage/raid30/media/tv/9370_20160602210000.ts 1.6GB
Total: 30.7GB
Orphaned snapshots
mythtvquad: /data/storage/raid30/media/tv/9042_20160606000000.ts.png 178.3KB
mythtvquad: /data/storage/raid30/media/tv/9189_20160605230000.ts.png 1.6MB
mythtvquad: /data/storage/raid30/media/tv/9208_20160602171200.ts.-1.100x56.png 9.1KB
mythtvquad: /data/storage/raid30/media/tv/9208_20160602171200.ts.png 773.1KB
mythtvquad: /data/storage/raid30/media/tv/9209_20160603050000.ts.-1.100x56.png 8.1KB
mythtvquad: /data/storage/raid30/media/tv/9209_20160603050000.ts.png 1.1MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605100000.ts.png 1.6MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605110000.ts.png 1.3MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605120000.ts.png 1.3MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605130000.ts.png 1.2MB
mythtvquad: /data/storage/raid30/media/tv/9317_20160604100000.ts.png 891.8KB
mythtvquad: /data/storage/raid30/media/tv/9370_20160602210000.ts.png 243.8KB
Total: 10.2MB
Database backups
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg-1317-20160602080154.sql.gz 114.0MB
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg-1344-20160602080324.sql.gz 114.1MB
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg-1344-20160603013950.sql 682.4MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160603013950.sql.gz 115.0MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160608081637.sql.gz 112.6MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609013618.sql.gz 113.6MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609061941.sql.gz 113.1MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062100.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062209.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062310.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062605.sql 671.7MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062605.sql.gz 7.7MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062623.sql 671.7MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609063607.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609063802.sql.gz 112.8MB
Total: 3.3GB
Other files
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg_restore.pl 68.6KB
Total: 68.6KB
Please select from the following:
1. Delete orphaned recording entries
2. Delete orphaned video files
3. Delete orphaned snapshots
4. Delete other files
R. Refresh list
Q. Quit

4

The following files will be deleted
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg_restore.pl 68.6KB
Total: 68.6KB
Are you sure you want to continue? (yes/no)

yes

2016-07-11 20:55:43.229506 C [5195] Python Backend Connection Couldn't connect to backend [2601:249:100:d91:bcec:720a:b3d7:9891]:6543
Traceback (most recent call last):
File "/usr/LH/bin/find_orphans.py", line 249, in <module>
main()
File "/usr/LH/bin/find_orphans.py", line 225, in main
opt1(opt2)
File "/usr/LH/bin/find_orphans.py", line 154, in delete_files
f.delete()
File "/usr/LH/bin/find_orphans.py", line 29, in delete
be = MythBE(self.host, db=DB)
File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line 119, in init
self._conn.command = self._newcmdconn()
File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line 142, in _newcmdconn
self.blockshutdown)
File "/usr/lib/python2.7/site-packages/MythTV/connections.py", line 207, in init
raise MythBEError(MythError.PROTO_CONNECTION, self.host, self.port)
MythTV.exceptions.MythBEError: Failed to connect to backend at 2601:249:100:d91:bcec:720a:b3d7:9891:6543

History

Updated by brfransen over 1 year ago

I can't reproduce this. For listing the data and deletes the script uses the same python bindings. What happens when you run it as user mythtv and not root? My guess is this is a problem with config.xml. LinHES tries to link /root/.mythtv/config.xml and /home/mythtv/.mythtv/config.xml to /usr/share/mythtv/config.xml so they are all the same.

Updated by thekingofspain over 1 year ago

Same behavior when running as mythtv.
------------------------------------------------------------
[root@mythtvquad ~]# su mythtv
[mythtv@mythtvquad root]$ find
find find2perl findfs findmnt find_orphans.py findssl.sh
[mythtv@mythtvquad root]$ find_orphans.py
Recordings with missing files
mythtvquad: Celebrity Food Fight - Tom Arnold and Melissa Rivers: Down and Dirty Dinner Battle 9064_20160602060000.mpg
mythtvquad: Criminal Minds: Beyond Borders - Citizens of the World 9189_20160421020000.mpg
mythtvquad: Epic 9337_20151213190000.mpg
mythtvquad: Independent Lens - Bully 9020_20160131043000.mpg
mythtvquad: Independent Lens - The Trials of Muhammad Ali 9191_20160226040000.mpg
mythtvquad: Independent Lens - Twin Sisters 9369_20160502030000.mpg
mythtvquad: Law & Order: Special Victims Unit - Community Policing 9005_20151015010000.mpg
mythtvquad: My Cat From Hell - Breaking Bald 9066_20160501000100.mpg
mythtvquad: My Cat From Hell - Four Blind Cats 9066_20160417000000.mpg
mythtvquad: My Cat From Hell - Crazy Cat Opens Doors 9066_20160410020300.mpg
mythtvquad: My Cat From Hell - Scary Tails 9066_20160424000000.mpg
mythtvquad: My Cat From Hell - Brooklyn Cat Fight 9066_20160508000000.mpg
mythtvquad: My Cat From Hell - Gotham Feral Cats 9066_20160515000000.mpg
mythtvquad: My Cat From Hell - Twinkle, Twinkle, Little Scar 9066_20160522000000.mpg
mythtvquad: Soundstage - GeorgeFest 9191_20160508040000.mpg
mythtvquad: The Facts of Life - Come Back to the Truck Stop, Natalie Green, Natalie Green 9030_20150907233600.mpg
mythtvquad: The Live Room - Dwight Yoakam 9209_20160517050000.mpg
mythtvquad: The Rachel Maddow Show 9317_20160602010000.mpg
mythtvquad: True Life - True Life Presents: Hooked 9296_20160519050000.mpg
Count: 19
Orphaned video files
mythtvquad: /data/storage/raid30/media/tv/9042_20160606000000.ts 1.9GB
mythtvquad: /data/storage/raid30/media/tv/9189_20160605230000.ts 15.3GB
mythtvquad: /data/storage/raid30/media/tv/9208_20160602171200.ts 1.5GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160603050000.ts 1.9GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605100000.ts 1.8GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605110000.ts 1.8GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605120000.ts 1.7GB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605130000.ts 1.6GB
mythtvquad: /data/storage/raid30/media/tv/9317_20160604100000.ts 1.5GB
mythtvquad: /data/storage/raid30/media/tv/9370_20160602210000.ts 1.6GB
Total: 30.7GB
Orphaned snapshots
mythtvquad: /data/storage/raid30/media/tv/9042_20160606000000.ts.png 178.3KB
mythtvquad: /data/storage/raid30/media/tv/9189_20160605230000.ts.png 1.6MB
mythtvquad: /data/storage/raid30/media/tv/9208_20160602171200.ts.-1.100x56.png 9.1KB
mythtvquad: /data/storage/raid30/media/tv/9208_20160602171200.ts.png 773.1KB
mythtvquad: /data/storage/raid30/media/tv/9209_20160603050000.ts.-1.100x56.png 8.1KB
mythtvquad: /data/storage/raid30/media/tv/9209_20160603050000.ts.png 1.1MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605100000.ts.png 1.6MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605110000.ts.png 1.3MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605120000.ts.png 1.3MB
mythtvquad: /data/storage/raid30/media/tv/9209_20160605130000.ts.png 1.2MB
mythtvquad: /data/storage/raid30/media/tv/9317_20160604100000.ts.png 891.8KB
mythtvquad: /data/storage/raid30/media/tv/9370_20160602210000.ts.png 243.8KB
Total: 10.2MB
Database backups
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg-1317-20160602080154.sql.gz 114.0MB
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg-1344-20160602080324.sql.gz 114.1MB
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg-1344-20160603013950.sql 682.4MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160603013950.sql.gz 115.0MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160608081637.sql.gz 112.6MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609013618.sql.gz 113.6MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609061941.sql.gz 113.1MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062100.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062209.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062310.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062605.sql 671.7MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062605.sql.gz 7.7MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609062623.sql 671.7MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609063607.sql.gz 112.9MB
mythtvquad: /data/storage/raid30/backup/mythtv_backups/mythconverg-1344-20160609063802.sql.gz 112.8MB
Total: 3.3GB
Other files
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg_restore.pl 68.6KB
Total: 68.6KB
Please select from the following:
1. Delete orphaned recording entries
2. Delete orphaned video files
3. Delete orphaned snapshots
4. Delete other files
R. Refresh list
Q. Quit

4

The following files will be deleted
mythtvquad: /data/storage/disk0/backup/mythtv_backups/mythconverg_restore.pl 68.6KB
Total: 68.6KB
Are you sure you want to continue? (yes/no)

yes

2016-07-13 00:39:50.951234 C [3261] Python Backend Connection Couldn't connect to backend [2601:249:100:d91:bcec:720a:b3d7:9891]:6543
Traceback (most recent call last):
File "/usr/LH/bin/find_orphans.py", line 249, in <module>
main()
File "/usr/LH/bin/find_orphans.py", line 225, in main
opt1(opt2)
File "/usr/LH/bin/find_orphans.py", line 154, in delete_files
f.delete()
File "/usr/LH/bin/find_orphans.py", line 29, in delete
be = MythBE(self.host, db=DB)
File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line 119, in init
self._conn.command = self._newcmdconn()
File "/usr/lib/python2.7/site-packages/MythTV/mythproto.py", line 142, in _newcmdconn
self.blockshutdown)
File "/usr/lib/python2.7/site-packages/MythTV/connections.py", line 207, in init
raise MythBEError(MythError.PROTO_CONNECTION, self.host, self.port)
MythTV.exceptions.MythBEError: Failed to connect to backend at 2601:249:100:d91:bcec:720a:b3d7:9891:6543

[mythtv@mythtvquad root]$ ls -l /home/mythtv/.mythtv/config.xml
lrwxrwxrwx 1 root root 28 Jun 6 21:52 /home/mythtv/.mythtv/config.xml -> /usr/share/mythtv/config.xml
[mythtv@mythtvquad root]$ ls -l /root/.mythtv/config.xml
lrwxrwxrwx 1 root root 28 Jun 30 01:39 /root/.mythtv/config.xml -> /usr/share/mythtv/config.xml

Updated by brfransen over 1 year ago

In mythtv-setup is your IPv6 address something other than ::1? If it is try setting it to ::1.

Updated by brfransen 10 months ago

  • Assignee set to brfransen
  • Category set to Packages: Core
  • Status changed from New to Closed

Can't recreate closing for now.

Also available in: Atom PDF