AWS deploy stats failed

I am trying to deploy the app to AWS and I followed all the steps in chapter 34. At the end, after I start and enable the services I ran systemctl status -l vapor-til.service and I got
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: vapor-til.service: Main process exited, code=dumped, status=4/ILL
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: vapor-til.service: Failed with result ‘core-dump’.
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: vapor-til.service: Service hold-off time over, scheduling restart.
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: vapor-til.service: Scheduled restart job, restart counter is at 5.
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: Stopped “Vapor TilApp”.
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: vapor-til.service: Start request repeated too quickly.
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: vapor-til.service: Failed with result ‘core-dump’.
Mar 04 01:37:21 ip-172-31-81-161 systemd[1]: Failed to start “Vapor TilApp”

After that I ran journalctl -xn

● vapor-til.service - “Vapor TilApp”
Loaded: loaded (/etc/systemd/system/vapor-til.service; enabled; vendor preset: enabled)
Active: failed (Result: core-dump) since Wed 2020-03-04 01:56:06 UTC; 28s ago
Main PID: 22603 (code=dumped, signal=ILL)

Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Main process exited, code=dumped, status=4/ILL
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Failed with result ‘core-dump’.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Service hold-off time over, scheduling restart.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Scheduled restart job, restart counter is at 5.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: Stopped “Vapor TilApp”.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Start request repeated too quickly.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Failed with result ‘core-dump’.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: Failed to start “Vapor TilApp”.
root@ip-172-31-81-161:~# journalctl -xn
– Logs begin at Tue 2020-03-03 12:05:37 UTC, end at Wed 2020-03-04 01:56:28 UTC. –
Mar 04 01:56:06 ip-172-31-81-161 kernel: traps: Run[22603] trap invalid opcode ip:7f47cb019580 sp:7ffcbe8b2d60 error:0 in libswiftCore.so[7f47cad11000+4
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Main process exited, code=dumped, status=4/ILL
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Failed with result ‘core-dump’.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Service hold-off time over, scheduling restart.
Mar 04 01:56:06 ip-172-31-81-161 systemd[1]: vapor-til.service: Scheduled restart job, restart counter is at 5.
– Subject: Automatic restarting of a unit has been scheduled
– Defined-By: systemd
– Support: Enterprise open source support | Ubuntu

It seems there is kernel trap. I repeated all the steps multiple times but still getting the same error.

@voyager that means the app crashes on launch. Does it work if you run it manually? I’m guessing it’s failing to connect to the database

@0xtim Correct when I try to run manually by replacing the databaseconfig properties with AWS RDS instance details app fails to launch. However I was able to connect AWS RDS instance using pg Admin 4.

PostgreSQL Error: database “vaportil” does not exist

- id: PostgreSQLError.server.fatal.InitPostgres

: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1100.8.280/swift/stdlib/public/core/ErrorType.swift, line 200

2020-03-12 07:49:12.545447-0400 Run[19187:809369] Fatal error: Error raised at top level: :warning: PostgreSQL Error: database “vaportil” does not exist

- id: PostgreSQLError.server.fatal.InitPostgres

: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1100.8.280/swift/stdlib/public/core/ErrorType.swift, line 200

Program ended with exit code: 9

What’s the name of the database and does the user you’re using for your Vapor application have access to it?

ahh… I got it. I confused between db instance name and dbname. And didn’t give the initial dbname while creating the db instance.

1 Like