'Missing access token' when trying to connect localhost Retool to localhost postgres database

  • Goal:

I am trying to set up retool locally hosted and connect to a locally hosted postgres database.

However whenever I do it, I get the error:

Test connection failed (0.081s):Error: Authentication failure. Missing access token

  • Steps:

I have setup docker-compose and docker.env. I can send these on if you would like to see them easily.

  • Details:

  • Screenshots:

I can provide screenshot but the error is above - missing access token.

What is this error? I genuinely do not understand.

1 Like

Hey @mdstrading! Welcome to the community. :slightly_smiling_face:

I'm guessing that this is an issue with secure cookies, given the fact that you're running Retool locally. You might need to verify that your docker.env file includes the line COOKIE_INSECURE=true.

Hi, thanks for your reply.

I do already have that line in docker.env

Would you like me to post my docker compose and env? I only did not because I need to redact sensitive info.

Hmm thanks for confirming. :thinking: Feel free to share those files via DM, if it's easier!

This is the ENV

Required values

NODE_ENV=production
POSTGRES_DB=
POSTGRES_USER=retool_internal_user
POSTGRES_PASSWORD=
POSTGRES_HOST=
POSTGRES_PORT=
COOKIE_INSECURE=
JWT_SECRET=
ENCRYPTION_KEY=
LICENSE_KEY=

DB Connector settings

DB_CONNECTOR_HOST=http://backend
DB_CONNECTOR_PORT=3000
DB_SSH_CONNECTOR_HOST=http://backend
DB_SSH_CONNECTOR_PORT=3000

Additional configurations

PORT=3000

This is docker compose

services:
postgres:
image: postgres:13
container_name: retool-postgres
restart: unless-stopped
environment:
- POSTGRES_USER=retool_internal_user
- POSTGRES_PASSWORD=someSecurePassword123
- POSTGRES_DB=hammerhead_production
volumes:
- ./postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U retool_internal_user -d hammerhead_production"]
interval: 10s
timeout: 5s
retries: 5
networks:
- retool-network

trading-db:
image: postgres:13
container_name: trading-postgres
restart: unless-stopped
environment:
- POSTGRES_USER=
- POSTGRES_PASSWORD=
- POSTGRES_DB=
ports:
- "5432:5432"
volumes:
- ./trading-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d trading_journal"]
interval: 10s
timeout: 5s
retries: 5
networks:
- retool-network

backend:
image: tryretool/backend:3.114.2-stable
container_name: retool-backend
restart: unless-stopped
env_file:
- ./docker.env
environment:
- SERVICE_TYPE=MAIN_BACKEND
- PORT=3000
- LICENSE_KEY=
- NODE_ENV=production
- POSTGRES_DB=
- POSTGRES_USER=
- POSTGRES_PASSWORD=
- POSTGRES_HOST=
- POSTGRES_PORT=
- COOKIE_INSECURE=true
- JWT_SECRET=
- ENCRYPTION_KEY=
- DB_CONNECTOR_HOST=http://backend
- DB_CONNECTOR_PORT=3000
- DB_SSH_CONNECTOR_HOST=http://backend
- DB_SSH_CONNECTOR_PORT=3000
ports:
- "3002:3000"
depends_on:
postgres:
condition: service_healthy
networks:
- retool-network

jobs_runner:
image: tryretool/backend:3.114.2-stable
container_name: retool-jobs-runner
restart: unless-stopped
env_file:
- ./docker.env
environment:
- SERVICE_TYPE=JOBS_RUNNER
- NODE_ENV=production
- POSTGRES_DB=
- POSTGRES_USER=
- POSTGRES_PASSWORD=
- POSTGRES_HOST=
- POSTGRES_PORT=
- JWT_SECRET=
- ENCRYPTION_KEY=
depends_on:
postgres:
condition: service_healthy
backend:
condition: service_started
networks:
- retool-network

networks:
retool-network:
driver: bridge

Maybe I have gone significantly wrong with composing

Hey @mdstrading! Thanks for sharing. I assume the trading-db service is the one you're trying to connect to? I was able to get it to work with the following configuration:

image

image

I never experienced the same Missing access token error, though, even when trying a few different things.