Code generation failed Code generation failed due to an unknown reason. Try again in a few minutes

Describe the problem/error/question

Getting this all of a sudden when using the Code node. I recently upgraded to 1.64.3.

" Code generation failed

Code generation failed due to an unknown reason. Try again in a few minutes."

What is the error message (if any)?

" Code generation failed

Code generation failed due to an unknown reason. Try again in a few minutes."

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.64.3
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system:

Hey @ManOnFire1978 , I have not encountered such an issue when trying AI code generation in my workspace on 1.64.3.

Here’s a workflow I used with the instruction “count unique users where user is composed of firstname and lastname”.

Make sure the previous node has data in the output connected to the Code’s input.

Perhaps AI could not understand your instructions.

So I turned on debug mode in Chrome, went to console and saw this -

“message”: “Something went wrong: This model’s maximum context length is 8192 tokens. However, your messages resulted in 8796 tokens. Please reduce the length of the messages.”

So I need to work to reduce the amount of items in the input for it work again.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.