Skip to content

Token Validation Failed Error #224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomik520i opened this issue Jan 20, 2025 · 3 comments
Closed

Token Validation Failed Error #224

tomik520i opened this issue Jan 20, 2025 · 3 comments

Comments

@tomik520i
Copy link

Starting today, I encountered the following error when generating audio responses:

Error generating custom audio: {"detail":"Token validation failed."}
This issue was not present yesterday, and everything worked as expected.

What I Tried
Re-entered new cookies, but the issue persists.
Noticed that the cookies no longer follow the naming convention described in the guide. Specifically, I observed that the cookie name client?_clerk_js_version now appears different, as shown in the screenshot below.
Observations
It seems there might have been an internal change to the naming convention or structure of the cookies.
If this is a result of a recent update, could it be causing token validation issues? Or is this possibly an easy-to-fix issue on my end that I might be overlooking?
Steps to Reproduce
Generate a request with the payload shown below:

{
  "prompt": "Vygeneruj mi píseň, žánru dechovka, se slovy: na tom pražským mostě fouká vítr sprostě",
  "isCustom": false,
  "make_instrumental": false,
  "wait_audio": false,
  "payload": {
    "make_instrumental": false,
    "mv": "chirp-v3-5",
    "prompt": "",
    "generation_type": "TEXT",
    "gpt_description_prompt": "Vygeneruj mi píseň, žánru dechovka, se slovy: na tom pražským mostě fouká vítr sprostě"
  }
}

Observe the token validation error in the console output.
Environment
Next.js version: 14.1.4
Localhost: http://localhost:3000
Node.js environment with .env configured.
Screenshot
(Attached for reference showing the cookie structure)

Console Output
json
Zkopírovat
Upravit
Error generating custom audio: {"detail":"Token validation failed."}
Questions
Was there a recent internal update affecting the token validation process or the naming conventions for cookies?
Is there a workaround or fix for this issue?
Could this issue be caused by a misconfiguration on my end?
Thank you for your assistance in resolving this!

I also want to mention that accessing the following endpoints works perfectly fine:

http://localhost:3000/api/get_limit
http://localhost:3000/api/get

This indicates that the login or authentication process itself seems to be working without any issues. The problem appears to be isolated to the token validation during the audio generation process.

`> next dev

   ▲ Next.js 14.1.4
   - Local:        http://localhost:3000
   - Environments: .env

'pnpm' is not recognized as an internal or external command,
operable program or batch file.
 ✓ Ready in 2s
 ○ Compiling /api/generate ...
 ✓ Compiled /api/generate in 637ms (213 modules)
{"level":30,"time":1737370222702,"pid":33728,"hostname":"tomik","msg":"KeepAlive...\n"}
{"level":30,"time":1737370223031,"pid":33728,"hostname":"tomik","msg":"KeepAlive...\n"}
{"level":30,"time":1737370223031,"pid":33728,"hostname":"tomik","msg":"Generate Response:\n{}"}
{"level":30,"time":1737370223031,"pid":33728,"hostname":"tomik","msg":"Cost time: 0"}
{"level":30,"time":1737370223280,"pid":33728,"hostname":"tomik","msg":"KeepAlive...\n"}
{"level":30,"time":1737370223280,"pid":33728,"hostname":"tomik","msg":"generateSongs payload:\n{\n  \"prompt\": \"Vygeneruj mi p├şse┼ł, ┼ż├ínru dechovka, se slovy: na tom pra┼żsk├Żm most─Ť fouk├í v├ştr sprost─Ť\",\n  \"isCustom\": false,\n  \"make_instrumental\": false,\n  \"wait_audio\": false,\n  \"payload\": {\n    \"make_instrumental\": false,\n    \"mv\": \"chirp-v3-5\",\n    \"prompt\": \"\",\n    \"generation_type\": \"TEXT\",\n    \"gpt_description_prompt\": \"Vygeneruj mi p├şse┼ł, ┼ż├ínru dechovka, se slovy: na tom pra┼żsk├Żm most─Ť fouk├í v├ştr sprost─Ť\"\n  }\n}"}
Error generating custom audio: {"detail":"Token validation failed."}
{"level":30,"time":1737370260219,"pid":33728,"hostname":"tomik","msg":"KeepAlive...\n"}
{"level":30,"time":1737370260219,"pid":33728,"hostname":"tomik","msg":"Generate Response:\n{}"}
{"level":30,"time":1737370260219,"pid":33728,"hostname":"tomik","msg":"Cost time: 0"}
{"level":30,"time":1737370260442,"pid":33728,"hostname":"tomik","msg":"KeepAlive...\n"}
{"level":30,"time":1737370260443,"pid":33728,"hostname":"tomik","msg":"generateSongs payload:\n{\n  \"prompt\": \"Vygeneruj mi p├şse┼ł, ┼ż├ínru dechovka, se slovy: na tom pra┼żsk├Żm most─Ť fouk├í v├ştr sprost─Ť\",\n  \"isCustom\": false,\n  \"make_instrumental\": false,\n  \"wait_audio\": false,\n  \"payload\": {\n    \"make_instrumental\": false,\n    \"mv\": \"chirp-v3-5\",\n    \"prompt\": \"\",\n    \"generation_type\": \"TEXT\",\n    \"gpt_description_prompt\": \"Vygeneruj mi p├şse┼ł, ┼ż├ínru dechovka, se slovy: na tom pra┼żsk├Żm most─Ť fouk├í v├ştr sprost─Ť\"\n  }\n}"}
Error generating custom audio: {"detail":"Token validation failed."}`

Image

@gohoski
Copy link
Contributor

gohoski commented Jan 20, 2025

Please use the version from my PR #222 , it's the only one working right now

@tomik520i
Copy link
Author

I found this approach mentioned in #222 , and I decided to give it a try. Surprisingly, it worked!

Although it feels a bit uncertain, for now, it seems to resolve the issue. I'll keep an eye on it to see if it remains stable or if any other issues arise.

Thanks to the author of the PR for the workaround! 🙌

@gcui-art gcui-art deleted a comment Jan 27, 2025
@gohoski
Copy link
Contributor

gohoski commented Jan 29, 2025

The PR has been merged and this should be fixed now. Please close this issue as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants