Heroku的Vapor服务器崩溃:可能是Postgres库问题?

4zcjmb1e  于 2022-11-13  发布在  其他
关注(0)|答案(1)|浏览(139)

我把这个新信息放在第一位:下面是使我走到这一步问题。
这是我的应用程序部署到Heroku后得到的结果:似乎编译得很好,虽然有帖子原始部分描述的问题。现在,按照评论中的建议,身份验证错误似乎消失了,但出现了加密问题...

2022-04-20T07:05:05.960239+00:00 heroku[web.1]: State changed from crashed to starting
2022-04-20T07:05:08.667673+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port 57625`
2022-04-20T07:05:10.017468+00:00 app[web.1]: Swift/ErrorType.swift:200: Fatal error: Error raised at top level: PostgresNIO.PSQLError(base: PostgresNIO.PSQLError.Base.server(PostgresNIO.PostgresBackendMessage.ErrorResponse(fields: [Line: "545", Severity: "FATAL", Localized Severity: "FATAL", Code: "28000", File: "auth.c", Routine: "ClientAuthentication", Message: "no pg_hba.conf entry for host \"52.87.192.140\", user \"gcnpqdmtllqlsa\", database \"d71dlsuretksud\", no encryption"])))
2022-04-20T07:05:10.017484+00:00 app[web.1]: Current stack trace:
2022-04-20T07:05:10.017998+00:00 app[web.1]: 0    libswiftCore.so                    0x00007fb4a3e93210 swift_reportError + 50
2022-04-20T07:05:10.018318+00:00 app[web.1]: 1    libswiftCore.so                    0x00007fb4a3f07fc0 _swift_stdlib_reportFatalErrorInFile + 112
2022-04-20T07:05:10.018535+00:00 app[web.1]: 2    libswiftCore.so                    0x00007fb4a3bf0c40 _assertionFailure(_:_:file:line:flags:) + 1329
2022-04-20T07:05:10.018759+00:00 app[web.1]: 3    libswiftCore.so                    0x00007fb4a3c5fea0 swift_errorInMain + 1075
2022-04-20T07:05:10.018772+00:00 app[web.1]: 4                                       0x000055b6cab352e8 <unavailable> + 10863336
2022-04-20T07:05:10.018824+00:00 app[web.1]: 5    libc.so.6                          0x00007fb4a2ca8fc0 __libc_start_main + 243
2022-04-20T07:05:10.018826+00:00 app[web.1]: 6                                       0x000055b6ca23aeae <unavailable> + 1449646
2022-04-20T07:05:10.018870+00:00 app[web.1]: Received signal 4. Backtrace:
2022-04-20T07:05:10.231212+00:00 app[web.1]: 0x55b6ca473552, Backtrace.(printBacktrace in _B82A8C0ED7C904841114FDF244F9E58E)(signal: Swift.Int32) -> () at /tmp/build_64fa1ab2/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:66
2022-04-20T07:05:10.231216+00:00 app[web.1]: 0x7fb4a3a6d3bf
2022-04-20T07:05:10.231216+00:00 app[web.1]: 0x7fb4a3bf1307
2022-04-20T07:05:10.231216+00:00 app[web.1]: 0x7fb4a3c602d2
2022-04-20T07:05:10.231242+00:00 app[web.1]: 0x55b6cab352e7, main at /tmp/build_64fa1ab2/<compiler-generated>:0
2022-04-20T07:05:10.231250+00:00 app[web.1]: 0x7fb4a2ca90b2
2022-04-20T07:05:10.231258+00:00 app[web.1]: 0x55b6ca23aead
2022-04-20T07:05:10.231260+00:00 app[web.1]: 0xffffffffffffffff
2022-04-20T07:05:10.354561+00:00 heroku[web.1]: Process exited with status 132
2022-04-20T07:05:10.414827+00:00 heroku[web.1]: State changed from starting to crashed
2022-04-20T07:05:10.424640+00:00 heroku[web.1]: State changed from crashed to starting
2022-04-20T07:05:13.246896+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port 54624`
2022-04-20T07:05:14.462106+00:00 app[web.1]: Swift/ErrorType.swift:200: Fatal error: Error raised at top level: PostgresNIO.PSQLError(base: PostgresNIO.PSQLError.Base.server(PostgresNIO.PostgresBackendMessage.ErrorResponse(fields: [Severity: "FATAL", Code: "28000", File: "auth.c", Localized Severity: "FATAL", Line: "545", Routine: "ClientAuthentication", Message: "no pg_hba.conf entry for host \"3.237.11.112\", user \"gcnpqdmtllqlsa\", database \"d71dlsuretksud\", no encryption"])))
2022-04-20T07:05:14.462121+00:00 app[web.1]: Current stack trace:
2022-04-20T07:05:14.462395+00:00 app[web.1]: 0    libswiftCore.so                    0x00007fe7be7d4210 swift_reportError + 50
2022-04-20T07:05:14.462580+00:00 app[web.1]: 1    libswiftCore.so                    0x00007fe7be848fc0 _swift_stdlib_reportFatalErrorInFile + 112
2022-04-20T07:05:14.462693+00:00 app[web.1]: 2    libswiftCore.so                    0x00007fe7be531c40 _assertionFailure(_:_:file:line:flags:) + 1329
2022-04-20T07:05:14.462816+00:00 app[web.1]: 3    libswiftCore.so                    0x00007fe7be5a0ea0 swift_errorInMain + 1075
2022-04-20T07:05:14.462824+00:00 app[web.1]: 4                                       0x000055ab278fb2e8 <unavailable> + 10863336
2022-04-20T07:05:14.462847+00:00 app[web.1]: 5    libc.so.6                          0x00007fe7bd5e9fc0 __libc_start_main + 243
2022-04-20T07:05:14.462849+00:00 app[web.1]: 6                                       0x000055ab27000eae <unavailable> + 1449646
2022-04-20T07:05:14.462881+00:00 app[web.1]: Received signal 4. Backtrace:
2022-04-20T07:05:14.631921+00:00 app[web.1]: 0x55ab27239552, Backtrace.(printBacktrace in _B82A8C0ED7C904841114FDF244F9E58E)(signal: Swift.Int32) -> () at /tmp/build_64fa1ab2/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:66
2022-04-20T07:05:14.631960+00:00 app[web.1]: 0x7fe7be3ae3bf
2022-04-20T07:05:14.631979+00:00 app[web.1]: 0x7fe7be532307
2022-04-20T07:05:14.631996+00:00 app[web.1]: 0x7fe7be5a12d2
2022-04-20T07:05:14.632053+00:00 app[web.1]: 0x55ab278fb2e7, main at /tmp/build_64fa1ab2/<compiler-generated>:0
2022-04-20T07:05:14.632070+00:00 app[web.1]: 0x7fe7bd5ea0b2
2022-04-20T07:05:14.632086+00:00 app[web.1]: 0x55ab27000ead
2022-04-20T07:05:14.632101+00:00 app[web.1]: 0xffffffffffffffff
2022-04-20T07:05:14.757480+00:00 heroku[web.1]: Process exited with status 132
2022-04-20T07:05:14.897128+00:00 heroku[web.1]: State changed from starting to crashed
2022-04-20T07:05:27.957078+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=intense-journey-01336.herokuapp.com request_id=4e9b80e0-0b48-4075-be82-08ed26aa14b8 fwd="49.156.46.15" dyno= connect= service= status=503 bytes= protocol=http

原始帖子===================
我有一个工作正常的生产服务器。我正在实现一个临时服务器,在部署它时遇到了一些问题,现在它已经完成了。
但是,在启动后,当我试图在https:没有证书。然后我重新启动,并将其加载为http:但在Heroku日志中仍然得到了这样的反馈:

022-04-20T06:15:47.340383+00:00 heroku[web.1]: State changed from crashed to starting
2022-04-20T06:15:50.014593+00:00 heroku[web.1]: Starting process with command `Run serve --env production --hostname 0.0.0.0 --port 57964`
2022-04-20T06:15:51.051520+00:00 app[web.1]: Swift/ErrorType.swift:200: Fatal error: Error raised at top level: PostgresNIO.PSQLError(base: PostgresNIO.PSQLError.Base.connectionError(underlying: NIOSSL.NIOSSLError.handshakeFailed(NIOSSL.BoringSSLError.sslError([Error: 268435581 error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED]))))
2022-04-20T06:15:51.051534+00:00 app[web.1]: Current stack trace:
2022-04-20T06:15:51.051817+00:00 app[web.1]: 0    libswiftCore.so                    0x00007f5736109210 swift_reportError + 50
2022-04-20T06:15:51.051993+00:00 app[web.1]: 1    libswiftCore.so                    0x00007f573617dfc0 _swift_stdlib_reportFatalErrorInFile + 112
2022-04-20T06:15:51.052106+00:00 app[web.1]: 2    libswiftCore.so                    0x00007f5735e66c40 _assertionFailure(_:_:file:line:flags:) + 1329
2022-04-20T06:15:51.052221+00:00 app[web.1]: 3    libswiftCore.so                    0x00007f5735ed5ea0 swift_errorInMain + 1075
2022-04-20T06:15:51.052229+00:00 app[web.1]: 4                                       0x000055c7c48aa528 <unavailable> + 10863912
2022-04-20T06:15:51.052252+00:00 app[web.1]: 5    libc.so.6                          0x00007f5734f1efc0 __libc_start_main + 243
2022-04-20T06:15:51.052254+00:00 app[web.1]: 6                                       0x000055c7c3fafeae <unavailable> + 1449646
2022-04-20T06:15:51.052284+00:00 app[web.1]: Received signal 4. Backtrace:
2022-04-20T06:15:51.189690+00:00 app[web.1]: 0x55c7c41e8792, Backtrace.(printBacktrace in _B82A8C0ED7C904841114FDF244F9E58E)(signal: Swift.Int32) -> () at /tmp/build_113febab/.build/checkouts/swift-backtrace/Sources/Backtrace/Backtrace.swift:66
2022-04-20T06:15:51.189696+00:00 app[web.1]: 0x7f5735ce33bf
2022-04-20T06:15:51.189696+00:00 app[web.1]: 0x7f5735e67307
2022-04-20T06:15:51.189697+00:00 app[web.1]: 0x7f5735ed62d2
2022-04-20T06:15:51.189697+00:00 app[web.1]: 0x55c7c48aa527, main at /tmp/build_113febab/<compiler-generated>:0
2022-04-20T06:15:51.189698+00:00 app[web.1]: 0x7f5734f1f0b2
2022-04-20T06:15:51.189698+00:00 app[web.1]: 0x55c7c3fafead
2022-04-20T06:15:51.189698+00:00 app[web.1]: 0xffffffffffffffff
2022-04-20T06:15:51.318955+00:00 heroku[web.1]: Process exited with status 132
2022-04-20T06:15:51.366529+00:00 heroku[web.1]: State changed from starting to crashed
2022-04-20T06:15:54.612759+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=intense-journey-01336.herokuapp.com request_id=de9eeae6-ed50-46a7-8008-9e4c4937d71f fwd="49.156.46.15" dyno= connect= service= status=503 bytes= protocol=http

PostgresNIO.PSQLError可能与上载时出现的问题有关,编译器抱怨其中一个Postgres库中正在使用的方法:

[898/900] Compiling PostgresKit ConnectionPool+Postgres.swift
/tmp/build_4aa2d012/.build/checkouts/postgres-kit/Sources/PostgresKit/PostgresConnectionSource.swift:53:39: warning: 'connect(to:tlsConfiguration:serverHostname:logger:on:)' is deprecated: Use the new connect method that allows you to connect and authenticate in a single step
            return PostgresConnection.connect(
                                      ^
/tmp/build_4aa2d012/.build/checkouts/postgres-kit/Sources/PostgresKit/PostgresConnectionSource.swift:53:39: note: use 'connect(on:configuration:id:logger:)' instead
            return PostgresConnection.connect(
                                      ^~~~~~~
                                      connect
/tmp/build_4aa2d012/.build/checkouts/postgres-kit/Sources/PostgresKit/PostgresConnectionSource.swift:60:29: warning: 'authenticate(username:database:password:logger:)' is deprecated: Use the new connect method that allows you to connect and authenticate in a single step
                return conn.authenticate(
                            ^
/tmp/build_4aa2d012/.build/checkouts/postgres-kit/Sources/PostgresKit/PostgresConnectionSource.swift:60:29: note: use 'connect(on:configuration:id:logger:)' instead
                return conn.authenticate(
                            ^~~~~~~~~~~~
                            connect
[899/901] Compiling FluentPostgresDriver Exports.swift

有人能在这里提供任何上下文或解决方案吗?我的意图是现在运行没有SSL的暂存服务器,但我想知道这是否会有帮助,如果以上是问题,因为它出现在编译过程中...没有其他错误报告在推到Heroku,顺便说一句。

q1qsirdb

q1qsirdb1#

它是关于正确的数据库连接配置
在我们的例子中,我们在heroku上设置了数据库url
postgres://xxx:yyy@zzz.compute-1.amazonaws.com:5432/asdfasgsgbwev
tlsConfig.certificateVerification = .none

相关问题