Unable to execute any workflow via web (was: Google Sheets cannot fetch data)

Hi,

Describe the problem/error/question

I’m trying out n8n self hosted version using the docker compose to set it up (Docker Compose | n8n Docs)

I’m trying to read new rows from a Google sheet, I have successfully added credentials to the Google Sheets Trigger. I was able to also select the Document and the Sheet form the list with the credentials. So the credentials seem to be in order and the document in question is shared to those credentials. However when I press the Fetch Test Event button and add rows the the selected Google Sheet nothing happens in n8n.

It just says:
“Fetching event
This node is looking for an event in Google Sheets that is similar to the one you defined”

And also the stop fetching button doesn’t do anything.

What is the error message (if any)?

None.

Please share your workflow

Share the output returned by the last node

This is the first node

Information on your n8n setup

  • n8n version: 1.0.5
  • Database (default: SQLite): Whatever is used by the default docker compose setup
  • n8n EXECUTIONS_PROCESS setting (default: own, main): ?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu 22.04

Hi @pete, welcome to the community!

I just tested your example workflow on my end (after updating only the Document and Sheet fields), but was able to execute the trigger just fine.

In a first step I’d like to understand if this is a problem just with Google Sheets or a general problem.

Are you able to successfully execute any other workflows, including workflows not relying on the Google Sheets trigger node? Perhaps something simple not relying on any 3rd party services like below?

This just output some dummy data after running, like so:

1 Like

Hey,

The Google Sheets workflow is the first workflow i’ve created. I set up a workflow like yours on the screenshot and it doesn’t work either.

When clicking on Execute node it just keeps executing the previous node and nothing happens

pete

1 Like

Thanks for confirming @pete! At least we know it’s not a problem specific to Google Sheets :slight_smile:

The behaviour you’re seeing typically means that your n8n instance can’t send any messages with execution status updates to your browser. Do you have any reverse proxy, load balancer or other component sitting between your n8n instance and your browser? Since version 1 n8n uses the websocket protocol for this, and some servers might need a little extra configuration to allow websockets.

Hey,

I’m using the default docker compose setup from the official instructions so there is traefik in use, I have modified the setup only the get the ssl certificate using dns-01 challenge and rfc216 provider for it.

So i would assume if websockets is used the configuration for traefik takes this into account in the provided docker-compose.yml file

version: "3"

services:
  traefik:
    image: "traefik"
    restart: always
    command:
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.web.http.redirections.entryPoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mydnschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mydnschallenge.acme.dnschallenge=true"
      - "--certificatesresolvers.mydnschallenge.acme.dnschallenge.provider=rfc2136"
      - "--certificatesresolvers.mydnschallenge.acme.dnschallenge.delaybeforecheck=60"
      - "--certificatesresolvers.mydnschallenge.acme.storage=/letsencrypt/acme.json"
      - "--certificatesresolvers.mydnschallenge.acme.dnschallenge.disablePropagationCheck=true"
      - "--certificatesresolvers.mydnschallenge.acme.dnschallenge.resolvers=8.8.8.8:53"
v02.api.letsencrypt.org/directory"      
    environment:
      - RFC2136_TSIG_KEY=${RFC2136_TSIG_KEY}
      - RFC2136_TSIG_SECRET=${RFC2136_TSIG_SECRET}
      - RFC2136_TSIG_ALGORITHM=${RFC2136_TSIG_ALGORITHM}
      - RFC2136_NAMESERVER=${RFC2136_NAMESERVER}
      - RFC2136_PROPAGATION_TIMEOUT=20
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./local-files:/files

  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: always
    ports:
      - "127.0.0.1:5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=web,websecure
      - traefik.http.routers.n8n.tls.certresolver=mydnschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
      - traefik.http.routers.n8n.middlewares=n8n@docker
    environment:
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - N8N_DIAGNOSTICS_ENABLED=false
    volumes:
      - ${DATA_FOLDER}/.n8n:/home/node/.n8n

pete

traefik should indeed handle websockets just fine, though I don’t have any real experience with it.

For science, can you try running your workflow in n8n through an SSH tunnel, without using traefik? Just to see if that makes any difference here.

Hey,

running the simple set workflow from command line seems to work

$ docker compose exec n8n n8n execute --id SVBYFSRc9tGzGikk
Execution was successful:
====================================
{
  "data": {
    "startData": {},
    "resultData": {
      "runData": {
        "When clicking \"Execute Workflow\"": [
          {
            "startTime": 1690814033512,
            "executionTime": 2,
            "source": [],
            "executionStatus": "success",
            "data": {
              "main": [
                [
                  {
                    "json": {},
                    "pairedItem": {
                      "item": 0
                    }
                  }
                ]
              ]
            }
          }
        ],
        "Set": [
          {
            "startTime": 1690814033516,
            "executionTime": 4,
            "source": [
              {
                "previousNode": "When clicking \"Execute Workflow\""
              }
            ],
            "executionStatus": "success",
            "data": {
              "main": [
                [
                  {
                    "json": {
                      "propertyName": "hey"
                    },
                    "pairedItem": {
                      "item": 0
                    }
                  }
                ]
              ]
            }
          }
        ]
      },
      "lastNodeExecuted": "Set"
    },
    "executionData": {
      "contextData": {},
      "nodeExecutionStack": [],
      "waitingExecution": {},
      "waitingExecutionSource": {}
    }
  },
  "mode": "cli",
  "startedAt": "2023-07-31T14:33:53.436Z",
  "stoppedAt": "2023-07-31T14:33:53.520Z",
  "status": "running",
  "finished": true
}

So I suspect the execution will also work fine if you use your browser, it’s just that the live status updates don’t reach your browser due to websockets trouble. Assuming you are storing execution data you should still see the finished executions in your executions list.

When using the SSH tunnel, can you try accessing n8n via your browser directly on port 5678 (and thus avoiding traefik), just to confirm whether it’s indeed traefik causing this problem?

After changing these values in the docker-compose.yml file i was able to connect directly to the n8n container without https

ports:
      - "5678:5678"
environment:
      - N8N_PROTOCOL=http

and the both workflows can be executed on the browser.

(I am not using an ssh tunnel in this)

1 Like

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