Incorrect host (domain) value error in Google Sheets

I’m running into an issue with the Google Sheets node and would really appreciate some insights.
My Setup:
I am running n8n on a company VM/Server using our own custom domain.
I am trying to connect to Google Sheets using the OAuth2 method.
I have correctly configured the Google Cloud Console, enabled the Google Sheets API, and added the redirect URL. I have double-checked all these settings multiple times an my account is connected successfully.
Inside n8n, the authentication works perfectly. When I connect my account, I get the green “Connection tested successfully” message.

Describe the problem/error/question

Even though my account is fully connected and authenticated, whenever I try to execute the Google Sheets node (e.g., Get Row), it immediately throws this error:Problem in node ‘Get row(s) in sheet‘
The connection cannot be established, this usually occurs due to an incorrect host (domain) value. I am running this on a company VM. Can anyone help me?

What is the error message (if any)?

Problem in node ‘Get row(s) in sheet‘

The connection cannot be established, this usually

occurs due to an incorrect host (domain) value

Hi @Mahoor_Jahanbani

Since this is a company VM, you likely have restricted network access. You will need to contact your network or systems administrator with the following points:

  1. DNS Resolution Check: Ask them to verify if the VM can resolve external domains. They can test this by running a simple command from the VM terminal: ping sheets.googleapis.com or nslookup sheets.googleapis.com If these fail, the VM’s DNS settings (e.g., /etc/resolv.conf on Linux) are incorrect or blocked.

  2. Firewall Whitelisting: Company servers often block outbound traffic by default. Ensure that the VM is allowed to make outbound HTTPS requests (Port 443) to:

    • sheets.googleapis.com
    • oauth2.googleapis.com
    • accounts.google.com
  3. Proxy Server Configuration: If your company uses a proxy server to access the internet, n8n needs to be aware of it. You will need to set the HTTP_PROXY and HTTPS_PROXY environment variables in your n8n setup (e.g., in your Docker Compose file or VM environment variables).

    • Example: HTTPS_PROXY=http://proxy.yourcompany.com:8080

Thank you so much I will check with them

Thanks for letting us know about this, We have created CV-8 as the internal dev ticket to look into it.

Hi @Mahoor_Jahanbani Welcome!
The credential test and the Get row(s) node call different hosts: the OAuth2 test only reaches Google’s token endpoints, not sheets.googleapis.com, which is what the node hits at execution time. A passing credential test on a locked-down VM does not confirm that host is reachable.
Open the failed execution, click the Get row(s) in sheet node, and check its error output for the raw message, it will show the exact host and the DNS failure, something like “getaddrinfo ENOTFOUND sheets.googleapis.com”. Give your network admin that exact hostname to whitelist instead of guessing which domain is blocked.
The connection cannot be established, this usually occurs due to an incorrect host (domain) value · Issue #18985 · n8n-io/n8n · GitHub

We have taken a look at this issue and are unable to confirm that this is a bug, For now we have closed the internal ticket but if it starts to look like it is a bug our moderation team will flag this again.