UnderMybrella / EternalJukebox

The internal workings for the Eternal Jukebox, a rehosting of the Infinite Jukebox
https://eternalbox.dev
MIT License
792 stars 149 forks source link

Can't load songs using own server setup #12

Closed EvaisaDev closed 7 years ago

EvaisaDev commented 7 years ago

Okay i might be really stupid or something but i am trying to run this from source after building it and i am getting this error in the console when trying to load a song.

SEVERE: Unexpected exception in route java.lang.IllegalStateException: context.bodyAsString must not be null at org.abimon.eternalJukebox.EternalJukeboxKt.shrink(EternalJukebox.kt:544) at org.abimon.eternalJukebox.EternalJukeboxKt$main$21$1.invoke(EternalJukebox.kt:313) at org.abimon.eternalJukebox.EternalJukeboxKt$main$21$1.invoke(EternalJukebox.kt) at org.abimon.eternalJukebox.EternalJukeboxKt$sam$Handler$29eb28fa.handle(EternalJukebox.kt) at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48) at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271) at io.vertx.core.impl.TaskQueue.lambda$new$0(TaskQueue.java:60) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)

along with all this https://pastebin.com/Dd4ZFbc1

Is there any guide on how to set it up correctly? Thanks <3

UnderMybrella commented 7 years ago

Not quite yet, it's planned soon, however that issue isn't actually your fault (probably, at least).

Basically, Spotify is complaining about the authentication token it's been passed. Make sure that you're providing a correct client ID + secret key, and try restarting. I had a similar error and just restarting fixed it. My error handling isn't great so far, although that's being worked on.

EvaisaDev commented 7 years ago

Hmm pretty sure it's correct but could it be that i just have my files lying in the wrong folders? or that the config isn't put together correctly because the client id and key should be correct The search works fine too but i don't know if that actually uses them

(I basically just threw all the files in different folders untill it worked xD and looked in the kt file to figure out what to put in the config because it wasn't in the default one the client id and stuff)

Also wow fast reply thanks

UnderMybrella commented 7 years ago

Yeah, sorry about the lack of documentation for everything, I wasn't really expecting anyone to try running their own server but here we are. I'll be sure to do what I can to put something together.

As for your config file and setup, would you mind copying your config into something like Pastebin/Hastebin, obviously copying out your secret key/anything else that's confidential, and I'll have a look? Similar thing with your folder layout.

EvaisaDev commented 7 years ago

Well i mean i am always up for a challenge xD Running something without documentation is a good puzzle lol Basically i just like looking through code how something works and running it on my own server

Anyway here is my config: https://ghostbin.com/paste/g9mx6

And i put my files on github so you can see what a mess i made.. (be prepared lol) https://github.com/EvaisaGiac/EternalJukebox

I don't know if you have time maybe but could you help me with the file structure?

UnderMybrella commented 7 years ago

Everything actually looks to be alright (unless I'm missing something relatively obvious). I brought this up before, but have you tried restarting? It's possible that the Spotify token has somehow gotten invalidated somewhere, and I don't pick up on it. Always worth a shot.

EvaisaDev commented 7 years ago

Yeah i have, i also tried running on both windows and linux, i can try generating a new spotify key maybe

UnderMybrella commented 7 years ago

Hrm, that's really weird. Try that, see what happens? I'm not too sure, sorry

EvaisaDev commented 7 years ago

This is all that comes up on windows now and it gets stuck on loading track Do you know of a way i can check if it actually gets the valid token? then again i don't know if this particular error has to do with that

Jun 03, 2017 4:45:22 PM io.vertx.ext.web.impl.RoutingContextImplBase SEVERE: Unexpected exception in route java.lang.IllegalStateException: context.bodyAsString must not be null at org.abimon.eternalJukebox.EternalJukeboxKt.shrink(EternalJukebox.kt:544) at org.abimon.eternalJukebox.EternalJukeboxKt$main$21$1.invoke(EternalJukebox.kt:313) at org.abimon.eternalJukebox.EternalJukeboxKt$main$21$1.invoke(EternalJukebox.kt) at org.abimon.eternalJukebox.EternalJukeboxKt$sam$Handler$29eb28fa.handle(EternalJukebox.kt) at io.vertx.ext.web.impl.BlockingHandlerDecorator.lambda$handle$0(BlockingHandlerDecorator.java:48) at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:271) at io.vertx.core.impl.TaskQueue.lambda$new$0(TaskQueue.java:60) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

UnderMybrella commented 7 years ago

Don't know, but I do know why that error is happening at least. If you add a "uploads" key to your config file and set it to true, that error at least should go away. Might fix the other one too?

EvaisaDev commented 7 years ago

Yeah it fixed that error thanks, now the spotify one only remains which just confuses me at this point because i also regenerated the key so it really can't be that

https://ghostbin.com/paste/nks8y

EvaisaDev commented 7 years ago

I don't miss anything else in the config?

UnderMybrella commented 7 years ago

You certainly shouldn't be, that's really bizarre.

If you can wait a day or so, I'll push something that should help out in that regard? Until then, I'm not sure what else can be done

EvaisaDev commented 7 years ago

Alright, thanks anyway

EvaisaDev commented 7 years ago

Okay i am still messing around with it trying to get something to work and after rebuilding it on windows it doesn't give that error anymore, however it still gets stuck on loading track but the only errors i get are in the chrome console and not in the terminal Might still be because of the same cause just for some reason it doesnt come up in the console? http://imgur.com/a/ekpfV

I'm sorry i should probably stop worrying about it for now

UnderMybrella commented 7 years ago

Could you try downloading a prebuilt jar from here? Run that with your config file and the other files and see what you get.

EvaisaDev commented 7 years ago

Hmm can you tell me what files i put with it and stuff where? i kind of want to figure out this mess of folders

UnderMybrella commented 7 years ago

Your setup should look just like this repo has the files:

EvaisaDev commented 7 years ago

How am i supposed to run it? I didn't have that jar in my previous setup at all, if i try to run it from a bat file or console i get this error

Exception in thread "main" java.lang.IllegalArgumentException: Path must start with / at io.vertx.ext.web.impl.RouteImpl.checkPath(RouteImpl.java:402) at io.vertx.ext.web.impl.RouteImpl.<init>(RouteImpl.java:67) at io.vertx.ext.web.impl.RouterImpl.route(RouterImpl.java:89) at io.vertx.ext.web.impl.RouterImpl.get(RouterImpl.java:114) at org.abimon.eternalJukebox.API$setup$20.accept(API.kt:661) at org.abimon.eternalJukebox.API$setup$20.accept(API.kt:40) at java.util.HashMap.forEach(Unknown Source) at org.abimon.eternalJukebox.API.setup(API.kt:661) at org.abimon.eternalJukebox.EternalJukeboxKt.main(EternalJukebox.kt:182)

EvaisaDev commented 7 years ago

The original bat doesn't run it at all, might be doing it wrong though

UnderMybrella commented 7 years ago

What bat file are you using? To run it you'd want to execute java -jar EternalJukebox.jar in a console in the home directory.

As for that error, mistake on my part, try downloading the update here

EvaisaDev commented 7 years ago

yeah i did exactly that lol thanks i'll see

UnderMybrella commented 7 years ago

And no luck, even with the update?

EvaisaDev commented 7 years ago

no i didn't try yet sorry, give me a minute

UnderMybrella commented 7 years ago

Alright, take your time, it's cool!

EvaisaDev commented 7 years ago

http://imgur.com/a/ZBSXx

It runs now but basically the same problem, first track i tried i got the same as last time (no error in the console) And second one i think was also the same but gave a different result and also no console error

UnderMybrella commented 7 years ago

Right, sorry the other thing you'll need to do is update your files (like jukebox_go.html, jukebox_index.html) to the most recent ones, since the endpoints moved. Sorry

EvaisaDev commented 7 years ago

I got the files off the git just now though? not using old ones

UnderMybrella commented 7 years ago

That's really weird, if you got the most recent ones you shouldn't be getting those 404s, that's really weird.

Could you open your local jukebox_go.html and search for "api/id"? If it's the old file it should pop up, but the new one won't have it

EvaisaDev commented 7 years ago

can't find anything

EvaisaDev commented 7 years ago

The google console error gets a little different with every different songs aswell it seems.. ehh http://imgur.com/a/GjpvW

UnderMybrella commented 7 years ago

Could you send the errors through? One of the things I tried to do was to differentiate between errors for debugging

EvaisaDev commented 7 years ago

i edited my last message ^ there are no errors at all in the cmd console only in chrome

EvaisaDev commented 7 years ago

Atleast i am guessing this is supposed to popup in the console because it is all that pops up type=jukebox&id=05KfyCEE6otdlT1pp2VIjP type=jukebox&id=1lgN0A2Vki2FTON5PYq42m

EvaisaDev commented 7 years ago

It doesnt load favourites anymore either

GET http://localhost:11037/api/popular_jukebox?count=12 404 (Not Found)

EvaisaDev commented 7 years ago

i'm sorry i feel like i am breaking everything aahh Full favourites error tree: http://imgur.com/a/Y2Q01

UnderMybrella commented 7 years ago

That console output is unintended but not unusual, I do need to take that out.

Do you have youtube-dl installed? If not, that would explain the 404 on /api/songs

That's quite possibly the jukebox_go file being cached? It's the old endpoint again

EvaisaDev commented 7 years ago

let me remove cache

EvaisaDev commented 7 years ago

That fixed favourites yes sorry about that!

EvaisaDev commented 7 years ago

Where do i get youtube-dl from?

UnderMybrella commented 7 years ago

https://github.com/rg3/youtube-dl/blob/master/README.md#installation

EvaisaDev commented 7 years ago

I installed it now but still get the same error, some extra stuff does pop up in the console though type=jukebox&id=05KfyCEE6otdlT1pp2VIjP [Default Song For ID] Non 200 code for song for 05KfyCEE6otdlT1pp2VIjP; iteration 0 [Default Song For ID] Non 200 code for song for 05KfyCEE6otdlT1pp2VIjP; iteration 1 [Default Song For ID] Non 200 code for song for 05KfyCEE6otdlT1pp2VIjP; iteration 2

EvaisaDev commented 7 years ago

http://imgur.com/a/Gkxgw I'm sorry for giving you extra work

UnderMybrella commented 7 years ago

Non 200 is something, and it looks like I wasn't smart enough to put more debugging info there. Considering the song ID is valid, it sounds like Spotify may be erroring again; if you request a different song does the same thing happen? In particular, does it get to the point of loading the song endpoint?

EvaisaDev commented 7 years ago

Some songs get no console output and nothing in the chrome console either at all and get stuck on loading tracks. Some have the loading tracks text disappear completely and give that last thing in the console plus the error in the chrome console or only a error in the chrome console and nothing in the normal one And two songs i have tried completely crashed it and the website just went down

EvaisaDev commented 7 years ago

It probably all has the same cause but the effects are slightly different per song it seems which is weird

EvaisaDev commented 7 years ago

I can give you a link to it if you want to see for yourself Also one beetles song in particular made it semi crash and now gives me this cool error in the search page http://imgur.com/a/9hfLo

UnderMybrella commented 7 years ago

What two songs completely crashed it? That shouldn't happen so I'm curious about that. And that's really odd that it's different per song

EvaisaDev commented 7 years ago

Do you have skype or discord? might be a little easier

UnderMybrella commented 7 years ago

Yep, if you wanted to jump in the Eternal Jukebox Discord there's a link here, or if you just wanted to add me I'm UnderMybrella#4076

EvaisaDev commented 7 years ago

you blocked friend requests ^