Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error loading random playlist #702

Open
rubencabrera opened this issue Nov 15, 2017 · 0 comments
Open

Error loading random playlist #702

rubencabrera opened this issue Nov 15, 2017 · 0 comments

Comments

@rubencabrera
Copy link

tl;dr
This is quite surely a database corruption error. Just leaving it here so I can update the troubleshooting or maybe the docs with what to do to migrate correctly between machines.

Background:
I changed the server from a i686 running lubuntu to a raspberry pi 3.
Cloned the code again in the new one, modified the config as needed (just the name of the user, mount point and the disk itself are the same) for the new system and (hoping it would be so easy) copied the contents of the ~/.local/share/cherrymusic folder.

Everything seems to be working fine, the users can log in, the search works, playlists are available and yield no errors and the files are playable after installing all the codecs.

How to reproduce:

Click random! to get a random playlist.

Result:
On the web player:

error loading random playlist

From the error.log file on the first occurrence of the error:

ERROR    [2017-11-15 10:16:12,154] : cherrypy.error.1975126160 : from line (223) at
         /usr/local/lib/python3.5/dist-packages/cherrypy/_cplogging.py           
         --                                                                      
         [15/Nov/2017:10:16:12] HTTP                                             
 Traceback (most recent call last):                                              
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 634, in respond
     self._do_respond(path_info)                                                 
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 693, in _do_respond
     response.body = self.handler()                                              
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/lib/encoding.py", line 221, in __call__
     self.body = self.oldhandler(*args, **kwargs)                                
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpdispatch.py", line 60, in __call__
     return self.callable(*self.args, **self.kwargs)                             
   File "/home/pi/dev/cherrymusic/cherrymusicserver/httphandler.py", line 295, in api
     return json.dumps({'data': handler(**handler_args)})                        
   File "/home/pi/dev/cherrymusic/cherrymusicserver/httphandler.py", line 547, in api_generaterandomplaylist
     return [entry.to_dict() for entry in self.model.randomMusicEntries(50)]     
   File "/home/pi/dev/cherrymusic/cherrymusicserver/cherrymodel.py", line 305, in randomMusicEntries
     entries = self.cache.randomFileEntries(loadCount)                           
   File "/home/pi/dev/cherrymusic/cherrymusicserver/sqlitecache.py", line 241, in randomFileEntries
     entries = self.musicEntryFromFileIds(file_ids, mode='fileonly')             
   File "/home/pi/dev/cherrymusic/cherrymusicserver/sqlitecache.py", line 276, in musicEntryFromFileIds
     for id, parent_id, filename, fileext, isdir in cursor.fetchall():           
 sqlite3.DatabaseError: database disk image is malformed             

If trying again, it gets a bit messy:

ERROR    [2017-11-15 10:20:50,794] : cherrypy.error.1975126160 : from line (223) at
         /usr/local/lib/python3.5/dist-packages/cherrypy/_cplogging.py           
         --                                                                      
         [15/Nov/2017:10:20:50] HTTP                                             
 Traceback (most recent call last):                                              
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 634, in respond
     self._do_respond(path_info)                                                 
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 693, in _do_respond
     response.body = self.handler()                                              
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/lib/encoding.py", line 221, in __call__
     self.body = self.oldhandler(*args, **kwargs)                                
   File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpdispatch.py", line 60, in __call__
     return self.callable(*self.args, **self.kwargs)                             
   File "/home/pi/dev/cherrymusic/cherrymusicserver/httphandler.py", line 295, in api
     return json.dumps({'data': handler(**handler_args)})                        
   File "/home/pi/dev/cherrymusic/cherrymusicserver/httphandler.py", line 547, in api_generaterandomplaylist
     return [entry.to_dict() for entry in self.model.randomMusicEntries(50)]     
   File "/home/pi/dev/cherrymusic/cherrymusicserver/cherrymodel.py", line 305, in randomMusicEntries
     entries = self.cache.randomFileEntries(loadCount)                           
   File "/home/pi/dev/cherrymusic/cherrymusicserver/sqlitecache.py", line 241, in randomFileEntries
     entries = self.musicEntryFromFileIds(file_ids, mode='fileonly')             
   File "/home/pi/dev/cherrymusic/cherrymusicserver/sqlitecache.py", line 300, in musicEntryFromFileIds
     mode = mode       

That last line repeats itself for 1862 times and then:

 File "/home/pi/dev/cherrymusic/cherrymusicserver/sqlitecache.py", line 247, in musicEntryFromFileIds
     reload(cherrymusicserver.tweak)                                             
   File "/usr/lib/python3.5/imp.py", line 314, in reload                         
     return importlib.reload(module)                                             
   File "/usr/lib/python3.5/importlib/__init__.py", line 165, in reload          
     spec = module.__spec__ = _bootstrap._find_spec(name, pkgpath, target)       
   File "<frozen importlib._bootstrap>", line 896, in _find_spec                 
   File "<frozen importlib._bootstrap_external>", line 1147, in find_spec        
   File "<frozen importlib._bootstrap_external>", line 1121, in _get_spec        
   File "<frozen importlib._bootstrap_external>", line 1260, in find_spec        
   File "<frozen importlib._bootstrap_external>", line 1221, in _get_spec        
   File "<frozen importlib._bootstrap_external>", line 551, in spec_from_file_location
 RecursionError: maximum recursion depth exceeded               

Updating the library gives me very similar errors and doesn't solve the problem, so I'm a bit stuck right now.

The #191 might be related. I tried repeating the process of "migrating" to be sure this wasn't a Ctrl+C when updating originated problem. The issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant