Unable to work with the ListenBrainz server locally

Hey, I was working with the ListenBrainz server locally, but I’m unable to create a playlist as I’m continuously getting a 401 for Invalid Token Header. I assume it’s because it can’t find my user in the DB. What can I do to fix this?

Hello!

I see that you’ve managed to log in, which leads me to assume that you’ve correctly setup your ListenBrainz instance with a MusicBrainz app, yes?

Which user token are you using? You cannot use the token in the production system because the token on your own system will be different. You’ll have to use the user token from your own web instance if you plan to submit items via its API.

Can you paste the error you’re getting? Is it via the web or the API?

Hi Rob!

Thanks for replying. I noticed there’s a SECRET_KEY = "CHANGE_ME" in the config.py file. What should this be changed to? Is this the reason the API isn’t working?

Also to answer your query, I think it’s an API error. Specifically, in the valid_auth_header function which is raising a 401.

Let me know if you need any more information regarding this.

The SECRET_KEY isn’t imporant in this context. Earlier today Monkey posted in the IRC channel that you should check whether your local setup is using the locally running API endpoints of the production one. In listenbrainz/config.py file search for API_URL and make sure it is set to `http://localhost:8100.

Try that.

@rob, thank you so much, this resolved my issue!

1 Like