Facing "Couldn't connect with these settings" error for Google Gemini and Groq nodes in self-hosted n8n 1.84.1, despite valid API keys and network access

I’m running n8n 1.84.1 self-hosted via Docker with Traefik. Both Google Gemini (PaLM) and Groq nodes fail with “Couldn’t connect with these settings” when testing credentials. Here’s what I’ve found:

  • Google Gemini: Host: https://generativelanguage.googleapis.com/v1beta. The API key is valid (tested via curl from the host, returns list of models), but n8n logs show 404 errors (“The resource you are requesting could not be found”). The key also resets to a blank value after saving.
  • Groq: Same “Couldn’t connect” error, with 404 errors in logs.
  • Setup: n8n runs with N8N_PROTOCOL=https, N8N_LOG_LEVEL=verbose, and N8N_DEBUG=true. Network is fine (tested via curl), and n8n is accessible via Traefik.
  • Tried: Added the API key to environment variables, updated n8n, tested network with network_mode: host (reverted due to Traefik issues), and confirmed no regional restrictions.

It seems like a bug in n8n’s handling of these APIs, possibly related to how requests are formed (404 errors in logs). Has anyone faced this? Any fixes or workarounds?

1 Like

Hey @Digital_Marketing Welcome to the community :wave:

Hmm it’ll help if you could post the logs or screenshots of the error. Technically, if your server can reach the internet eg. curl https://google.com works fine, then it’s likely just a configuration issue.

  • For the Gemini credential, host value should be set to “https://generativelanguage.googleapis.com” and not include the “v1beta”".

  • For the Groq credential, you only need a valid API key so I’m not sure where you are seeing the 404. Perhaps try a new API key?

The only other thing that comes to mind is the Gemini service has been known to block budget hosting providers such as Hetzner. You may want to try using the Vertex AI node instead or another hosting service to test.

I’m having the same issue, running n8n on webdock.io vps provider? is there any workaround for this issue? i’m sure everything is set properly?

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