heroku request timeout parse - xcode

I migrated my app to heroku + mlab from parse. I would too often get request timeout error on the logs. I turned on verbose and below is what i get when a timeout happens:
2016-05-25T15:27:40.946050+00:00 app[web.1]: [36mverbose[39m: POST /parse/events/AppOpened { host: 'dairy-oneandahalf.herokuapp.com',
2016-05-25T15:27:40.946067+00:00 app[web.1]: connection: 'close',
2016-05-25T15:27:40.946074+00:00 app[web.1]: 'x-parse-app-build-version': '1',
2016-05-25T15:27:40.946084+00:00 app[web.1]: "__type": "Date"
2016-05-25T15:27:41.517425+00:00 app[web.1]: [36mverbose[39m: GET /parse/classes/_User { host: 'dairy-oneandahalf.herokuapp.com',
2016-05-25T15:27:41.517436+00:00 app[web.1]: connection: 'close',
2016-05-25T15:27:41.517445+00:00 app[web.1]: 'x-parse-client-version': 'i1.13.0',
2016-05-25T15:27:41.517448+00:00 app[web.1]: 'x-forwarded-for': '58.152.243.212',
2016-05-25T15:27:40.948269+00:00 heroku[router]: at=info method=POST path="/parse/events/AppOpened" host=dairy-oneandahalf.herokuapp.com request_id=3e9b1390-a1b8-487b-8229-f4c44777b2a4 fwd="58.152.243.212" dyno=web.1 connect=2ms service=6ms status=200 bytes=483
2016-05-25T15:28:12.746545+00:00 app[web.1]: [36mverbose[39m: GET /parse/classes/allPosts { host: 'dairy-oneandahalf.herokuapp.com',
2016-05-25T15:28:12.746591+00:00 app[web.1]: connection: 'close',
2016-05-25T15:28:12.746600+00:00 app[web.1]: 'x-request-id': '84c7c271-4725-42c2-a111-3cf8e2c16d52',
2016-05-25T15:28:12.746602+00:00 app[web.1]: 'total-route-time': '0',
2016-05-25T15:28:12.746605+00:00 app[web.1]: "query": {
2016-05-25T15:28:11.513492+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/parse/classes/_User" host=dairy-oneandahalf.herokuapp.com request_id=1260ec0f-3cee-4c43-a87e-9146ef154e29 fwd="58.152.243.212" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0
I'm very new to heroku, can somebody explain to me what is wrong and what I can do about solving it? any help will be greatly appreciated, thanks in advance

Related

Is there a string length limit in heroku when inserting data into a postgresql active records database in ruby?

I am currently running into a problem where on my local machine, I can create and insert a record into a table called Devices but on my heroku deploy, I cannot create a record if the length of my identifier and push_token are too long.
The device table migration I am using is pasted below.
class CreateDevices < ActiveRecord::Migration[6.1]
def change
create_table :devices do |t|
t.string :identifier, null: false
t.string :push_token, null: false
end
end
end
I tried a simple test with an endpoint to see if records were created with
get "/test/devices/:device_id/:push_tokens" do
Device.create(identifier: params[:device_id], push_token: params[:push_tokens])
puts "device_count is"
puts Device.count
end
On my local machine, if i set params[:device_id] and params[:push_tokens] to for example,
278b5d5668b7e2df3b686e0c0d19a0b9 and 1319f7e0f6dd345304c5e8e84e5ec3f52213b8f485e4783861b476373f000dde respectively the active record updates and the device count updates with it. However if i try these values on the heroku deploy, the device count is not updated and no record is created.
I am struggling to figure out whether this is a problem with my postgresql plan on heroku, if my code is not waiting for the record to be created or something entirely different.
2022-09-23T13:47:45.399683+00:00 heroku[router]: at=info method=GET path="/test/devices/123456789123456789/123456789123456789" host=japsoc-passes-server-2.herokuapp.com request_id=21779202-b9b6-4e02-9195-6ead6cc63ba6 fwd="147.12.186.203" dyno=web.1 connect=0ms service=9ms status=200 bytes=191 protocol=https
2022-09-23T13:47:45.394194+00:00 app[web.1]: device_count is
2022-09-23T13:47:45.395126+00:00 app[web.1]: 8
2022-09-23T13:47:59.284900+00:00 heroku[router]: at=info method=GET path="/test/devices/123456789123456789123456789/123456789123456789123456789" host=japsoc-passes-server-2.herokuapp.com request_id=04ef6dab-71c3-4237-b52f-bf2ea16576f0 fwd="147.12.186.203" dyno=web.1 connect=0ms service=7ms status=200 bytes=191 protocol=https
2022-09-23T13:47:59.279643+00:00 app[web.1]: device_count is
2022-09-23T13:47:59.280339+00:00 app[web.1]: 9
2022-09-23T13:48:17.720446+00:00 heroku[router]: at=info method=GET path="/test/devices/123456789123456789123456789123456789/123456789123456789123456789123456789" host=japsoc-passes-server-2.herokuapp.com request_id=1c221b82-f142-44a0-b0ec-774a8515365a fwd="147.12.186.203" dyno=web.1 connect=0ms service=9ms status=200 bytes=191 protocol=https
2022-09-23T13:48:17.715182+00:00 app[web.1]: device_count is
2022-09-23T13:48:17.715917+00:00 app[web.1]: 10
2022-09-23T13:48:35.566064+00:00 heroku[router]: at=info method=GET path="/test/devices/123456789123456789123456789123456789123456789/123456789123456789123456789123456789123456789" host=japsoc-passes-server-2.herokuapp.com request_id=2539f65b-7f82-42dc-9c4e-c078b93412d1 fwd="147.12.186.203" dyno=web.1 connect=0ms service=6ms status=200 bytes=191 protocol=https
2022-09-23T13:48:35.560941+00:00 app[web.1]: device_count is
2022-09-23T13:48:35.561519+00:00 app[web.1]: 11
2022-09-23T13:49:00.943300+00:00 heroku[router]: at=info method=GET path="/test/devices/123456789123456789123456789123456789123456789123456789/123456789123456789123456789123456789123456789123456789" host=japsoc-passes-server-2.herokuapp.com request_id=01acc954-8cf9-4327-8e84-b1958298b14d fwd="147.12.186.203" dyno=web.1 connect=0ms service=8ms status=200 bytes=191 protocol=https
2022-09-23T13:49:00.937948+00:00 app[web.1]: device_count is
2022-09-23T13:49:00.938685+00:00 app[web.1]: 12
2022-09-23T13:49:52.814962+00:00 heroku[router]: at=info method=GET path="/test/devices/123456789123456789123456789123456789123456789123456789/123456789123456789123456789123456789123456789123456789123456789123456789" host=japsoc-passes-server-2.herokuapp.com request_id=c834c2df-b822-4796-b8ae-ab29cce6bdc2 fwd="147.12.186.203" dyno=web.1 connect=0ms service=5ms status=200 bytes=191 protocol=https
2022-09-23T13:49:52.809811+00:00 app[web.1]: device_count is
2022-09-23T13:49:52.810427+00:00 app[web.1]: 12
I did some testing with the endpoint on the heroku deploy and it seems that at some point, if the string is too long for either the identifier or the push_token, no record is created but i still receive a status 200. I would greatly appreciate any help on this matter!
Turns out after using Device.create! instead of Device.create, the reason why a device was not created was because either the device_id had already been taken or push_token had already been taken and it was a problem with my device models rather than active records.

Understand heroku's log

Can someone explain me the different lines in this piece of Heroku's log while my Facebook Messenger bot is running (and people interacting)
2018-08-19T12:21:53.976999+00:00 app[web.1]: 10.124.6.113 - - [19/Aug/2018:12:21:53 +0000] "POST /webhook HTTP/1.1" 200 2 "-" "facebookexternalua"
2018-08-19T12:21:54.060862+00:00 app[web.1]: 10.8.0.31 - - [19/Aug/2018:12:21:54 +0000] "POST /webhook HTTP/1.1" 200 2 "-" "facebookexternalua"
2018-08-19T12:21:53.977357+00:00 heroku[router]: at=info method=POST path="/webhook" host=some-app.herokuapp.com request_id=9691c0bc-43c7-4a5e-83c1-c636a4cc2789 fwd="31.13.115.9" dyno=web.1 connect=0ms service=462ms status=200 bytes=161 protocol=https
2018-08-19T12:21:54.062745+00:00 heroku[router]: at=info method=POST path="/webhook" host=some-app.herokuapp.com request_id=624ca87a-b237-4a16-9e74-ad086c776d2a fwd="31.13.115.11" dyno=web.1 connect=0ms service=514ms status=200 bytes=161 protocol=https
2018-08-19T12:21:55.013052+00:00 app[web.1]: 10.127.18.55 - - [19/Aug/2018:12:21:55 +0000] "POST /webhook HTTP/1.1" 200 2 "-" "facebookexternalua"
2018-08-19T12:21:55.012197+00:00 heroku[router]: at=info method=POST path="/webhook" host=some-app.herokuapp.com request_id=032fef2b-5029-4a7b-903c-45b685b0a9ef fwd="31.13.115.2" dyno=web.1 connect=0ms service=464ms status=200 bytes=161 protocol=https
2018-08-19T12:21:56.138658+00:00 app[web.1]: 10.10.128.18 - - [19/Aug/2018:12:21:56 +0000] "POST /webhook HTTP/1.1" 200 2 "-" "facebookexternalua"
2018-08-19T12:21:56.137932+00:00 heroku[router]: at=info method=POST path="/webhook" host=some-app.herokuapp.com request_id=7f32d132-5587-4cfb-9dd4-b44ddeb8b684 fwd="31.13.115.13" dyno=web.1 connect=0ms service=734ms status=200 bytes=161 protocol=https
In fact, I would like to know what are the times of the type "service = 734ms"
Thanks in advance
service might be the time in milliseconds, in between receiving the request and serving the response; measured at the router and not the web dyno, where the request is being forwarded to.
Heroku's documentation for their router log format is here. Here's what they say about "service":
amount of time in milliseconds spent proxying data between the backend web process and the client
In other words, it's the amount of time it's taking your app (the backend web process) to process the request.

Code is working locally but not on Heroku

I am testing Facebook Messenger bot. Part of the code with core functionality:
const schedule = require('node-schedule');
app.post('/webhook/', function(req, res) {
let messaging_events = req.body.entry[0].messaging
var j = schedule.scheduleJob('10 * * * * *', function(){
for (let i = 0; i < messaging_events.length; i++) {
let event = messaging_events[i]
let sender = event.sender.id
if (event.message && event.message.text) {
let text = event.message.text
sendText(sender, "Text echo: " + text.substring(0, 100))
}
}
res.sendStatus(200)
})
})
It should reply the same message that is sent to the bot every minute (when the clock crosses 10 seconds - 2:46:10 PM, 2:47:10 PM, etc.)
If I try similar code locally, it works. It does not on Heroku. It behaves irregularly - sometimes it replies the message 2 to 4 times at once and then crashes, sometimes it does not reply anything at all. Here is the Heroku log:
2018-03-19T13:48:43.574712+00:00 heroku[web.1]: Unidling
2018-03-19T13:48:43.575153+00:00 heroku[web.1]: State changed from down to starting
2018-03-19T13:48:45.854373+00:00 heroku[web.1]: Starting process with command `node index.js`
2018-03-19T13:48:48.046370+00:00 app[web.1]: running: port
2018-03-19T13:48:48.550571+00:00 heroku[web.1]: State changed from starting to up
2018-03-19T13:49:10.035608+00:00 heroku[router]: at=info method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=89a76e53-663d-4086-8457-64c0f26be8c7 fwd="31.13.113.20" dyno=web.1 connect=1ms service=11963ms status=200 bytes=201 protocol=https
2018-03-19T13:49:10.046345+00:00 heroku[router]: at=info method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=0da8c7a9-4d5f-45bc-8797-54f608968581 fwd="31.13.105.114" dyno=web.1 connect=0ms service=20401ms status=200 bytes=201 protocol=https
2018-03-19T13:49:41.297748+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=cd1568a1-68c3-455f-872e-260f8023d925 fwd="31.13.113.170" dyno=web.1 connect=1ms service=30002ms status=503 bytes=0 protocol=https
2018-03-19T13:49:41.747709+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=32947747-1c2b-475c-a2b8-46477e13c4a2 fwd="31.13.114.116" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https
2018-03-19T13:50:10.059682+00:00 app[web.1]: _http_outgoing.js:491
2018-03-19T13:50:10.059738+00:00 app[web.1]: throw new Error('Can\'t set headers after they are sent.');
2018-03-19T13:50:10.059740+00:00 app[web.1]: ^
2018-03-19T13:50:10.059742+00:00 app[web.1]:
2018-03-19T13:50:10.059744+00:00 app[web.1]: Error: Can't set headers after they are sent.
2018-03-19T13:50:10.059745+00:00 app[web.1]: at validateHeader (_http_outgoing.js:491:11)
2018-03-19T13:50:10.059747+00:00 app[web.1]: at ServerResponse.setHeader (_http_outgoing.js:498:3)
2018-03-19T13:50:10.059748+00:00 app[web.1]: at ServerResponse.header (/app/node_modules/express/lib/response.js:767:10)
2018-03-19T13:50:10.059750+00:00 app[web.1]: at ServerResponse.contentType (/app/node_modules/express/lib/response.js:595:15)
2018-03-19T13:50:10.059752+00:00 app[web.1]: at ServerResponse.sendStatus (/app/node_modules/express/lib/response.js:357:8)
2018-03-19T13:50:10.059753+00:00 app[web.1]: at Job.job (/app/index.js:46:9)
2018-03-19T13:50:10.059755+00:00 app[web.1]: at Job.invoke (/app/node_modules/node-schedule/lib/schedule.js:173:10)
2018-03-19T13:50:10.059756+00:00 app[web.1]: at /app/node_modules/node-schedule/lib/schedule.js:543:11
2018-03-19T13:50:10.059758+00:00 app[web.1]: at Timeout._onTimeout (/app/node_modules/node-schedule/lib/schedule.js:501:7)
2018-03-19T13:50:10.059759+00:00 app[web.1]: at ontimeout (timers.js:482:11)
2018-03-19T13:50:10.130605+00:00 heroku[web.1]: Process exited with status 1
2018-03-19T13:50:10.241686+00:00 heroku[web.1]: State changed from up to crashed
Does anyone have any idea why is this happening? Maybe Heroku is not suited for this?
Thank you for all suggestions.

Unable to deploy Phoenix 1.3.0-rc1 to Heroku, builds but crashes

I'm trying to deploy a Phoenix 1.3.0-rc1 to Heroku.
It builds properly but I'm unable to access the website. It might be useful to notice that I'm able to access the app while running Phoenix on my machine.
Also worth noticing that I'm using SSL.
This is $ heroku logs --tail output:
2017-03-31T01:45:15.876452+00:00 app[api]: Release v14 created by user me#jonathansoifer.com
2017-03-31T01:44:31.000000+00:00 app[api]: Build succeeded
2017-03-31T01:45:21.350931+00:00 heroku[web.1]: Starting process with command `MIX_ENV=prod mix phx.server`
2017-03-31T01:45:23.798042+00:00 app[web.1]: exited: {{shutdown,
2017-03-31T01:45:23.798041+00:00 app[web.1]: application: customer_acquisition
2017-03-31T01:45:23.798015+00:00 app[web.1]:
2017-03-31T01:45:23.798040+00:00 app[web.1]: =INFO REPORT==== 31-Mar-2017::01:45:23 ===
2017-03-31T01:45:23.798042+00:00 app[web.1]: {failed_to_start_child,
2017-03-31T01:45:23.798043+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.Endpoint',
2017-03-31T01:45:23.798044+00:00 app[web.1]: {shutdown,
2017-03-31T01:45:23.798051+00:00 app[web.1]: {failed_to_start_child,'Elixir.Phoenix.Endpoint.Handler',
2017-03-31T01:45:23.798052+00:00 app[web.1]: {shutdown,
2017-03-31T01:45:23.798053+00:00 app[web.1]: {ranch_listener_sup,
2017-03-31T01:45:23.798053+00:00 app[web.1]: {failed_to_start_child,
2017-03-31T01:45:23.798054+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.Endpoint.HTTP'},
2017-03-31T01:45:23.798054+00:00 app[web.1]: {'EXIT',
2017-03-31T01:45:23.798055+00:00 app[web.1]: {noproc,
2017-03-31T01:45:23.798056+00:00 app[web.1]: {gen_server,call,
2017-03-31T01:45:23.798057+00:00 app[web.1]: {set_new_listener_opts,
2017-03-31T01:45:23.798056+00:00 app[web.1]: [ranch_server,
2017-03-31T01:45:23.798058+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.Endpoint.HTTP',16384,
2017-03-31T01:45:23.798058+00:00 app[web.1]: [{env,
2017-03-31T01:45:23.798059+00:00 app[web.1]: [{dispatch,
2017-03-31T01:45:23.798060+00:00 app[web.1]: [{'_',[],
2017-03-31T01:45:23.798060+00:00 app[web.1]: [{[>,>],
2017-03-31T01:45:23.798061+00:00 app[web.1]: [],'Elixir.Phoenix.Endpoint.CowboyWebSocket',
2017-03-31T01:45:23.798062+00:00 app[web.1]: {'Elixir.Phoenix.Transports.WebSocket',
2017-03-31T01:45:23.798062+00:00 app[web.1]: {'Elixir.CustomerAcquisition.Web.Endpoint',
2017-03-31T01:45:23.798063+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.UserSocket',
2017-03-31T01:45:23.798063+00:00 app[web.1]: websocket}}},
2017-03-31T01:45:23.798064+00:00 app[web.1]: {'_',[],'Elixir.Plug.Adapters.Cowboy.Handler',
2017-03-31T01:45:23.798064+00:00 app[web.1]: {'Elixir.CustomerAcquisition.Web.Endpoint',
2017-03-31T01:45:23.798065+00:00 app[web.1]: []}}]}]}]}]}]}}}}}}}}},
2017-03-31T01:45:23.798066+00:00 app[web.1]: {'Elixir.CustomerAcquisition.Application',start,[normal,[]]}}
2017-03-31T01:45:23.798066+00:00 app[web.1]: type: permanent
2017-03-31T01:45:23.870799+00:00 app[web.1]: ** (exit) exited in: GenServer.call(Mix.State, {:get, {Map, :get, [:debug, false]}}, 5000)
2017-03-31T01:45:23.870801+00:00 app[web.1]: ** (EXIT) no process
2017-03-31T01:45:23.870802+00:00 app[web.1]: (elixir) lib/gen_server.ex:596: GenServer.call/3
2017-03-31T01:45:23.870803+00:00 app[web.1]: (mix) lib/mix/cli.ex:65: Mix.CLI.run_task/2
2017-03-31T01:45:23.870804+00:00 app[web.1]: (elixir) lib/code.ex:363: Code.require_file/2
2017-03-31T01:45:23.870804+00:00 app[web.1]:
2017-03-31T01:45:23.870999+00:00 app[web.1]: {"init terminating in do_boot",{noproc,{gen_server,call,[elixir_config,{get_and_put,at_exit,[]}]}}}
2017-03-31T01:45:23.871019+00:00 app[web.1]: init terminating in do_boot ()
2017-03-31T01:45:23.871288+00:00 app[web.1]:
2017-03-31T01:45:25.175329+00:00 app[web.1]: Crash dump is being written to: erl_crash.dump...done
2017-03-31T01:45:25.225434+00:00 heroku[web.1]: Process exited with status 1
2017-03-31T01:45:25.238818+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-31T01:45:33.319992+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=liberty.ai request_id=2de26102-043c-4635-aee0-df1c0f812fd1 fwd="191.183.100.215,172.68.25.249" dyno= connect= service= status=503 bytes= protocol=http
2017-03-31T01:45:33.968974+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=liberty.ai request_id=f3f5e957-5796-4354-ade2-69bd7bc60c84 fwd="191.183.100.215,172.68.27.167" dyno= connect= service= status=503 bytes= protocol=http
Any help is appreciated.
I ran into this same error, it turns out that phoenix 1.3.0-rc1 requires elixir 1.4. If you add an elixir_buildpack.config, you can set the elixir version like so:
elixir_version=1.4.2
I found this solution here: https://github.com/HashNuke/heroku-buildpack-elixir/issues/99.

Sails js and Heroku : An error occurred in the application and your page could not be served.

I need help with heroku. My app works perfectly, but today is not working. I didnt modify any file. Somebody can help me? I followed another post in stackOverFlow, but doesnt work.
I run heroku logs:
2017-02-21T14:51:12.588970+00:00 app[web.1]: Line 3997 in .tmp/public/concat/production.js
2017-02-21T14:51:12.588971+00:00 app[web.1]:
2017-02-21T14:51:12.588971+00:00 app[web.1]: ------------------------------------------------------------------------
2017-02-21T14:51:12.589061+00:00 app[web.1]:
2017-02-21T14:51:12.589124+00:00 app[web.1]: Looks like a Grunt error occurred--
2017-02-21T14:51:12.589185+00:00 app[web.1]: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
2017-02-21T14:51:12.589241+00:00 app[web.1]: Or if you're stuck, check out the troubleshooting tips below.
2017-02-21T14:51:12.589303+00:00 app[web.1]:
2017-02-21T14:51:12.589958+00:00 app[web.1]: Troubleshooting tips:
2017-02-21T14:51:12.590030+00:00 app[web.1]:
2017-02-21T14:51:12.590089+00:00 app[web.1]: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
2017-02-21T14:51:12.590133+00:00 app[web.1]:
2017-02-21T14:51:12.590178+00:00 app[web.1]: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
2017-02-21T14:51:12.590247+00:00 app[web.1]:
2017-02-21T14:51:12.590287+00:00 app[web.1]: *-> Or maybe you don't have permissions to access the `.tmp` directory?
2017-02-21T14:51:12.590377+00:00 app[web.1]: e.g., `/app/.tmp` ?
2017-02-21T14:51:12.590423+00:00 app[web.1]:
2017-02-21T14:51:12.590468+00:00 app[web.1]: If you think this might be the case, try running:
2017-02-21T14:51:12.592153+00:00 app[web.1]: sudo chown -R 17728 /app/.tmp
2017-02-21T14:51:12.592214+00:00 app[web.1]:
2017-02-21T14:51:30.670658+00:00 app[web.1]: Error: The hook `grunt` is taking too long to load.
2017-02-21T14:51:30.670679+00:00 app[web.1]: Make sure it is triggering its `initialize()` callback, or else set `sails.config.grunt._hookTimeout to a higher value (currently 20000)
2017-02-21T14:51:30.670680+00:00 app[web.1]: at Timeout.tooLong [as _onTimeout] (/app/node_modules/sails/lib/app/private/loadHooks.js:85:21)
2017-02-21T14:51:30.670682+00:00 app[web.1]: at ontimeout (timers.js:365:14)
2017-02-21T14:51:30.670682+00:00 app[web.1]: at tryOnTimeout (timers.js:237:5)
2017-02-21T14:51:30.670683+00:00 app[web.1]: at Timer.listOnTimeout (timers.js:207:5)
2017-02-21T14:51:30.780591+00:00 heroku[web.1]: Process exited with status 0
2017-02-21T14:51:30.795109+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-21T14:51:30.796348+00:00 heroku[web.1]: State changed from crashed to starting
2017-02-21T14:51:33.992516+00:00 heroku[web.1]: Starting process with command `npm start`
2017-02-21T14:51:36.040206+00:00 app[web.1]:
2017-02-21T14:51:36.040223+00:00 app[web.1]: > estudioMate#0.0.0 start /app
2017-02-21T14:51:36.040224+00:00 app[web.1]: > node app.js
2017-02-21T14:51:36.040225+00:00 app[web.1]:
2017-02-21T14:51:37.483529+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-02-21T14:51:37.483541+00:00 app[web.1]: designed for a production environment, as it will leak
2017-02-21T14:51:37.483542+00:00 app[web.1]: memory, and will not scale past a single process.
2017-02-21T14:51:37.602636+00:00 app[web.1]: Express midleware for passport
2017-02-21T14:51:37.621476+00:00 app[web.1]: Tue, 21 Feb 2017 14:51:37 GMT connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead at
node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:56:20
2017-02-21T14:51:37.621689+00:00 app[web.1]: Tue, 21 Feb 2017 14:51:37 GMT connect deprecated limit: Restrict request size at location of read at node_modules/express/node_modules/connect/lib/middleware/multipart.js:86:15
2017-02-21T14:51:37.656950+00:00 app[web.1]: The default `sails-disk` adapter is not designed for use as a production database;
2017-02-21T14:51:37.657085+00:00 app[web.1]: Instead, please use another adapter; e.g. sails-postgresql or sails-mongo.
2017-02-21T14:51:37.657042+00:00 app[web.1]: (it stores the entire contents of your database in memory)
2017-02-21T14:51:37.657116+00:00 app[web.1]: For more info, see: http://sailsjs.org/documentation/concepts/deployment
2017-02-21T14:51:37.657131+00:00 app[web.1]: To hide this warning message, enable `sails.config.orm.skipProductionWarnings`.
2017-02-21T14:51:37.657481+00:00 app[web.1]:
2017-02-21T14:51:37.657506+00:00 app[web.1]: A project-wide `sails.config.models.migrate` setting has not been configured for this app.
2017-02-21T14:51:37.657550+00:00 app[web.1]: Since the NODE_ENV env variable is set to "production", auto-migration will be disabled automatically.
2017-02-21T14:51:37.657575+00:00 app[web.1]: (i.e. `migrate: 'safe'`)
2017-02-21T14:51:39.409768+00:00 app[web.1]: ** Grunt :: An error occurred. **
2017-02-21T14:51:39.410163+00:00 app[web.1]:
2017-02-21T14:51:39.410166+00:00 app[web.1]: ------------------------------------------------------------------------
2017-02-21T14:51:39.410167+00:00 app[web.1]: Aborted due to warnings.
2017-02-21T14:51:39.410168+00:00 app[web.1]: Running "uglify:dist" (uglify) task
2017-02-21T14:51:39.410168+00:00 app[web.1]: JS_Parse_Error {
2017-02-21T14:51:39.410169+00:00 app[web.1]: message: 'SyntaxError: Unexpected token punc «}», expected punc «:»',
2017-02-21T14:51:39.410170+00:00 app[web.1]: filename: '../concat/production.js',
2017-02-21T14:51:39.410171+00:00 app[web.1]: line: 3997,
2017-02-21T14:51:39.410171+00:00 app[web.1]: col: 31,
2017-02-21T14:51:39.410172+00:00 app[web.1]: pos: 284354,
2017-02-21T14:51:39.410187+00:00 app[web.1]: >> Uglifying source .tmp/public/concat/production.js failed.
2017-02-21T14:51:39.410183+00:00 app[web.1]: stack: 'Error\n at new JS_Parse_Error (<anonymous>:1534:18)\n at js_error (<anonymous>:1542:11)\n at croak (<anonymous>:2089:9)\n at token_error (<anonymous>:2097:9)\n at expect_token (<anonymous>:2110:9)\n at expect (<anonymous>:2113:36)\n at eval (<anonymous>:2686:13)\n at eval (<anonymous>:2136:24)\n at expr_atom (<anonymous>:2616:35)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at expr_list (<anonymous>:2641:24)\n at subscripts (<anonymous>:2775:30)\n at subscripts (<anonymous>:2752:20)\n at expr_atom (<anonymous>:2628:20)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at simple_statement (<anonymous>:2314:55)\n at eval (<anonymous>:2183:19)\n at eval (<anonymous>:2136:24)\n at block_ (<anonymous>:2429:20)\n at eval (<anonymous>:2401:25)\n at function_ (<anonymous>:2407:15)\n at expr_atom (<anonymous>:2622:24)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at maybe_assign (<anonymous>:2864:32)\n at expression (<anonymous>:2875:20)\n at simple_statement (<anonymous>:2314:55)\n at eval (<anonymous>:2183:19)\n at eval (<anonymous>:2136:24)\n at block_ (<anonymous>:2429:20)\n at eval (<anonymous>:2401:25)\n at function_ (<anonymous>:2407:15)\n at expr_atom (<anonymous>:2622:24)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at expr_list (<anonymous>:2641:24)\n at eval (<anonymous>:2651:23)\n at eval (<anonymous>:2136:24)\n at expr_atom (<anonymous>:2614:35)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at expr_list (<anonymous>:2641:24)\n at subscripts (<anonymous>:2775:30)\n at subscripts (<anonymous>:2752:20)\n at subscripts (<anonymous>:2772:20)\n at subscripts (<anonymous>:2752:20)\n at expr_atom (<anonymous>:2628:20)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at simple_statement (<anonymous>:2314:55)\n at eval (<anonymous>:2183:19)\n at eval (<anonymous>:2136:24)\n at eval (<anonymous>:2904:23)\n at Object.parse (<anonymous>:2915:7)\n at /app/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js:54:27\n at Array.forEach (native)\n at Object.exports.minify (/app/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js:37:11)\n at /app/node_modules/grunt-contrib-uglify/tasks/uglify.js:156:25\n at Array.forEach (native)\n at Object.<anonymous> (/app/node_modules/grunt-contrib-uglify/tasks/uglify.js:77:16)\n at Object.<anonymous> (/app/node_modules/grunt/lib/grunt/task.js:255:15)\n at Object.thisTask.fn (/app/node_modules/grunt/lib/grunt/task.js:73:16)\n at Object.<anonymous> (/app/node_modules/grunt/lib/util/task.js:294:30)\n at Task.runTaskFn (/app/node_modules/grunt/lib/util/task.js:244:24)\n at Task.<anonymous> (/app/node_modules/grunt/lib/util/task.js:293:12)\n at /app/node_modules/grunt/lib/util/task.js:220:11\n at _combinedTickCallback (internal/process/next_tick.js:67:7)\n at process._tickCallback (internal/process/next_tick.js:98:9)\n' }
2017-02-21T14:51:39.410187+00:00 app[web.1]: Warning: Uglification failed.
2017-02-21T14:51:39.410188+00:00 app[web.1]: SyntaxError: Unexpected token punc «}», expected punc «:».
2017-02-21T14:51:39.410189+00:00 app[web.1]: Line 3997 in .tmp/public/concat/production.js
2017-02-21T14:51:39.410189+00:00 app[web.1]:
2017-02-21T14:51:39.410190+00:00 app[web.1]: ------------------------------------------------------------------------
2017-02-21T14:51:39.410287+00:00 app[web.1]:
2017-02-21T14:51:39.410347+00:00 app[web.1]: Looks like a Grunt error occurred--
2017-02-21T14:51:39.410405+00:00 app[web.1]: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
2017-02-21T14:51:39.410465+00:00 app[web.1]: Or if you're stuck, check out the troubleshooting tips below.
2017-02-21T14:51:39.410527+00:00 app[web.1]:
2017-02-21T14:51:39.411169+00:00 app[web.1]: Troubleshooting tips:
2017-02-21T14:51:39.411248+00:00 app[web.1]:
2017-02-21T14:51:39.411309+00:00 app[web.1]: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
2017-02-21T14:51:39.411377+00:00 app[web.1]:
2017-02-21T14:51:39.411435+00:00 app[web.1]: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
2017-02-21T14:51:39.411489+00:00 app[web.1]:
2017-02-21T14:51:39.411544+00:00 app[web.1]: *-> Or maybe you don't have permissions to access the `.tmp` directory?
2017-02-21T14:51:39.411755+00:00 app[web.1]:
2017-02-21T14:51:39.411678+00:00 app[web.1]: e.g., `/app/.tmp` ?
2017-02-21T14:51:39.411812+00:00 app[web.1]: If you think this might be the case, try running:
2017-02-21T14:51:39.413647+00:00 app[web.1]: sudo chown -R 59060 /app/.tmp
2017-02-21T14:51:39.413728+00:00 app[web.1]:
2017-02-21T14:51:57.381050+00:00 app[web.1]: Error: The hook `grunt` is taking too long to load.
2017-02-21T14:51:57.381063+00:00 app[web.1]: Make sure it is triggering its `initialize()` callback, or else set `sails.config.grunt._hookTimeout to a higher value (currently 20000)
2017-02-21T14:51:57.381064+00:00 app[web.1]: at Timeout.tooLong [as _onTimeout] (/app/node_modules/sails/lib/app/private/loadHooks.js:85:21)
2017-02-21T14:51:57.381066+00:00 app[web.1]: at ontimeout (timers.js:365:14)
2017-02-21T14:51:57.381066+00:00 app[web.1]: at tryOnTimeout (timers.js:237:5)
2017-02-21T14:51:57.381067+00:00 app[web.1]: at Timer.listOnTimeout (timers.js:207:5)
2017-02-21T14:51:57.570097+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-21T14:51:57.553867+00:00 heroku[web.1]: Process exited with status 0
2017-02-21T14:51:58.636986+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=c24795a8-27d7-490a-87e3-63217a2dce6c fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:51:58.812104+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=026d9527-41f1-4124-816b-d1a1b5735b4b fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:52:35.751663+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=d0e1a421-a1ad-4e01-bd95-32cee5e79dcb fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:52:48.270115+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=e60095d6-0a4c-4e8f-9ed9-04667531ce65 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:53:59.766514+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=ba41e862-7e49-4a77-b943-2922b1787660 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:56:37.383946+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=8c14b2fa-fde5-428c-a6c3-0bb9690613d9 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:58:54.174763+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=273424e6-5eaa-4685-af19-5f8859466e3f fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:59:15.578510+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=b326c9f4-8552-4934-94c4-db22d0c6d4fa fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:59:17.342443+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=616ce76b-5753-461d-a520-01a2593efc75 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
I run npm install, and git heroku push again but doesnt happen.
Thanks.
You're going to need to do a little more work to prepare sails to run on Heroku. First, there's a build process inherent in Sails. When you push to Heroku by default the NODE_ENV environment variable is set to production. That will cause npm to not load any of your development dependencies. The quickest fix to see if that's the only error (And I'm not sure it is) is to set your NODE_ENV env variable to staging (or anything else really, as long as it's not production) and try to push again. That should load your dev dependencies, and may get you further.
Ultimately if you're going to serve Sails on Heroku, you'll need to figure out a better way to deploy. I'd suggest checking out this heroku-sails example and package: https://github.com/chadn/heroku-sails
When I deploy a sails.js app to heroku I typically do the following at a minimum -
in your .sailsrc file - you need to turn off grunt (when doing local dev, comment this out)-
{"generators": {"modules": {}},"hooks": {"grunt": false}}
You will then want to configure your static assets to load from a compiled directory when the NODE_ENV is prod, so in /config/env/production.js - add a variable to your exports for -
paths:{public:__dirname+'/../../www/'}
Add that www folder in your project root and run the command 'grunt build' or 'grunt buildProd'. This will then precompile all your assets for heroku since grunt can take a long time to load/run and can keep your application from starting.
There may be some other things you want to do such as ensure your site is setup to use redis or some type of db for sockets and sessions. You may also want to use something like pm2 to actually load your app as if you are on a larger dyno you can then run multiple instances of your sails app on the same dyno.
Checkout http://sailsjs.com/documentation/concepts/deployment/hosting#?deploying-to-heroku for some more info direct from Sails.js

Resources