cherrymusic icon indicating copy to clipboard operation
cherrymusic copied to clipboard

Bug error in CMD from cherry music

Open tylerhoot opened this issue 8 years ago • 16 comments

[170119-23:47] ERROR   : [19/Jan/2017:23:47:30] HTTP Traceback (most recent call last):
  File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrypy\_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrypy\lib\encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrypy\_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrymusicserver\httphandler.py", line 290, in api
    handler_args = json.loads(kwargs['data'])
  File "C:\Program Files\Python36\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files\Python36\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files\Python36\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 1 column 19 (char 18)

tylerhoot avatar Jan 20 '17 04:01 tylerhoot

What were you trying to do when this happened? It'd be useful to know what exactly the server was trying to decode and why.

tilboerner avatar Jan 20 '17 17:01 tilboerner

i was just playing a mp3 but this is after a fresh reinstall of cherry music and reinstalling my server the only thing that i forgot to reinstall was ffmpeg. could that be what its complaining about?

tylerhoot avatar Jan 20 '17 19:01 tylerhoot

What's happening is that the CherryMusic server cannot deserialize a request sent to it from the frontend (the part of CherryMusic that's in your browser). So very likely the frontend is sending malformed request data. ffmpeg doesn't even begin to enter the equation at this point; also, playing a file does not touch this particular code, so it must be something else.

I'm thinking there might be something peculiar about the name of a file or folder that CherryMusic isn't handling well, or somehow a Windows path separator (\) is not being escaped properly.

Does this happen all the time, or just when you're interacting with certain files or directories? Is anything not working in the frontend? What's the output in the server console immediately after the error message you posted? There should be something there that looks kind of like this:

[170122-15:52] 127.0.0.1 - - [22/Jan/2017:15:52:39] "POST /api/somethingsomething HTTP/1.1" 500 805 "http://localhost:8080/" "Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0"

tilboerner avatar Jan 22 '17 15:01 tilboerner

[23/Jan/2017:21:31:26] "POST /api/heartbeat HTTP/1.1" 200 14 "http://192.168.1.2:8070/" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0"

is the os but also is there a reason why i cannot see flac files i have the static ffmpeg added in the path but still it cannot see flac files is there a option that i have to change to find them?

tylerhoot avatar Jan 24 '17 02:01 tylerhoot

still it cannot see flac files

You can start cherrymusic with the --info switch to see which formats it can play with your setup. CherryMusic does not use ffmpeg to transcode flac, but looks for a flac executable to do so. I'm not sure why - maybe we couldn't or can't rely on all ffmpegs to work with flac. Your best option here is to install the flac encoder/decoder. If that doesn't work for you, feel free to open another issue about it.

"POST /api/heartbeat HTTP/1.1" 200

The 200 there means that the server processed the request just fine; we're looking for a line with a 500 response. I guess several requests got logged simultaneously. Could you find the next line with a 500 instead? Or you could send me the whole log to [email protected]. Sorry, I should have been clearer to begin with!

Also, could you please answer the other questions at the end of my last post? I'm still very much in the dark about what exactly is going on.

tilboerner avatar Jan 30 '17 21:01 tilboerner

i found a error file in the roming while i was going to go and rebuild my cherry music install due to flac and not being able to play back any music file also below is what i got when i run cherrymusic --info and even after the rebuild i still cannot playback any music

error-1-30-17.txt

C:\Users\Administrator\Desktop\cherrymusic-devel>python cherrymusic --info CherryMusic Server 0.39.1

CherryPy: 3.2.2 Python: CPython 3.6.0 Platform: Windows-10-10.0.14393-SP0

configuration dir: C:\Users\Administrator\AppData\Roaming\cherrymusic server data dir: C:\Users\Administrator\AppData\Roaming\cherrymusic static resources dir: C:\Users\Administrator\Desktop\cherrymusic-devel
server package dir: C:\Users\Administrator\Desktop\cherrymusic-devel\cherrymusicserver process working dir: C:\Users\Administrator\Desktop\cherrymusic-devel

locale: (None, None), default: ('en_US', 'cp1252') filesystem encoding: utf-8

Available Decoders: mp3 (ffmpeg) wma (ffmpeg) ogg (ffmpeg) oga (ffmpeg) flac (flac) m4a (ffmpeg) Available Encoders: flac (flac)

(Do not parse this output.)

tylerhoot avatar Jan 30 '17 23:01 tylerhoot

I think you finally let slip what your problem is. :grin: So you cannot play any music? You mean, no music at all? Can you at least see the files in CherryMusic in your browser? For example, when you click browse files in the top bar, do you see the contents of your music folder?

tilboerner avatar Jan 31 '17 00:01 tilboerner

this issue is new acculy i was able to play music before touching flac then once i added that all these issues came out... and yes i can see all my music directories and i can even add the music to the playlist to be played.

tylerhoot avatar Jan 31 '17 00:01 tylerhoot

But you cannot play any Music? No flac, no mp3, no ogg? Was that the original problem, or what was?

Please answer the questions, otherwise it's really hard to help you. We're several comments in, and I'm still trying to diagnose what's going on from a little trickle of information you're giving me.

tilboerner avatar Jan 31 '17 10:01 tilboerner

my apogees @tilboerner the mp3 not being able to play issue resolved it self i can play mp3's but not FLAC files and FLAC is installed. i have the added a varable in the path in the sytem to point to the flac 64bit folder.

i just was playing a mp3 and a caught a error this time in the cmd line "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0" [170131-15:47] ERROR : [31/Jan/2017:15:47:45] HTTP Traceback (most recent call last): File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrypy_cprequest.py", line 656, in respond response.body = self.handler() File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrypy\lib\encoding.py", line 188, in call self.body = self.oldhandler(*args, **kwargs) File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrypy_cpdispatch.py", line 34, in call return self.callable(*self.args, **self.kwargs) File "C:\Users\Administrator\Desktop\cherrymusic-devel\cherrymusicserver\httphandler.py", line 290, in api handler_args = json.loads(kwargs['data']) File "C:\Program Files\Python36\lib\json_init_.py", line 354, in loads return _default_decoder.decode(s) File "C:\Program Files\Python36\lib\json\decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Program Files\Python36\lib\json\decoder.py", line 355, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 1 column 20 (char 19)

tylerhoot avatar Jan 31 '17 20:01 tylerhoot

Ok. Let's assume for the moment that this error message is not connected to the playing of an mp3 file (because it very likely isn't, as I said above), but to the flac problem. Could you please do the following:

  • Make sure CherryMusic is not running and delete the error.log file in your CherryMusic AppData folder.
  • Do a fresh start of the CherryMusic server.
  • Open a new tab in Firefox for CherryMusic. In that tab, press Ctrl + Shift + K to bring up the web console.
  • In the CherryMusic tab, navigate to a flac file and play it (even if it won't).
  • Now copy all the text in the web console, and paste it here.
  • Also, copy all output from the server window and paste it here. If there's no server window, let me know and paste the content of error.log instead.
  • Finally, please include the file name and path of the flac file you tried to play.

That might get us somewhere. Instead of pasting / posting everything here, you can also email it to me at [email protected].

tilboerner avatar Feb 12 '17 22:02 tilboerner

email being sent sorry about the delay @tilboerner

tylerhoot avatar Feb 18 '17 20:02 tylerhoot

Hey @tylerhoot, thanks for the extensive log output. :)

flac

So, the .flac files don't work because there's no proper encoder installed. The flac tool can get the audio out of these files, but for Firefox to be able to play them, they need to be turned (=transcoded) into mp3 or ogg. For mp3, you need to get lame.exe (probably including lame_enc.dll); ogg needs oggenc.exe. I only found a link to oggenc2.exe, which might work if you rename it to remove the 2.

I can't vouch for these downloads, please make sure they're safe!

Put the executable in your PATH so cherrymusic can find it. That should enable flac transcoding. I've never tried it on Windows myself, but I've never heard of problems, either.

JSONDecodeError

That one didn't happen in the logs you sent me. My guess is that it triggers when you access a file or folder in CherryMusic that has a problematic name, with probably either the listdir or getsonginfo API call. Since you didn't talk about problems opening a folder, it's probably just a getsonginfo that fails. Do you get any error getting song metainfo notifications in the browser? Do you notice anything else that seems broken?

If yes, the next time you see one, of if you see the error from your original post again, please send me (or post) all the output from the server console once more. It would also be extremely useful to know the name of the folder (and all its files) that you had open in CherryMusic when the error happened.

tilboerner avatar Feb 20 '17 23:02 tilboerner

that got it thank you for all your help @tilboerner i really appreciate it.

tylerhoot avatar Feb 22 '17 20:02 tylerhoot

The original bug isn't fixed. I'm quoting myself:

If yes, the next time you see one, of if you see the error from your original post again, please send me (or post) all the output from the server console once more. It would also be extremely useful to know the name of the folder (and all its files) that you had open in CherryMusic when the error happened.

tilboerner avatar Feb 23 '17 12:02 tilboerner

will do once again sorry about the delay

tylerhoot avatar Mar 08 '17 20:03 tylerhoot