Kabir Gaire
06/08/2025, 11:20 PMPylon
06/08/2025, 11:20 PMPylon
06/09/2025, 7:14 AMKabir Gaire
06/09/2025, 2:54 PMLari Haataja
06/09/2025, 8:02 PMLari Haataja
06/09/2025, 8:09 PMLari Haataja
06/09/2025, 8:13 PMg1-small instance.Kabir Gaire
06/10/2025, 5:26 AM2025-06-10 05:14:52 [Lightdash] error: Unhandled Rejection at Promise connect ECONNREFUSED 127.0.0.1:5432
2025-06-10 05:14:52 [Lightdash] error: Error migrating graphile worker connect ECONNREFUSED 127.0.0.1:5432
ELIFECYCLE Command failed with exit code 1.
ERROR: (gcloud.run.deploy) Revision 'lightdash-00010-mz9' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable within the allocated timeout. This can happen when the container port is misconfigured or if the timeout is too short. The health check timeout can be extended. Logs for this revision might contain more information.
---
Dockerfile
FROM lightdash/lightdash:latest
# Copy dbt project files
COPY ./dbt_project.yml /usr/app/dbt/dbt_project.yml
COPY ./data /usr/app/dbt/data
COPY ./models /usr/app/dbt/models
# Copy dbt profiles config
COPY ./profiles/profiles.yml /root/.dbt/profiles.yml
# Copy custom entrypoint script
COPY ./lightdash-entrypoint.sh /usr/bin/lightdash-entrypoint.sh
# COPY ./credentials.json /root/.gcp/credentials.json
# ENV GOOGLE_APPLICATION_CREDENTIALS=/root/.gcp/credentials.json
# Install pnpm (Corepack already included)
RUN corepack enable && corepack prepare pnpm@latest --activate
# Install Python and pip before dbt
RUN apt-get update && apt-get install -y python3 python3-pip
# Install dbt-postgres adapter with override
RUN pip3 install --break-system-packages dbt-postgres
# Expose Lightdash port
EXPOSE 8080
# Set entrypoint
ENTRYPOINT ["/usr/bin/lightdash-entrypoint.sh"]
lightdash-entrypoint.sh
#!/bin/bash
set -e
# Migrate Lightdash backend DB
yarn workspace backend migrate-production
# Run dbt (optional but common)
cd /usr/app/dbt
dbt seed --full-refresh --profiles-dir /root/.dbt || true
dbt run --profiles-dir /root/.dbt || true
cd /usr/app/packages/backend
# Start Lightdash
exec pnpm start
.env.example
PGPASSWORD=
PGUSER=
# PGHOST=host.docker.internal
PGHOST=
PGPORT=
PGDATABASE=
GCP_PROJECT_ID=
GCP_DATASET_ID=
GCP_DATASET_LOCATION=
GOOGLE_APPLICATION_CREDENTIALS=
LIGHTDASH_SECRET=
SITE_URL=
LOG_LEVEL=Irakli
06/10/2025, 11:05 AMI’m also surprised that Macbook apple silicon is not supported.Could you share more on this one? I am running lightdash locally on an m1 machine. regarding this message over here:
2025-06-10 05:14:52 [Lightdash] error: Unhandled Rejection at Promise connect ECONNREFUSED 127.0.0.1:5432
2025-06-10 05:14:52 [Lightdash] error: Error migrating graphile worker connect ECONNREFUSED 127.0.0.1:5432
ELIFECYCLE Command failed with exit code 1.
it seems like lightdash is unable to connect to the postgres instance. could you double check you are setting required environment variables listed here -> https://docs.lightdash.com/self-host/customize-deployment/environment-variables ?Irakli
06/10/2025, 11:08 AM.env.example does not do anything, and just serves the purpose of showcasing some of the environment variables required for local development. in Production, it is advised to use system environment variablesKabir Gaire
06/10/2025, 3:12 PMLari Haataja
06/10/2025, 8:32 PMECONNREFUSED 127.0.0.1:5432 indicates that Lightdash is trying to connect to postgres running on localhost (127.0.0.1) which is not the case. So probably at least the PGHOST environment variable is not set correctly. It should be the IP address of the Cloud SQL instance.Lari Haataja
06/10/2025, 8:37 PMLari Haataja
06/11/2025, 8:05 AMLari Haataja
06/11/2025, 8:05 AMselect 1 as myColumn;Kabir Gaire
06/11/2025, 8:07 AMselect 1 as myColumn; and I am getting the error below:
Could not fetch SQL query results
Bigquery warehouse error: badRequestLari Haataja
06/11/2025, 8:11 AMKabir Gaire
06/12/2025, 12:13 AMAccess Denied: Permission bigquery.tables.getData denied on table my-project-name:_9ce6547e035945d60f5bf0684e8266f7cdaf9567.anon1cc3c338b303b41f7a42570c1edbcc9fa06a74ad04f175ee1f7ed24c80de504b (or it may not exist).
: my-project-name is set to my bigquery project name
I have done everything I can, the service account has Bigquery Data Owner permission and many more. I do not understand why I am still getting this error.
ROLE: roles/artifactregistry.writer
ROLE: roles/bigquery.admin
ROLE: roles/bigquery.connectionAdmin
ROLE: roles/bigquery.connectionUser
ROLE: roles/bigquery.dataEditor
ROLE: roles/bigquery.dataOwner
ROLE: roles/bigquery.dataViewer
ROLE: roles/bigquery.jobUser
ROLE: roles/bigquery.user
ROLE: roles/bigqueryconnection.serviceAgent
ROLE: roles/bigquerydatapolicy.viewer
ROLE: roles/cloudsql.client
ROLE: roles/cloudsql.editor
ROLE: roles/editor
ROLE: roles/logging.logWriter
ROLE: roles/secretmanager.secretAccessor
ROLE: roles/storage.admin
ROLE: roles/storage.objectAdminIrakli
06/12/2025, 7:13 AMroles/bigquery.readSessionUser role to the service account you’re using with Lightdash. This should allow it to access the temporary results and fix the issue you’re seeing in the SQL Runner.
LMK if this helps lightdash circleKabir Gaire
06/12/2025, 7:20 AMLari Haataja
06/12/2025, 7:21 AMKabir Gaire
06/12/2025, 7:22 AMKabir Gaire
06/12/2025, 7:23 AMLari Haataja
06/12/2025, 7:24 AMLari Haataja
06/12/2025, 7:34 AMKabir Gaire
06/12/2025, 7:51 AMBigQuery Job User on the project level and Data Viewer on the tables / datasets