devsnd / cherrymusic

Stream your own music collection to all your devices! The easy to use free and open-source music streaming server.
http://www.fomori.org/cherrymusic
GNU General Public License v3.0
1.03k stars 189 forks source link

Bug error in CMD from cherry music #651

Open tylerhoot opened 7 years ago

tylerhoot commented 7 years ago
[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)
tilboerner commented 7 years ago

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.

tylerhoot commented 7 years ago

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?

tilboerner commented 7 years ago

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"
tylerhoot commented 7 years ago

[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?

tilboerner commented 7 years ago

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 tilman.boerner@gmx.net. 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.

tylerhoot commented 7 years ago

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.)

tilboerner commented 7 years ago

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?

tylerhoot commented 7 years ago

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.

tilboerner commented 7 years ago

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.

tylerhoot commented 7 years ago

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)

tilboerner commented 7 years ago

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:

That might get us somewhere. Instead of pasting / posting everything here, you can also email it to me at tilman.boerner@gmx.net.

tylerhoot commented 7 years ago

email being sent sorry about the delay @tilboerner

tilboerner commented 7 years ago

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.

tylerhoot commented 7 years ago

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

tilboerner commented 7 years ago

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.

tylerhoot commented 7 years ago

will do once again sorry about the delay