I cannot connect Postgres DB with Strapi on Heroku - postgresql

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.

Related

Application Error, heroku hosting, backend App

Guys i'm trying to make a hosting for my backend app, and this is the second time i do it, the problem is that, i have this error
And, i tried to log my app so i can see where is the error, and this appears
2021-03-21T18:22:21.067459+00:00 heroku[web.1]: Starting process with command `npm run start`
2021-03-21T18:22:25.290401+00:00 app[web.1]:
2021-03-21T18:22:25.290415+00:00 app[web.1]: > server#1.0.0 start /app
2021-03-21T18:22:25.290416+00:00 app[web.1]: > nodemon index.js
2021-03-21T18:22:25.290416+00:00 app[web.1]:
2021-03-21T18:22:25.316554+00:00 app[web.1]: sh: 1: nodemon: not found
2021-03-21T18:22:25.362375+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-21T18:22:25.363310+00:00 app[web.1]: npm ERR! syscall spawn
2021-03-21T18:22:25.364814+00:00 app[web.1]: npm ERR! file sh
2021-03-21T18:22:25.365654+00:00 app[web.1]: npm ERR! errno ENOENT
2021-03-21T18:22:25.388201+00:00 app[web.1]: npm ERR! server#1.0.0 start: `nodemon index.js`
2021-03-21T18:22:25.388571+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-03-21T18:22:25.389012+00:00 app[web.1]: npm ERR!
2021-03-21T18:22:25.389281+00:00 app[web.1]: npm ERR! Failed at the
server#1.0.0 start script.
2021-03-21T18:22:25.389521+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-21T18:22:25.400950+00:00 app[web.1]:
2021-03-21T18:22:25.401357+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-21T18:22:25.401620+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-21T18_22_25_390Z-debug.log
2021-03-21T18:22:25.500796+00:00 heroku[web.1]: Process exited with
status 1
2021-03-21T18:22:25.573335+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-21T18:22:25.576936+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-21T18:22:28.365986+00:00 heroku[web.1]: Starting process with command `npm run start`
2021-03-21T18:22:30.896431+00:00 app[web.1]:
2021-03-21T18:22:30.896468+00:00 app[web.1]: > server#1.0.0 start /app
2021-03-21T18:22:30.896468+00:00 app[web.1]: > nodemon index.js
2021-03-21T18:22:30.896468+00:00 app[web.1]:
2021-03-21T18:22:30.907038+00:00 app[web.1]: sh: 1: nodemon: not found
2021-03-21T18:22:30.919190+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-21T18:22:30.919692+00:00 app[web.1]: npm ERR! syscall spawn
2021-03-21T18:22:30.919949+00:00 app[web.1]: npm ERR! file sh
2021-03-21T18:22:30.920239+00:00 app[web.1]: npm ERR! errno ENOENT
2021-03-21T18:22:30.927062+00:00 app[web.1]: npm ERR! server#1.0.0 start: `nodemon index.js`
2021-03-21T18:22:30.927284+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-03-21T18:22:30.927492+00:00 app[web.1]: npm ERR!
2021-03-21T18:22:30.927684+00:00 app[web.1]: npm ERR! Failed at the
server#1.0.0 start script.
2021-03-21T18:22:30.927851+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-21T18:22:30.963521+00:00 app[web.1]:
2021-03-21T18:22:30.963855+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-21T18:22:30.964051+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-21T18_22_30_928Z-debug.log
2021-03-21T18:22:31.015557+00:00 heroku[web.1]: Process exited with
status 1
2021-03-21T18:22:31.101810+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-21T18:22:44.381282+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=daily-mern.herokuapp.com
request_id=836abccf-8d2c-432d-a50f-53810887e9ad fwd="177.254.11.56"
dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:22:48.388632+00:00 heroku[router]: at=error code=H10 d
PS C:\Users\diego cifuentes\Desktop\Portafolio\Fullstack Projects\Daily App - MERN\server> heroku restartRestarting dynos on ⬢ daily-mern... done
PS C:\Users\diego cifuentes\Desktop\Portafolio\Fullstack Projects\Daily App - MERN\server> heroku logs --tail --app daily-mern
2021-03-21T18:15:05.905941+00:00 app[api]: Initial release by user diegodarkusgamer24#gmail.com
2021-03-21T18:15:05.905941+00:00 app[api]: Release v1 created by user diegodarkusgamer24#gmail.com
2021-03-21T18:15:06.053078+00:00 app[api]: Release v2 created by user diegodarkusgamer24#gmail.com
2021-03-21T18:15:06.053078+00:00 app[api]: Enable Logplex by user diegodarkusgamer24#gmail.com
2021-03-21T18:21:59.000000+00:00 app[api]: Build started by user diegodarkusgamer24#gmail.com
2021-03-21T18:22:16.855697+00:00 app[api]: Deploy 81dac1f3 by user diegodarkusgamer24#gmail.com
2021-03-21T18:22:16.855697+00:00 app[api]: Release v3 created by user diegodarkusgamer24#gmail.com
2021-03-21T18:22:16.875164+00:00 app[api]: Scaled to web#1:Free by user diegodarkusgamer24#gmail.com
2021-03-21T18:22:17.000000+00:00 app[api]: Build succeeded
2021-03-21T18:22:21.067459+00:00 heroku[web.1]: Starting process with command `npm run start`
2021-03-21T18:22:25.290401+00:00 app[web.1]:
2021-03-21T18:22:25.290415+00:00 app[web.1]: > server#1.0.0 start /app
2021-03-21T18:22:25.290416+00:00 app[web.1]: > nodemon index.js
2021-03-21T18:22:25.290416+00:00 app[web.1]:
2021-03-21T18:22:25.316554+00:00 app[web.1]: sh: 1: nodemon: not found
2021-03-21T18:22:25.362375+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-21T18:22:25.363310+00:00 app[web.1]: npm ERR! syscall spawn
2021-03-21T18:22:25.364814+00:00 app[web.1]: npm ERR! file sh
2021-03-21T18:22:25.365654+00:00 app[web.1]: npm ERR! errno ENOENT
2021-03-21T18:22:25.388201+00:00 app[web.1]: npm ERR! server#1.0.0 start: `nodemon index.js`
2021-03-21T18:22:25.388571+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-03-21T18:22:25.389012+00:00 app[web.1]: npm ERR!
2021-03-21T18:22:25.389281+00:00 app[web.1]: npm ERR! Failed at the
server#1.0.0 start script.
2021-03-21T18:22:25.389521+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-21T18:22:25.400950+00:00 app[web.1]:
2021-03-21T18:22:25.401357+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-21T18:22:25.401620+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-21T18_22_25_390Z-debug.log
2021-03-21T18:22:25.500796+00:00 heroku[web.1]: Process exited with
status 1
2021-03-21T18:22:25.573335+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-21T18:22:25.576936+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-21T18:22:28.365986+00:00 heroku[web.1]: Starting process with command `npm run start`
2021-03-21T18:22:30.896431+00:00 app[web.1]:
2021-03-21T18:22:30.896468+00:00 app[web.1]: > server#1.0.0 start /app
2021-03-21T18:22:30.896468+00:00 app[web.1]: > nodemon index.js
2021-03-21T18:22:30.896468+00:00 app[web.1]:
2021-03-21T18:22:30.907038+00:00 app[web.1]: sh: 1: nodemon: not found
2021-03-21T18:22:30.919190+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-21T18:22:30.919692+00:00 app[web.1]: npm ERR! syscall spawn
2021-03-21T18:22:30.919949+00:00 app[web.1]: npm ERR! file sh
2021-03-21T18:22:30.920239+00:00 app[web.1]: npm ERR! errno ENOENT
2021-03-21T18:22:30.927062+00:00 app[web.1]: npm ERR! server#1.0.0 start: `nodemon index.js`
2021-03-21T18:22:30.927284+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-03-21T18:22:30.927492+00:00 app[web.1]: npm ERR!
2021-03-21T18:22:30.927684+00:00 app[web.1]: npm ERR! Failed at the
server#1.0.0 start script.
2021-03-21T18:22:30.927851+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-21T18:22:30.963521+00:00 app[web.1]:
2021-03-21T18:22:30.963855+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-21T18:22:30.964051+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-21T18_22_30_928Z-debug.log
2021-03-21T18:22:31.015557+00:00 heroku[web.1]: Process exited with
status 1
2021-03-21T18:22:31.101810+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-21T18:22:44.381282+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=daily-mern.herokuapp.com
request_id=836abccf-8d2c-432d-a50f-53810887e9ad fwd="177.254.11.56"
dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:22:48.388632+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=daily-mern.herokuapp.com request_id=4872869b-653b-411c-8041-6c74f2c933d1 fwd="177.254.11.56" dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:23:28.033455+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=daily-mern.herokuapp.com
request_id=938148d2-e2b9-44ec-b0e3-7c36a15c30bb fwd="177.254.11.56"
dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:23:32.633910+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=daily-mern.herokuapp.com request_id=12ce541f-e48b-43f0-895f-4987388d0918 fwd="177.254.11.56" dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:33:27.499912+00:00 heroku[web.1]: State changed from crashed to starting
2021-03-21T18:33:30.454323+00:00 heroku[web.1]: Starting process with command `npm run start`
2021-03-21T18:33:33.252960+00:00 app[web.1]:
2021-03-21T18:33:33.252982+00:00 app[web.1]: > server#1.0.0 start /app
2021-03-21T18:33:33.252982+00:00 app[web.1]: > nodemon index.js
2021-03-21T18:33:33.252983+00:00 app[web.1]:
2021-03-21T18:33:33.265627+00:00 app[web.1]: sh: 1: nodemon: not found
2021-03-21T18:33:33.280021+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-03-21T18:33:33.280574+00:00 app[web.1]: npm ERR! syscall spawn
2021-03-21T18:33:33.280907+00:00 app[web.1]: npm ERR! file sh
2021-03-21T18:33:33.281222+00:00 app[web.1]: npm ERR! errno ENOENT
2021-03-21T18:33:33.289740+00:00 app[web.1]: npm ERR! server#1.0.0 start: `nodemon index.js`
2021-03-21T18:33:33.290008+00:00 app[web.1]: npm ERR! spawn ENOENT
2021-03-21T18:33:33.290328+00:00 app[web.1]: npm ERR!
2021-03-21T18:33:33.290552+00:00 app[web.1]: npm ERR! Failed at the
server#1.0.0 start script.
2021-03-21T18:33:33.290851+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-03-21T18:33:33.303493+00:00 app[web.1]:
2021-03-21T18:33:33.304537+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-03-21T18:33:33.304746+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-03-21T18_33_33_292Z-debug.log
2021-03-21T18:33:33.372157+00:00 heroku[web.1]: Process exited with
status 1
2021-03-21T18:33:33.483971+00:00 heroku[web.1]: State changed from starting to crashed
2021-03-21T18:35:58.992675+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=daily-mern.herokuapp.com
request_id=af1f361c-1574-4a32-8f68-a7f0830c007a fwd="177.254.11.56"
dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:36:01.295985+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=daily-mern.herokuapp.com request_id=759fada6-a151-4bdd-8689-5eab38ceaf35 fwd="177.254.11.56" dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:36:27.162149+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=daily-mern.herokuapp.com
request_id=a44bcfca-29b0-4264-bc39-878747caad85 fwd="177.254.11.56"
dyno= connect= service= status=503 bytes= protocol=https
2021-03-21T18:36:30.775177+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=daily-mern.herokuapp.com request_id=ea89bde9-0278-4ded-b9e9-95925bef286b fwd="177.254.11.56" dyno= connect= service= status=503 bytes= protocol=https
I don't understand anything, what is goin on? how can i fix that?
This is my index of my backend, i'm working with node, express and mongoDB
import express from "express";
import mongoose from "mongoose";
import cors from "cors";
import dotenv from "dotenv";
import rooms from "./routes/rooms.js";
import user from "./routes/user.js";
import tasks from "./routes/tasks.js";
dotenv.config();
const PORT = process.env.PORT || 5000;
const app = express();
app.use(express.json({ limit: "20mb", extended: true }));
app.use(express.urlencoded({ limit: "20mb", extended: true }));
app.use(cors());
app.use("/rooms", rooms);
app.use("/tasks", tasks);
app.use("/user", user);
app.get("/", (req, res) => {
res.send("");
});
mongoose.connect(process.env.MONGODB, {
useNewUrlParser: true,
useUnifiedTopology: true,
dbName: "Daily-App"
});
mongoose.set("useFindAndModify", false);
app.listen(PORT, () => {
console.log("Server Working Succesfully");
});
My procfile
web: npm run start
My package json
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"start": "nodemon index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.11.19"
}
}
If you know what's going on, i would love to read your answer, thank your for your time comunnity !
Add node version to your package.json: "engines": { "node": "v15.10.0" }
Change the "start" script from "nodemon server.js" to "node server.js". If you want to use nodemone locally, add one more script like : "dev": "nodemon server.js" and use npm run dev to start the server locally.
You must push your .env to your heroku server also.
Check if you .env file is being ignored in .gitignore.
ps: package.json: I don't see "nodemon" in your "dependencies".
did you installed it? If you installed it, it should be there like : "nodemon": "^2.0.7" or if you installed it with npm i --save-dev: "devDependencies": { "nodemon": "^2.0.7" }
Wish this help you.

Strapi deployed to Heroku is crashing in production?

I've got an app where the frontend is deployed to Netlify and the Strapi backend is deployed to Heroku. I recently upgraded Strapi from v3.0.6 to v3.1.3. I was previously using PostgresQL in production, so along with the Strapi upgrade I also am attempting to move over to MongoDB.
I'm attempting to deploy my backend to production, however I keep receiving a 503 error and the app crashes. You can see from the error logs below that there is an issue connecting to the Mongo database.
Here are my relevant logs from Heroku:
2020-08-06T15:06:49.848463+00:00 app[web.1]: > backend#0.1.0 start /app
2020-08-06T15:06:49.848464+00:00 app[web.1]: > strapi start
2020-08-06T15:06:49.848465+00:00 app[web.1]:
2020-08-06T15:06:52.238840+00:00 app[web.1]: (node:23) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
2020-08-06T15:06:52.238869+00:00 app[web.1]: (Use `node --trace-warnings ...` to show where the warning was created)
2020-08-06T15:06:52.239130+00:00 app[web.1]: (node:23) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
2020-08-06T15:06:52.239199+00:00 app[web.1]: (node:23) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
2020-08-06T15:06:52.239276+00:00 app[web.1]: (node:23) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
2020-08-06T15:07:10.279519+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=<app-name>.herokuapp.com request_id=9e81f113-1003-42f7-82e7-59296dc1f0f8 fwd="24.19.220.31" dyno= connect= service= status=503 bytes= protocol=https
2020-08-06T15:07:22.242572+00:00 app[web.1]: [2020-08-06T15:07:22.241Z] debug ⛔️ Server wasn't able to start properly.
2020-08-06T15:07:22.243944+00:00 app[web.1]: [2020-08-06T15:07:22.243Z] error Error connecting to the Mongo database. Server selection timed out after 30000 ms
2020-08-06T15:07:22.266318+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-08-06T15:07:22.266611+00:00 app[web.1]: npm ERR! errno 1
2020-08-06T15:07:22.269156+00:00 app[web.1]: npm ERR! backend#0.1.0 start: `strapi start`
2020-08-06T15:07:22.269330+00:00 app[web.1]: npm ERR! Exit status 1
2020-08-06T15:07:22.269513+00:00 app[web.1]: npm ERR!
2020-08-06T15:07:22.269976+00:00 app[web.1]: npm ERR! Failed at the backend#0.1.0 start script.
2020-08-06T15:07:22.270129+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-08-06T15:07:22.278069+00:00 app[web.1]:
2020-08-06T15:07:22.278314+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-08-06T15:07:22.278417+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-08-06T15_07_22_271Z-debug.log
2020-08-06T15:07:22.355748+00:00 heroku[web.1]: Process exited with status 1
2020-08-06T15:07:22.394507+00:00 heroku[web.1]: State changed from starting to crashed
2020-08-06T15:07:23.802505+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=<app-name>.herokuapp.com request_id=f5876daf-f945-46b8-88c0-08a61106cfc5 fwd="24.19.220.31" dyno= connect= service= status=503 bytes= protocol=https
I've got the Mongo URI env variable set in Heroku and the app runs fine locally. I'm using Mongo Atlas in the free tier, so I'm wondering if that has something to do with it? Does anyone have any ideas what could be the issue?
I spent 24 hours attempting to fix it before making this post, and just like that - a half hour after making this post - I fixed it, thanks to this SO answer. I needed to whitelist the IP address in order to allow the connection between MongoDB and Heroku!

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.

Deploying Vapor with heroku

I have created a very simple app with one route in main.swift. It reads a city from a query string and use it to get the weather (through the yahoo API) of that city. this is the route:
drop.get("whether") { request in
guard let city = request.data["city"]?.string else {
return try JSON(node: ["Error": "no city given"])
}
return try drop.client.get("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22\(city)%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")
}
The code works perfectly when I run it on localhost, but I get a 500 error when I deploy it with Heroku.
Is there any file that I shouldn't be pushing to heroku? I want to note that in server.json the host value is 0.0.0.0.
This is my Heroku logs (note that I redeployed it multiple times. all of which didn't work):
2017-01-05T17:00:28.932559+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=10bd5717-a444-4106-9479-5dda7de686d1 fwd="94.77.202.2" dyno=web.1 connect=1ms service=24ms status=500 bytes=138
2017-01-05T17:00:34.568980+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=88277ee9-5814-4e33-a180-69e2a36a10ac fwd="94.77.202.2" dyno=web.1 connect=0ms service=2ms status=404 bytes=161
2017-01-05T17:00:50.620499+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=e9e03939-3252-4eb2-ba05-ed06b7123fc0 fwd="94.77.202.2" dyno=web.1 connect=0ms service=20ms status=500 bytes=138
2017-01-05T17:03:30.089070+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=d3334e79-bdaf-4f51-a6fe-198a356c2c8a fwd="94.77.202.2" dyno=web.1 connect=0ms service=31ms status=500 bytes=138
2017-01-05T17:03:41.773239+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=cb0f1bca-7538-497b-b1f2-6af9756c80f4 fwd="94.77.202.2" dyno=web.1 connect=2ms service=6ms status=503 bytes=0
2017-01-05T17:03:41.855395+00:00 heroku[web.1]: State changed from up to crashed
2017-01-05T17:03:41.856485+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-05T17:03:41.842156+00:00 heroku[web.1]: Process exited with status 132
2017-01-05T17:03:45.147623+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=25036`
2017-01-05T17:03:48.789403+00:00 heroku[web.1]: State changed from starting to up
2017-01-05T17:04:29.863680+00:00 heroku[router]: at=info method=GET path="/" host=dry-beyond-95031.herokuapp.com request_id=82133ef0-4539-4095-b3a9-e4d0c4bc709c fwd="94.77.202.2" dyno=web.1 connect=0ms service=5ms status=404 bytes=119
2017-01-05T17:04:38.544040+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=258ab0c8-df6e-4ad2-a220-cb27f854a1bd fwd="94.77.202.2" dyno=web.1 connect=0ms service=2ms status=404 bytes=119
2017-01-05T17:05:43.705482+00:00 heroku[web.1]: Process exited with status 132
2017-01-05T17:05:43.718722+00:00 heroku[web.1]: State changed from up to crashed
2017-01-05T17:05:43.608207+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=1a343b3b-963e-45b0-9795-1f83351b0100 fwd="94.77.202.2" dyno=web.1 connect=1ms service=6ms status=503 bytes=0
2017-01-05T17:08:54.112283+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=5fcfc4a8-d8da-4e45-b8d1-99a8c14c1529 fwd="94.77.202.2" dyno= connect= service= status=503 bytes=
2017-01-05T17:10:34.292205+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=75035a40-c1ca-4fc9-8cd1-10f73c5a4b84 fwd="94.77.202.2" dyno= connect= service= status=503 bytes=
2017-01-05T17:17:45.483824+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-05T17:17:45.483833+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-05T17:17:45.350717+00:00 app[api]: Deploy c3d8250 by user naifdev#gmail.com
2017-01-05T17:17:45.350717+00:00 app[api]: Release v4 created by user naifdev#gmail.com
2017-01-05T17:17:45.706244+00:00 heroku[web.1]: State changed from crashed to starting
2017-01-05T17:17:48.678813+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=53088`
2017-01-05T17:17:52.352793+00:00 heroku[web.1]: State changed from starting to up
2017-01-05T17:18:25.670087+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=9cec4496-95c5-4157-8dea-002310af4eaf fwd="94.77.202.2" dyno=web.1 connect=1ms service=27ms status=500 bytes=138
2017-01-05T17:51:55.253360+00:00 heroku[web.1]: Idling
2017-01-05T17:51:55.254766+00:00 heroku[web.1]: State changed from up to down
2017-01-05T17:51:55.780574+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-05T17:51:55.780578+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:53088
2017-01-05T17:51:55.780562+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-05T17:51:55.780575+00:00 app[web.1]: No preparations.
2017-01-05T17:51:55.780579+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-05T17:51:55.774837+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-05T17:51:55.895627+00:00 heroku[web.1]: Process exited with status 15
2017-01-05T18:01:48.893674+00:00 heroku[web.1]: Unidling
2017-01-05T18:01:48.893975+00:00 heroku[web.1]: State changed from down to starting
2017-01-05T18:01:53.364634+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=21483`
2017-01-05T18:01:57.090891+00:00 heroku[web.1]: State changed from starting to up
2017-01-05T18:01:58.019181+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=ed174181-b3c9-4196-bd39-29121c343ea6 fwd="94.77.202.2" dyno=web.1 connect=0ms service=41ms status=500 bytes=138
2017-01-05T18:34:12.945697+00:00 heroku[web.1]: Idling
2017-01-05T18:34:12.946307+00:00 heroku[web.1]: State changed from up to down
2017-01-05T18:34:13.855518+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-05T18:34:13.855528+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-05T18:34:13.855529+00:00 app[web.1]: No preparations.
2017-01-05T18:34:13.855530+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:21483
2017-01-05T18:34:13.855531+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-05T18:34:13.848202+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-05T18:34:13.932737+00:00 heroku[web.1]: Process exited with status 15
2017-01-06T07:44:31.444744+00:00 heroku[web.1]: Unidling
2017-01-06T07:44:31.444992+00:00 heroku[web.1]: State changed from down to starting
2017-01-06T07:44:34.523300+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=31252`
2017-01-06T07:44:36.676936+00:00 heroku[web.1]: State changed from starting to up
2017-01-06T07:44:37.549125+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=0355d39f-cda9-4f8b-888b-18082332a824 fwd="94.99.227.109" dyno=web.1 connect=0ms service=26ms status=500 bytes=138
2017-01-06T07:50:51.627447+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=11ee0882-1bd1-43a2-a0cc-4bc1c11f74eb fwd="94.99.227.109" dyno=web.1 connect=0ms service=27ms status=500 bytes=138
2017-01-06T07:57:45.954329+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=e4ca9186-fdc5-4cd8-b98b-cfee45c7f3b2 fwd="94.99.227.109" dyno=web.1 connect=0ms service=213ms status=500 bytes=138
2017-01-06T08:04:00.591772+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=b664a4c2-5aef-43b8-9c9f-180dfabeb93d fwd="94.99.227.109" dyno=web.1 connect=0ms service=23ms status=500 bytes=138
2017-01-06T08:04:57.818556+00:00 heroku[router]: at=info method=GET path="/" host=dry-beyond-95031.herokuapp.com request_id=4ea215b8-a0a3-4ad0-9d8a-45fe27dbafd0 fwd="94.99.227.109" dyno=web.1 connect=0ms service=4ms status=404 bytes=119
2017-01-06T08:04:58.069106+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=dry-beyond-95031.herokuapp.com request_id=04affbf0-ded7-4eb1-845c-e569aa31107c fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=161
2017-01-06T08:05:26.089377+00:00 heroku[router]: at=info method=POST path="/whether" host=dry-beyond-95031.herokuapp.com request_id=3c5ba6df-acec-4b27-a3f4-e3c0f27941c2 fwd="94.99.227.109" dyno=web.1 connect=0ms service=400ms status=500 bytes=138
2017-01-06T08:05:32.043519+00:00 heroku[router]: at=info method=GET path="/" host=dry-beyond-95031.herokuapp.com request_id=9d35561a-633b-42c9-8fb6-6ec423bf667c fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=119
2017-01-06T08:05:40.163170+00:00 heroku[router]: at=info method=GET path="/huguh" host=dry-beyond-95031.herokuapp.com request_id=7a11db63-7644-4e42-a662-e223cb154171 fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=119
2017-01-06T08:13:43.406289+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=f672e00b-db30-484c-a5da-01f8e57022f4 fwd="94.99.227.109" dyno=web.1 connect=0ms service=2ms status=404 bytes=161
2017-01-06T08:13:55.835147+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=adb06e24-72cc-4b79-9d23-8a5ea127d2a3 fwd="94.99.227.109" dyno=web.1 connect=0ms service=1ms status=404 bytes=161
2017-01-06T08:45:25.599867+00:00 heroku[web.1]: Idling
2017-01-06T08:45:25.600941+00:00 heroku[web.1]: State changed from up to down
2017-01-06T08:45:26.264901+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-06T08:45:26.280223+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-06T08:45:26.280240+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-06T08:45:26.280241+00:00 app[web.1]: No preparations.
2017-01-06T08:45:26.280241+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:31252
2017-01-06T08:45:26.280242+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280243+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280244+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280244+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280245+00:00 app[web.1]: unable to load path
2017-01-06T08:45:26.280246+00:00 app[web.1]: [deprecated] Mozilla certificates have been deprecated and will be removed in future releases. Using 'defaults' instead.
2017-01-06T08:45:26.280246+00:00 app[web.1]: unable to load path
2017-01-06T08:45:26.369735+00:00 heroku[web.1]: Process exited with status 15
2017-01-06T18:01:52.724336+00:00 heroku[web.1]: Unidling
2017-01-06T18:01:52.724823+00:00 heroku[web.1]: State changed from down to starting
2017-01-06T18:01:56.197941+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=51652`
2017-01-06T18:01:59.779285+00:00 heroku[web.1]: State changed from starting to up
2017-01-06T18:02:00.857405+00:00 heroku[router]: at=info method=GET path="/whether" host=dry-beyond-95031.herokuapp.com request_id=39353fc7-8f70-49b4-95b0-12b4f2e0980a fwd="94.99.227.109" dyno=web.1 connect=1ms service=4ms status=404 bytes=161
2017-01-06T18:36:26.460178+00:00 heroku[web.1]: Idling
2017-01-06T18:36:26.460594+00:00 heroku[web.1]: State changed from up to down
2017-01-06T18:36:27.237564+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-01-06T18:36:27.390324+00:00 heroku[web.1]: Process exited with status 15
2017-01-06T18:36:27.262126+00:00 app[web.1]: Production mode enabled, disabling informational logs.
2017-01-06T18:36:27.262141+00:00 app[web.1]: No command supplied, defaulting to serve...
2017-01-06T18:36:27.262142+00:00 app[web.1]: No preparations.
2017-01-06T18:36:27.262143+00:00 app[web.1]: Server 'default' starting at 0.0.0.0:51652
2017-01-06T19:13:59.497901+00:00 heroku[slug-compiler]: Slug compilation started
2017-01-06T19:13:59.497911+00:00 heroku[slug-compiler]: Slug compilation finished
2017-01-06T19:13:59.336403+00:00 app[api]: Deploy fa16ad6 by user naifdev#gmail.com
2017-01-06T19:13:59.336403+00:00 app[api]: Release v5 created by user naifdev#gmail.com
2017-01-06T19:13:59.722058+00:00 heroku[web.1]: State changed from down to starting
2017-01-06T19:14:02.835500+00:00 heroku[web.1]: Starting process with command `App --env=production --workdir=./ --config:servers.default.port=8308`
2017-01-06T19:14:06.609232+00:00 heroku[web.1]: State changed from starting to up
2017-01-06T19:14:38.480190+00:00 heroku[router]: at=info method=GET path="/whether?city=Paris" host=dry-beyond-95031.herokuapp.com request_id=26c5f8bb-eb3b-47be-8fd2-799dfc4aed66 fwd="94.99.227.109" dyno=web.1 connect=1ms service=24ms status=500 bytes=138
2017-01-06T19:17:53.744114+00:00 heroku[router]: at=info method=GET path="/whether?city=Paris" host=dry-beyond-95031.herokuapp.com request_id=8414a869-8d81-480a-8a74-51cfb3644bbf fwd="94.99.227.109" dyno=web.1 connect=1ms service=221ms status=500 bytes=138
2017-01-06T19:18:06.721140+00:00 heroku[router]: at=info method=GET path="/whether?city=Paris" host=dry-beyond-95031.herokuapp.com request_id=04a1b568-bfe1-4643-9a34-fce7b23eb325 fwd="94.99.227.109" dyno=web.1 connect=1ms service=22ms status=500 bytes=138
A user in the Slack channel gave me insight to this problem.:
VZSG:
#animatronicgopher: experimenting on Heroku is cheap but it's pretty pointless to scale up to paid dynos just because of this. It does not make a difference – first, this error is generated by an HTTP client, so your server's certificate doesn't matter, and second, even free dynos have proper certs (and they aren't just letsencrypt certs either). What you probably found is for custom domains.
The actual problem is that the "default" HTTPClient does not care about the dyno's trusted root certificates, therefore the outgoing SSL connection cannot be verified -> error.
Also, there's an issue in GitHub that gives you a sample of how to use FoundationClient.
https://github.com/vapor/vapor/issues/699
How to create swift backend API with help of Vapor framework. Another framework is also available in the market. But we are choosing swift vapor.
Let’s start.
Install vapor in your system.
Step 1. Run below command to install vapor
brew install vapor/tap/vapor-beta
Check whether vapor install or not run below command.
vapor-beta --help
These will be useful command of vapor.
Command only when you are in the project directory.
You can
Created vapor project
vapor new myProjectName
Build vapor project
vapor build
Run vapor project
vapor run
You can configure Xcode. You should be inside the created project directory.
vapor Xcode
When you have made changes in project file or add a new features for the update you have below command.
vapor Xcode
You can run thru local server test API. Out will be “Hello World”
curl http://localhost:8080/hello
===========================================PostgreSQL Setup================================================
Setting Up for local PrortgeSQL. Run below command.
Brew install postgresql
Start local database server. Run below command
pg_ctl -D /usr/local/var/postgres start
Stop local database server. Run below command.
pg_ctl -D /usr/local/var/postgres stop
When yow wish to run PostgreSQL as background service with launch you can use brew server. Run below command.
brew services start postgresql
Let start Postgres the by this.
psql -d postgres
Create data base by running below command:
create databas databaseName
Actual command
create databas ashi-app
create user by running below command:- Grant that user the privileges it need with by running below command.
create user username
Actual command
create user ashi-app-user
grant all privileges on database databaseName to userName
Actual command
grant all privileges on database ashi-app to ashi-app-user
===========================================PostgreSQL Setup================================================
===========================================Deploy fresh app on Heroku================================================
Deploy new swift vapor app on Heroku without database.
Consider you already created a Vapor project without the database.
Step 1. Navigate on cd MyApp.
cd myApp
Actual command
cd ashi-api
Step 2. Create a swift version file inside your root project directory. Run below on the terminal.
echo ’5.1.3’ > .swift-version
Step 3. Create Procfile file inside your root project directory.Run below on terminal.
echo ‘web: Run serve --env production --port $PORT --hostname 0.0.0.0’ > Procfile
Step 4. Add file git and commit by below command
git add .
git commit -m ‘App Setup’
Step 5. You should generate linux tests file by below command.
swift test --generate-linuxmain
Step 6. Add again modified in git by below command.
git add .
git commit -m ‘Tests setup’
Step 7. Login on Heroku. Required to create app on heroku for deployment. So we have login on heruko. By running below command we can login.
heroku login
Step 8. Once login done create heroku app. Name must we unique most prefer is app-appname.
heroku apps: create myAppName
Actual command
heroku apps: create ashi-api
Step 9. Add swift build pack with app. For compiling on hereto we have to add buildback. Heroku doesn’t support inbuild pack for swift.
heroku buildpacks:set https://github.com/vapor-community/heroku-buildpack -a myproject
Actual command
heroku buildpacks:set https://github.com/vapor-community/heroku-buildpack -a ashi-api
Step 10. Find command push changes on sever.
git push heroku master
Now you app and API will available for testing…
===========================================Deploy fresh app on Heroku================================================
======================Set data base with deployed app and next version of deployment==================================
Step 1. Do database configuration. Replace sqlite database with postgreSQL. Because Heroku is not supporting sqlite.
Replace in App->configure.swift. and import in Todo.h TodoController.h
import FluentPostgreSQL
// Configure a PostgreSQL database
let postgreSQLConfig: PostgreSQLDatabaseConfig
if let url = Environment.get("DATABASE_URL") {
postgreSQLConfig = PostgreSQLDatabaseConfig(url: url)!
} else {
postgreSQLConfig = PostgreSQLDatabaseConfig(hostname: "localhost", username: "app_test")
}
let postgreSQL = PostgreSQLDatabase(config: postgreSQLConfig)
// Register the configured PostreSQL database to the database config.
var databases = DatabasesConfig()
databases.add(database: postgreSQL, as: .psql)
services.register(databases)
Step 2. Install the heroku command with home-brew by running.
brew tap heroic/brew && brew install heroku
Step 3. We can add postgreSQL in app by running command.
heroic addons:create heroic-postgresql:hobby-dev
Step 4. Add update file in git by running below command.
git add .
git commit -m ‘Added PostgreSQL file’
Step 5. Find command push changes on sever.
git push heroku master
The second version will be available for testing with postgreSQL.
======================Set data base with deployed app and next version of deployment==================================
====================== Testing application API ==================================
Step 1. Heroku API path will be. Your https://app-name.herokoapp.com/youapIURL.
Heroku deployed app name
Sample get
apiURL
Data get request
apiURL
Post request from postman.
apiURL
Follow link.
Run get command on terminal.
curl apiURL
Run post command on terminal.
curl -x POST -H “ContentType” : application/json -d ‘{“title:exaple”}’ apiURL
====================== Testing application API ==================================
====================== Other important git and hero log command ==================================
Add local repository to heroku.
git remote add heroku appPath
See remote push and get repository path.
git remote -v
See heroku apps
heroku apps
See heroku application log
Number of line
heroku logs -n 100
heroku logs
heroku logs -trail
====================== Other important git and hero log command ==================================

Rails 3.2, Heroku - can't display my page - error 500

Whole day I am struggling with the deployment of my app to Heroku. Still getting there the error 500, specifically this is the output from log:
2012-03-09T16:56:25+00:00 app[web.1]: [DEPRECATION] Paperclip::Attachment.interpolations is deprecated and will be removed from future versions. Use Paperclip.interpolates instead
2012-03-09T16:56:28+00:00 app[web.1]: >> Thin web server (v1.3.1 codename Triple Espresso)
2012-03-09T16:56:28+00:00 app[web.1]: >> Maximum connections set to 1024
2012-03-09T16:56:28+00:00 app[web.1]: >> Listening on 0.0.0.0:21464, CTRL+C to stop
2012-03-09T16:56:29+00:00 heroku[web.1]: State changed from starting to up
2012-03-09T16:56:31+00:00 app[web.1]:
2012-03-09T16:56:31+00:00 app[web.1]:
2012-03-09T16:56:31+00:00 app[web.1]: Started GET "/" for _my_ip_ at 2012-03-09 16:56:31 +0000
2012-03-09T16:56:32+00:00 app[web.1]: cache: [GET /] miss
2012-03-09T16:56:32+00:00 heroku[router]: GET url_app.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=870ms status=304 bytes=0
2012-03-09T16:56:33+00:00 heroku[router]: GET url_app.herokuapp.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=4ms status=200 bytes=0
2012-03-09T16:56:33+00:00 app[web.1]: cache: [GET /favicon.ico] miss
What is there wrong? The log says nothing exactly, I am not sure where to search the problem... Locally works me the app well.
Could you clarify if:
What are the steps leading up to these logs: Did you try to access it in the browser or using "heroku open" from the CLI?
Was the app running successfully before and has now stopped working or is the first time you are deploying to heroku?
Is the "url_app" in your logs an edit made by you or in the logs verbatim?
Here are a couple of suggestions you could try:
If the "url_app" is verbatim from the logs, there seems to be a redirect issue with the app configuration. Try running "heroku open" from the CLI to get to the right URL
Run "heroku status" on the CLI to check if it's a heroku problem
If you could provide the above details, I'd be able to help better.