Unable to connect to grist selfhosted on the same docker network

Describe the problem/error/question

I have n8n and grist installed through docker on a server. They both works fine by their own, but I cannot use n8n to communicate with grist.
n8n address is :5678 and grist’s one is :8484. Again, I can connect to both and use them by their own, but when I try to set up a grist connection in n8n, it fails (actually it goes in time out).

What is the error message (if any)?

The error i got is

connect ETIMEDOUT ***.***.***.***:8484

Here are the two stacks:

services:
  n8n:
    image: n8n_crypto:latest
    container_name: n8n
    restart: unless-stopped
    ports:
      - "5678:5678"
    environment:
      - N8N_PORT=5678
      - GENERIC_TIMEZONE=Europe/Rome
      - TZ=Europe/Rome
      - N8N_SECURE_COOKIE=false
    volumes:
      - /home/portainer_data/n8n/n8n_data:/home/node/.n8n
      - /home/portainer_data/n8n/local_files:/files
    networks:
      - ***

networks:
  ***:
    external: true

services:
    grist:
      container_name: grist
      ports:
          - 8484:8484
      volumes:
          - /home/portainer_data/grist:/persist
      environment:
          - APP_HOME_URL=http://<domain>:8484
          - GRIST_SESSION_SECRET=***
          - GRIST_DEFAULT_EMAIL=***
      stdin_open: true
      tty: true
      image: gristlabs/grist
      networks:
          - ***
      
networks:
  ***:
    external: true

I switch to postgres for what I need, but I find a bad solution, since my customer would not know how to use it, after I pass the automations to them.

Any idea on why it’s not working?

Information on your n8n setup

  • n8n version: 1.81.4
  • Database (default: SQLite): SQLite
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

And how do you connect from n8n? With “grist:8484” as address/port?

You are using a dedicated network, so n8n should be able to connect.

I connect using the public address, because if I try using the container name, I got an error. I show you:


If I use the public address (or the ip like http://...:8484), the connection got saved and the testing if failing with the error connect ETIMEDOUT ***.***.***.***:8484

I add that: I can connect to other services, like Airtable or postgres, for example. So, I think the problem is with grist itself.

Hmmm.

Are these screenshots from the public grist, or from your local grist container?

It seems a simple access (firewall for instance or port forwarding) problem.
n8n should be able to connect over the network using grist:8484 as Docker will resolve the “grist” DNS name.

The public HTTP address should also resolve to the server grist/n8n are running on. Or at least if it is local, the local DNS.

The screenshots are from n8n’s connection setup popup.

I agree, n8n should be able to resolve grist:8484, but I think it won’t even try, since it thinks grist: is the protocol.

I tried with http://grist:8484 and it says the domain is not recognized.
I also tried with the local ip from doker network http://172.18.0.3:8484, with the same result.

From grist’s log seem that everything’s fine.
From n8n’s, i see the errors:

404 - {"error":"Domain not recognized: 172.18.0.3"}
Unsupported protocol grist:
404 - {"error":"Domain not recognized: grist"}
connect ETIMEDOUT ***.***.***.***:8485
browserId check failed on /rest/events/session-started
browserId check failed on /rest/login
connect ETIMEDOUT ***.***.***.***:8484

Ok.

So you need a real URL.

That needs a local DNS (or an entry in your hosts file) that points to the IP address of the server. As you use portmapping, that should work if n8n really uses that port setting, and does not default to port 80.

1 Like

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