Ilya Kharabet
Ilya Kharabet

Reputation: 4631

A problem with Vapor app deployed to Heroku

I've deployed my Vapor app to Heroku, but when I try to make a request, it fails with the error:

at=error code=H10 desc="App crashed" method=GET path="/feed" host=detect-api.herokuapp.com request_id=970e4005-58b0-4b34-8489-715dc9cd5e19 fwd="5.228.26.4" dyno= connect= service= status=503 bytes= protocol=https

Also, when I run this script - heroku ps:scale web=1, I get the next logs:

State changed from crashed to starting
State changed from starting to crashed

My Procfile contains the next code:

web: Run serve --env production --hostname 0.0.0.0 --port $PORT

In the configure.swift file I added this code:

let nioServerConfig = NIOServerConfig.default(
    hostname: "0.0.0.0",
    port: Int(Environment.get("PORT") ?? "") ?? 8080
)
services.register(nioServerConfig)

How to fix this issue?

Upvotes: 1

Views: 203

Answers (1)

Ilya Kharabet
Ilya Kharabet

Reputation: 4631

I've solved the problem by replacing SQLite with PostgreSQL. I didn't find any information about SQLite support on Heroku, but it seems like there is no support of this database (or I did something wrong).

Upvotes: 1

Related Questions