Testing on Linux failed because of try! (force try)

I am following book but when I tried to test on linux on Mac using docker I get following error

wip-app_1 | Fatal error: ‘try!’ expression unexpectedly raised an error: NIO.ChannelError.connectFailed(NIO.NIOConnectionError(host: “localhost”, port: 5432, dnsAError: nil, dnsAAAAError: nil, connectionErrors: [NIO.SingleConnectionFailure(target: [IPv6]localhost:5432, error: connect(descriptor:addr:size:) failed: Cannot assign requested address (errno: 99) ), NIO.SingleConnectionFailure(target: [IPv4]localhost:5432, error: connection reset (error set): Connection refused (errno: 111) )])): file /home/buildnode/jenkins/workspace/oss-swift-4.1-package-linux-ubuntu-16_04/swift/stdlib/public/core/ErrorType.swift, line 184
wip-app_1 | Current stack trace:
wip-app_1 | 0 libswiftCore.so 0x00007f5d048205c0 _swift_stdlib_reportFatalErrorInFile + 221
wip-app_1 | 1 libswiftCore.so 0x00007f5d0458f3dc + 1369052
wip-app_1 | 2 libswiftCore.so 0x00007f5d047c9222 + 3703330
wip-app_1 | 3 libswiftCore.so 0x00007f5d047ca689 + 3708553
wip-app_1 | 4 libswiftCore.so 0x00007f5d0458ead6 + 1366742
wip-app_1 | 5 libswiftCore.so 0x00007f5d047c8feb + 3702763
wip-app_1 | 6 libswiftCore.so 0x00007f5d0458ead6 + 1366742
wip-app_1 | 7 libswiftCore.so 0x00007f5d046fbf79 + 2862969
wip-app_1 | 8 libswiftCore.so 0x00007f5d045cc810 swift_unexpectedError + 318
wip-app_1 | Exited with signal code 4

@apoorvmote that error means it’s trying to connect to a PostgresDB on localhost:5432 but can’t see anything

Got the same error and did not know what I missed. Just followed the chapter

BTW, I only installed Docker 18.06.1-ce-mac73 (26764) without VirtualBox

Ha, I got the answer: You should alter the hostname parameter when configure PostgreSQL in configure.swift

BTW, I got the answer in Vapor’s discord server, come and join us :slight_smile:

2 Likes