我把这些新信息放在前面:把我带到这一点的问题在下面。
这是我得到的,一旦我的应用程序部署到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推送期间没有报告其他错误。
关于正确的数据库连接配置
在heroku的例子中,我们设置了database url
postgres://xxx:yyy@zzz.compute-1.amazonaws.com:5432/asdfasgsgbwev
和tlsConfig.certificateVerification = .none