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

Heroku连接Azure托管数据库时出现Error R10启动超时问题求助

连接Azure托管PostgreSQL时Heroku触发R10超时错误

本地环境可正常连接数据库,切换到Heroku托管的其他数据库也能正常运行,但连接特定Azure托管数据库时,始终触发以下超时错误:

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

相关代码及环境配置

db.js

const dbnexus = new Sequelize(process.env.DATABASE_URL, {
  dialect: 'postgres',
  logging: true,
  operatorsAliases: Sequelize.Op.Aliases,
  dialectOptions: {
    ssl: {
      require: true,
      rejectUnauthorized: false,
    },
  },
});

app.js

dbnexus
  .authenticate()
  .then(() => dbnexus.sync())
  .then(() =>
    app.listen(process.env.PORT || 3000, (res) => {
      console.log(`[server]: App is listening on ${process.env.PORT}`);
    })
  )
  .catch((e) => {
    console.log('[server]: Server Crashed');
    console.log(e);
  });

Heroku环境变量

DATABASE_URL = [与本地环境DATABASE_URL连接字符串一致]
PGSSLMODE = require
SSLMODE = require

其他同类问题多为端口设置问题,但我的端口配置符合标准且连接其他数据库正常,已排除端口因素,请求协助排查问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.22 06:18:24