azure-aks - Pact-broker 与 Azure Postgres 数据库的连接失败

问题:已将 pactfoundation\pact-broker docker 映像部署到 AKS(Azure Kubernetes)集群,并且正在使用 Azure postgres 数据库。与 postgres 数据库的连接失败,似乎无法理解 Puma 它试图以 root 用户身份连接。这是日志摘录:

彪马以单一模式启动...

  • 版本 3.12.6 (ruby 2.6.6-p146),代号:Llamas in Pajamas

  • 最小线程数:0,最大线程数:16

  • 环境:生产!无法加载应用程序:Sequel::DatabaseConnectionError:PG::ConnectionBad:致命:用户“root”捆绑程序的密码验证失败:加载命令失败:puma (/pact_broker/vendor/bundle/ruby/2.6.0/bin/puma ) Sequel::DatabaseConnectionError: PG::ConnectionBad: FATAL: 用户“root”的密码验证失败

    /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib /sequel/adapters/postgres.rb:210:in initialize' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/adapters/postgres.rb:210:in new' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/adapters/postgres.rb:210:在 connect' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/connection_pool.rb:122:in make_new' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/connection_pool/threaded.rb:209:in assign_connection' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/connection_pool/threaded.rb:139:in acquire' /pact_broker/vendor/ bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/connection_pool/threaded.rb:91:in hold' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/database/connecting.rb:269:in synchronize' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel -5.40.0/lib/sequel/database/connecting.rb:278:in test_connection' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/database/misc.rb:169:in initialize' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/database/连接.rb:57:in new' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/database/connecting.rb:57:in connect' /pact_broker/vendor/bundle/ruby/2.6.0/gems/sequel-5.40.0/lib/sequel/core.rb:124:in connect' /pact_broker/database_connection.rb:31:in create_database_connection_from_config' config.ru:15:in block (2 levels) in <main>' /pact_broker/vendor/bundle/ruby/2.6.0/gems/pact_broker-2.76.2/lib/pact_broker/app.rb:39:in 初始化' config.ru:12:in new' config.ru:12:in block in ' /pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:116:in load_rackup' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/configuration.rb:245:in app' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/ puma/runner.rb:147:in load_and_bind' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/single.rb:98:in run' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/launcher.rb:186:in run' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/lib/puma/cli.rb:80:in run ' /pact_broker/vendor/bundle/ruby/2.6.0/gems/puma-3.12.6/bin/puma:10:in <top (required)>' /pact_broker/vendor/bundle/ruby/2.6.0/bin/puma:23:in load' /pact_broker/vendor/bundle/ruby/2.6.0/bin/puma :23:in `<top(必填)>'

    >new_from_string' /pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:105:in load_file' /pact_broker/vendor/bundle/ruby/2.6.0/gems/rack-2.2.3/lib/rack/builder.rb:66:in parse_file' /pact_broker/vendor/bundle/ruby/2.6

回答1

错误很明显:

致命:用户“root”的密码验证失败

这告诉我您正在尝试使用 Postgres 验证 Pact 代理应用程序使用 root 用户,并且凭据不正确或用户不存在。

另请参阅如何在此处设置容器上的凭据:https://github.com/pact-foundation/pact-broker-docker#configure-the-connection-details