A problem with Vapor app deployed to Heroku - swift

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?

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).

Related

Java Spring Boot Deployment with GitHub

If I build and deploy the code linked below through CLI it works successfully. It also builds and runs locally. I am trying to set it up to deploy through github, but when I do that I get an 'application error' when trying to access the page via the url. Looking at the logs, I don't think there are any errors from the build, but I do get the following message when I try to access the url:
at=error code=H14 desc="No web processes running" method=GET path="/" host=bug-tracker-url.herokuapp.com request_id=620ec127-49ea-4aea-8f0c-d1b228e6cb03 fwd="86.180.101.141" dyno= connect= service= status=503 bytes= protocol=https
This is the repo I'm trying to use to deploy:
https://github.com/jamesgiddings/bugtracker
I have tried running heroku ps:scale web=1 -a
This returns Couldn't find that process type
I did also try adding both jvm and java to the build packs. This allows me to run heroku ps:scale web=1 -a successfully, but then when I try to access the website I get
at=error code=H10 desc="App crashed" method=GET

Macos - Heroku error code H=10 (Twitter Opensea.io Sales Bot)

I'm facing the problem showing below on HEROKU. I'm using this GitHub Program (https://github.com/dsgriffin/opensea-sales-twitter-bot)
and deployed it 1:1 in Heroku. The current status is that the app is deployed, but I can't open the app. If I try, this message appears.
This is the message:
ug 17 03:50:12 kidpunksbot heroku/router at=error
code=H10 desc="App crashed" method=GET path="/favicon.ico"
host=kidpunksbot.herokuapp.com request_id=d146801e-6e51-424d-abe1-9b111d06b080
fwd="79.229.5.11" dyno= connect= service= status=503 bytes= protocol=https
check out the following service: https://nft-bots.io/

I cannot connect Postgres DB with Strapi on Heroku

I try to set up Strapi + PostgresDB on Heroku.
I follow this manual step by step https://strapi.io/documentation/3.0.0-beta.x/deployment/heroku.html
When I deploy to Heroku I get: Application error
heroku logs --tail shows
npm ERR! my-host-cms#0.1.0 start: `strapi start`
2020-06-09T14:54:44.272624+00:00 app[web.1]: npm ERR! Exit status 1
2020-06-09T14:54:44.272950+00:00 app[web.1]: npm ERR!
2020-06-09T14:54:44.273144+00:00 app[web.1]: npm ERR! Failed at the my-host-cms#0.1.0 start script.
2020-06-09T14:54:44.273335+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-06-09T14:54:44.289977+00:00 app[web.1]:
2020-06-09T14:54:44.290269+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-06-09T14:54:44.290445+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-06-09T14_54_44_278Z-debug.log
2020-06-09T14:54:44.353188+00:00 heroku[web.1]: Process exited with status 1
2020-06-09T14:54:44.386798+00:00 heroku[web.1]: State changed from starting to crashed
2020-06-09T14:54:44.388614+00:00 heroku[web.1]: State changed from crashed to starting
2020-06-09T14:55:01.903657+00:00 heroku[web.1]: Starting process with command `npm start`
2020-06-09T14:55:05.469266+00:00 app[web.1]:
2020-06-09T14:55:05.469295+00:00 app[web.1]: > my-host-cms#0.1.0 start /app
2020-06-09T14:55:05.469296+00:00 app[web.1]: > strapi start
2020-06-09T14:55:05.469296+00:00 app[web.1]:
2020-06-09T14:55:08.015032+00:00 app[web.1]: [2020-06-09T14:55:08.013Z] error The client `sqlite3` is not installed.
2020-06-09T14:55:08.015961+00:00 app[web.1]: [2020-06-09T14:55:08.015Z] error You can install it with `$ npm install sqlite3 --save`.
and
2020-06-09T14:55:09.623864+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=my-host.herokuapp.com request_id=eea79361-593f-413e-89e2-d99d0153ddf3 fwd="37.57.145.70" dyno= connect= service= status=503 bytes= protocol=https
2020-06-09T15:01:07.901262+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=my-host.herokuapp.com request_id=ce0353b0-5e45-422d-af43-f96614c8151d fwd="37.57.145.70" dyno= connect= service= status=503 bytes= protocol=https
I see it asks about sqlite3 but I have it package.json
The project was inited with --quickstart but I have made ./config/environments/production/database.json
If you installed strapi with the --quickstart flag then by default it would provision a SQLite db for you.
since you loading a db config for postpres, make sure you installed pg.
you can npm/yarn remove sqlite3 from your package.json if you not using it locally, ie.you have postgres installed and the service is running.
delete your cache folder and then npm run build
now push to heroku and open.
fyi. it is recommended that you have database.js over database.json
eg.
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'postgres',
host: env('DATABASE_HOST'),
port: env.int('DATABASE_PORT'),
database: env('DATABASE_NAME'),
username: env('DATABASE_USERNAME'),
password: env('DATABASE_PASSWORD'),
ssl: env.bool('DATABASE_SSL'),
},
options: {}
},
},
});
In Heroku make sure that the postgres addon is provisioned.
check your config vars in heroku for the app is correct.
also make sure ./config/database.js or ./config/database.json has also been corrected to use the correct database.

Akka app to Heroku getting error: Web process failed to bind to $PORT

Trying to deploy my Akka application to Heroku
In code I have:
val httpPort = Properties.envOrElse("PORT", "8080").toInt
val serverBinding: Future[Http.ServerBinding] = Http().bindAndHandle(routes,
"localhost", httpPort)
In Procfile I have:
web: target/universal/stage/bin/hello-world -Dhttp.port=${PORT}
But I still get in logs:
Error R10 (Boot timeout) ->
Web process failed to bind to $PORT within 60 seconds of launch
2019-04-11T11:22:30.239015+00:00 heroku[web.1]: Starting process with
command `target/universal/stage/bin/hello-world -Dhttp.port=${PORT}`
2019-04-11T11:22:32.322727+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS
defaults based on dyno size. Custom settings will override them.
2019-04-11T11:22:32.447725+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -
Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
2019-04-11T11:22:35.729346+00:00 app[web.1]: Server online at
http://127.0.0.1:19702/
2019-04-11T11:23:30.413620+00:00 heroku[web.1]: State changed from starting
to crashed
2019-04-11T11:23:30.306939+00:00 heroku[web.1]: **Error R10 (Boot timeout) ->
Web process failed to bind to $PORT within 60 seconds of launch**
2019-04-11T11:23:30.307058+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-04-11T11:23:30.395435+00:00 heroku[web.1]: Process exited with status
137
2019-04-11T11:23:31.907600+00:00 heroku[router]: at=error code=H10 desc="App
crashed" method=GET path="/" host=word-list-app.herokuapp.com
request_id=b1d988e1-f53a-4409-9546-75404a9fcd5c fwd="94.199.129.189" dyno=
connect= service= status=503 bytes= protocol=https
You should replace localhost with 0.0.0.0.

Deployed heroku postgrest + database keeps crashing

I am trying to deploy postgrest v 0.4.2.0 app (https://github.com/begriffs/postgrest/releases/tag/v0.4.2.0) on heroku according to this instruction:
https://postgrest.com/en/v3.2/admin_deployment.html#heroku (it's an older version, but viable in general instructions)
I already have a deployed database (via Heroku Postgres) with 1 table on my heroku account, so I keep trying to connect my DB with postgrest:
DB_URL: postgres://mpdwpnlqhwsosk:5abeb772ff431ef99e975be287970c3412174b331926b189d6485277f41d65d1#ec2-174-129-224-33.compute-1.amazonaws.com:5432/da5a8m1p77diab
And so, my app is just crashing (H10 error). I can't see table, etc. Although, I can successfully connect to this DB via pgAdmin
Is there I am doing something wrong, or is that some kind of nasty bug?
Logs:
2017-06-19T09:53:52.579013+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-19T09:53:52.568134+00:00 heroku[web.1]: Process exited with status 1
2017-06-19T10:38:45.049215+00:00 heroku[web.1]: State changed from crashed to starting
2017-06-19T10:38:45.838847+00:00 heroku[web.1]: Starting process with command ./env-to-config ./postgrest postgrest.conf
2017-06-19T10:38:47.811334+00:00 heroku[web.1]: Process exited with status 1
2017-06-19T10:38:47.752947+00:00 app[web.1]: ConfigError {configErrorLocation = Key "" "secret-is-base64", configConversionError = Just [ConversionError {conversionErrorLoc = "boolValue", conversionErrorWhy = TypeError, conversionErrorVal = Just (String "false"), conversionErrorType = Just Bool, conversionErrorMsg = Nothing}]}
2017-06-19T10:38:47.822918+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-19T11:04:22.519115+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=agile-mesa-95349.herokuapp.com request_id=7f7c6d70-c23b-400a-aec8-83758cb226cf fwd="109.184.214.45" dyno= connect= service= status=503 bytes= protocol=https
By the way, this probably should not have been downvoted. It looks like a manifestation of a bug that was recently fixed in https://github.com/begriffs/postgrest/pull/897
The fix is not yet part of a release, but will be in the next release.