You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Lightdash中测试编译项目时遭遇PostgreSQL自签名证书错误

解决Lightdash连接PostgreSQL时的自签名证书错误

出现Error running postgres query: Error: self-signed certificate错误,是因为PostgreSQL启用了SSL且使用自签名证书,Lightdash默认会验证证书合法性,导致连接失败。以下是两种可行的解决办法:

方法一:临时禁用证书验证(测试环境适用)

在Lightdash的PostgreSQL连接配置中,添加额外连接参数:

  • 找到连接设置里的「额外连接参数」(或类似字段),输入sslmode=require
  • 该参数会强制使用SSL加密连接,但不验证证书有效性,可快速绕过自签名证书问题

同时,同步更新dbt profiles.yml中对应环境的配置:

your_dbt_profile:
  outputs:
    dev:
      type: postgres
      # 保留已有host、user、password等配置
      sslmode: require

方法二:导入自签名证书(生产环境推荐)

  1. 从PostgreSQL服务器获取自签名根证书文件(通常名为root.crt或server.crt)
  2. 在Lightdash的PostgreSQL连接配置中:
    • 将SSL模式设置为「Verify CA」
    • 上传获取到的根证书文件,或配置sslrootcert参数指向证书存储路径
  3. 同步更新dbt profiles.yml的对应配置:
your_dbt_profile:
  outputs:
    dev:
      type: postgres
      # 保留已有host、user、password等配置
      sslmode: verify-ca
      sslrootcert: "/path/to/your/root.crt"

配置完成后,重新测试Lightdash连接并尝试编译项目即可。

内容的提问来源于stack exchange,提问作者Azamat Kabidollayev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 06:48:22