[GH-ISSUE #296] error 400 on /api/data after update to v2.2.0 #214

Closed
opened 2026-02-26 02:32:28 +03:00 by kerem · 16 comments
Owner

Originally created by @BenGamma on GitHub (Apr 11, 2016).
Original GitHub issue: https://github.com/koel/koel/issues/296

Hi,

After updated to v2.2.0, I get a 400 error on mykoelserver.com/api/data when accessing the website root.
When trying the url by itself mykoelserver.com/api/data I get {"error":"token_not_provided"}
Any idea on what is going wrong here ?

Thanks !

Originally created by @BenGamma on GitHub (Apr 11, 2016). Original GitHub issue: https://github.com/koel/koel/issues/296 Hi, After updated to v2.2.0, I get a 400 error on mykoelserver.com/api/data when accessing the website root. When trying the url by itself mykoelserver.com/api/data I get `{"error":"token_not_provided"}` Any idea on what is going wrong here ? Thanks !
kerem closed this issue 2026-02-26 02:32:28 +03:00
Author
Owner

@BernardGoldberger commented on GitHub (Apr 11, 2016):

I'm not sure if I'm having the same issue but I have a very similar issue, when I load mykoelserver.com I receive Failed to load resource: the server responded with a status of 401 {"error":"token_not_provided"} (was still working fine for me on 2.2.0) but I noticed that if I immediately reload the page that it will load.

For me the issue began happening after I increased my music library from 10K songs to 30K.

<!-- gh-comment-id:208459003 --> @BernardGoldberger commented on GitHub (Apr 11, 2016): I'm not sure if I'm having the same issue but I have a very similar issue, when I load mykoelserver.com I receive `Failed to load resource: the server responded with a status of 401` `{"error":"token_not_provided"}` (was still working fine for me on 2.2.0) but I noticed that **if I immediately reload the page that it will load**. For me the issue began happening after I increased my music library from 10K songs to 30K.
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

You can't directly access api/data without a token.

<!-- gh-comment-id:208648006 --> @phanan commented on GitHub (Apr 12, 2016): You can't directly access api/data without a token.
Author
Owner

@BernardGoldberger commented on GitHub (Apr 12, 2016):

I just reduced my music library and all is good which means that the issues I'm experiencing is definitely related to large libraries.

I will wait till to hear back from @BenGamma and if he is having unrelated issues I will open a separate ticket and include some screenshots.

<!-- gh-comment-id:208665151 --> @BernardGoldberger commented on GitHub (Apr 12, 2016): I just reduced my music library and all is good which means that the issues I'm experiencing is definitely related to large libraries. I will wait till to hear back from @BenGamma and if he is having unrelated issues I will open a separate ticket and include some screenshots.
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

That would be very weird…

<!-- gh-comment-id:208677047 --> @phanan commented on GitHub (Apr 12, 2016): That would be very weird…
Author
Owner

@BenGamma commented on GitHub (Apr 12, 2016):

I don't think it is related to music library size. I have less than 2K songs.

In my opinion, the token I need to access the api hasn't been generated.

How is this token generated ?

<!-- gh-comment-id:208795488 --> @BenGamma commented on GitHub (Apr 12, 2016): I don't think it is related to music library size. I have less than 2K songs. In my opinion, the token I need to access the api hasn't been generated. How is this token generated ?
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

Token is generated when you log in, and is saved in persistent storage for
all future requests.

On Tue, Apr 12, 2016 at 4:48 PM, Benjamin Gammaire <notifications@github.com

wrote:

I don't think it is related to music library size. I have less than 2K
songs.

In my opinion, the token I need to access the api hasn't been generated.

How is this token generated ?


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/phanan/koel/issues/296#issuecomment-208795488

<!-- gh-comment-id:208839309 --> @phanan commented on GitHub (Apr 12, 2016): Token is generated when you log in, and is saved in persistent storage for all future requests. On Tue, Apr 12, 2016 at 4:48 PM, Benjamin Gammaire <notifications@github.com > wrote: > > I don't think it is related to music library size. I have less than 2K > songs. > > In my opinion, the token I need to access the api hasn't been generated. > > How is this token generated ? > > — > You are receiving this because you commented. > Reply to this email directly or view it on GitHub > https://github.com/phanan/koel/issues/296#issuecomment-208795488
Author
Owner

@BenGamma commented on GitHub (Apr 12, 2016):

Can I generate it by hand using a command in terminal ? Because I can't access the login anymore

<!-- gh-comment-id:208841905 --> @BenGamma commented on GitHub (Apr 12, 2016): Can I generate it by hand using a command in terminal ? Because I can't access the login anymore
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

You can clear the local storage using Chrome Dev Tool:

[image: Inline image 1]

On Tue, Apr 12, 2016 at 6:45 PM, Benjamin Gammaire <notifications@github.com

wrote:

Can I generate it by hand using a command in terminal ? Because I can't
access the login anymore


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/phanan/koel/issues/296#issuecomment-208841905

<!-- gh-comment-id:208843930 --> @phanan commented on GitHub (Apr 12, 2016): You can clear the local storage using Chrome Dev Tool: [image: Inline image 1] On Tue, Apr 12, 2016 at 6:45 PM, Benjamin Gammaire <notifications@github.com > wrote: > > Can I generate it by hand using a command in terminal ? Because I can't > access the login anymore > > — > You are receiving this because you commented. > Reply to this email directly or view it on GitHub > https://github.com/phanan/koel/issues/296#issuecomment-208841905
Author
Owner

@BenGamma commented on GitHub (Apr 12, 2016):

My local storage is clean. You mean that token is saved in local storage ?

I also have this error in the console. Can it be related to "token_not_provided" ?
capture d ecran 2016-04-12 a 13 03 29

<!-- gh-comment-id:208849060 --> @BenGamma commented on GitHub (Apr 12, 2016): My local storage is clean. You mean that token is saved in local storage ? I also have this error in the console. Can it be related to "token_not_provided" ? <img width="1436" alt="capture d ecran 2016-04-12 a 13 03 29" src="https://cloud.githubusercontent.com/assets/4993215/14458053/0f100684-00af-11e6-8afe-965e3bf3b539.png">
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

Token is saved in local storage, yes. For example this is mine:

[image: Inline image 1]

That error should be normal if it's triggered from the log in page.

On Tue, Apr 12, 2016 at 7:05 PM, Benjamin Gammaire <notifications@github.com

wrote:

My local storage is clean. You mean that token is saved in local storage ?

I also have this error in the console. Can it be related to
"token_not_provided" ?
[image: capture d ecran 2016-04-12 a 13 03 29]
https://cloud.githubusercontent.com/assets/4993215/14458053/0f100684-00af-11e6-8afe-965e3bf3b539.png


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
https://github.com/phanan/koel/issues/296#issuecomment-208849060

<!-- gh-comment-id:208849627 --> @phanan commented on GitHub (Apr 12, 2016): Token is saved in local storage, yes. For example this is mine: [image: Inline image 1] That error should be normal if it's triggered from the log in page. On Tue, Apr 12, 2016 at 7:05 PM, Benjamin Gammaire <notifications@github.com > wrote: > > My local storage is clean. You mean that token is saved in local storage ? > > I also have this error in the console. Can it be related to > "token_not_provided" ? > [image: capture d ecran 2016-04-12 a 13 03 29] > https://cloud.githubusercontent.com/assets/4993215/14458053/0f100684-00af-11e6-8afe-965e3bf3b539.png > > — > You are receiving this because you commented. > Reply to this email directly or view it on GitHub > https://github.com/phanan/koel/issues/296#issuecomment-208849060
Author
Owner

@BenGamma commented on GitHub (Apr 12, 2016):

I can't see your image 😞

I think to solution to my problem is to generate a token, but how to do this without accessing the login page ?

<!-- gh-comment-id:208854188 --> @BenGamma commented on GitHub (Apr 12, 2016): I can't see your image :disappointed: I think to solution to my problem is to generate a token, but how to do this without accessing the login page ?
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

image

You can't really generate (and use) a token without logging in.

<!-- gh-comment-id:208889091 --> @phanan commented on GitHub (Apr 12, 2016): ![image](https://cloud.githubusercontent.com/assets/8056274/14460433/0f007a16-00f0-11e6-8794-f0a30140d1c3.png) You can't really generate (and use) a token without logging in.
Author
Owner

@BenGamma commented on GitHub (Apr 12, 2016):

So from where can this issue comes from ? what do you recommend ?

<!-- gh-comment-id:208915399 --> @BenGamma commented on GitHub (Apr 12, 2016): So from where can this issue comes from ? what do you recommend ?
Author
Owner

@phanan commented on GitHub (Apr 12, 2016):

I'd suggest a clean reinstall. Sorry, I can't deduct anything from the provided information.

<!-- gh-comment-id:208935045 --> @phanan commented on GitHub (Apr 12, 2016): I'd suggest a clean reinstall. Sorry, I can't deduct anything from the provided information.
Author
Owner

@BenGamma commented on GitHub (Apr 12, 2016):

Alright, thanks anyway :)

<!-- gh-comment-id:208955913 --> @BenGamma commented on GitHub (Apr 12, 2016): Alright, thanks anyway :)
Author
Owner

@phanan commented on GitHub (Apr 13, 2016):

Sorry I can't help further :(

<!-- gh-comment-id:209245271 --> @phanan commented on GitHub (Apr 13, 2016): Sorry I can't help further :(
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#214
No description provided.