Is there a way to run grunt serve using PM2?
This way I could set up my environment to automatically start when my computer start up.
I found something like:
cd /path/to/project/
pm2 start grunt --name website -- serve
But that doesn't seem to work. I am getting the following error when looking at pm2 logs:
PM2: 2015-10-19 18:23:44: Script C:\Users\...\AppData\Roaming\npm\grunt had too many unstable restarts (15). Stopped. "errored"
grunt-0 (err): at Module._compile (module.js:413:25)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
grunt-0 (err): at Function.Module._load (module.js:310:12)
grunt-0 (err): at Function._load (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\node_modules\pmx\lib\transaction.js:62:21)
grunt-0 (err): at Object.<anonymous> (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:28:21)
grunt-0 (err): at Module._compile (module.js:434:26)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
grunt-0 (err): SyntaxError: Unexpected token case
grunt-0 (err): at exports.runInThisContext (vm.js:53:16)
grunt-0 (err): at Module._compile (module.js:413:25)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
grunt-0 (err): at Function.Module._load (module.js:310:12)
grunt-0 (err): at Function._load (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\node_modules\pmx\lib\transaction.js:62:21)
grunt-0 (err): at Object.<anonymous> (C:\Users\cltessie\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:28:21)
grunt-0 (err): at Module._compile (module.js:434:26)
grunt-0 (err): at Object.Module._extensions..js (module.js:452:10)
grunt-0 (err): at Module.load (module.js:355:32)
Running pm2 start grunt alone worked for me, still cannot explain why though
Hey this worked for me.
cd /path/to/project/
pm2 start node_module/grunt/bin/grunt --name website -- serve
Explanation: PM2 will try to execute the file after start and will look it in the local path. grunt, I asume, references to the global installation of grunt. But node_module/grunt/bin/grunt is in the scope of PM2, so you can run this file.
I only use it for local development and I don't recommend this solution for production, but it can be helpful to run your app locally and check for logs in pm2. Also, if you run your back end services in the same instance of pm2, and you test something against this stack while executing "pm2 logs" you can see the whole trace of execution through all the services in order. Something very difficult even if you have some centralized logging solution like Kibana or splunk, because network lag is always messing with the order of log entries.
Related
I have an older app I am transitioning to Rails 7. I created a new app and Im essentially putting the gemfiles, controllers, models, and views that I used on the previous app. I keep seeing this error when I run $rails assets:precompile and I have the coffee gem for rails installed (comes preinstalled) but it list all my coffee files and says a loader is not configured. How do I configure a loader and where am I placing the file to load?
#terminal
rails assets:precompile
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.10s.
yarn run v1.22.19
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/coupon.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/bills.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/welcome.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/landing.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/dashboard.js.coffee
✘ [ERROR] Could not resolve "controllers/application"
app/javascript/controllers/index.js:3:28:
3 │ import { application } from "controllers/application"
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path "controllers/application" as external to exclude it from the bundle, which
will remove this error.
6 of 7 errors shown (disable the message limit with --log-limit=0)
node:child_process:879
throw err;
^
Error: Command failed: /Users/Public/code/LDv1.1/node_modules/esbuild-darwin-64/bin/esbuild app/javascript/application.js app/javascript/bills.js.coffee app/javascript/coupon.js.coffee app/javascript/dashboard.js.coffee app/javascript/landing.js.coffee app/javascript/rails.validations.js app/javascript/welcome.js.coffee --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
at checkExecSyncError (node:child_process:841:11)
at Object.execFileSync (node:child_process:876:15)
at Object.<anonymous> (/Users/Public/code/LDv1.1/node_modules/esbuild/bin/esbuild:177:28)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 9665,
stdout: null,
stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rails aborted!
jsbundling-rails: Command build failed, ensure yarn is installed and `yarn build` runs without errors
Tasks: TOP => assets:precompile => javascript:build
(See full trace by running task with --trace)
P.S. When I run yarn build as the terminal says I get this error...
yarn build
yarn run v1.22.19
$ esbuild app/javascript/*.* --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/welcome.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/bills.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/landing.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/coupon.js.coffee
✘ [ERROR] No loader is configured for ".coffee" files: app/javascript/dashboard.js.coffee
✘ [ERROR] Could not resolve "controllers/application"
app/javascript/controllers/index.js:3:28:
3 │ import { application } from "controllers/application"
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~
You can mark the path "controllers/application" as external to exclude it from the bundle, which
will remove this error.
6 of 7 errors shown (disable the message limit with --log-limit=0)
node:child_process:879
throw err;
^
Error: Command failed: /Users/Public/code/LDv1.1/node_modules/esbuild-darwin-64/bin/esbuild app/javascript/application.js app/javascript/bills.js.coffee app/javascript/coupon.js.coffee app/javascript/dashboard.js.coffee app/javascript/landing.js.coffee app/javascript/rails.validations.js app/javascript/welcome.js.coffee --bundle --sourcemap --outdir=app/assets/builds --public-path=assets
at checkExecSyncError (node:child_process:841:11)
at Object.execFileSync (node:child_process:876:15)
at Object.<anonymous> (/Users/Public/code/LDv1.1/node_modules/esbuild/bin/esbuild:177:28)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 10205,
stdout: null,
stderr: null
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
These are my yaml files referenced by here (kubernetes.io/docs)
deployment gists
And I use command kubectl apply -f backend-deployment.yaml -f frontend-configmap.yaml -f frontend-deployment.yaml
Backend were launched successfully, but Frontend occured error.
[emerg] 1#1: host not found in upstream "backend-service" in /etc/nginx/conf.d/nginx.conf:2
#nginx: [emerg] host not found in upstream "backend-service" in /etc/nginx/conf.d/nginx.conf:2
Even if 'backend-service' is declared, nginx couldn't recognize it.
Command nslookup backend-service result is:
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find backend-service: SERVFAIL
What am I missing?
I have gotten closer to the issue/solution.
First of all, you if the images in your supplied answer are correct, you are running nginx in your backend deployment and node-js server on your frontend deployment. This is a mistake.
after changing the images frontend is running (as expected) but backend pod is crashing.
However, the backend pod is successfully resolving the mysql-service to its internal clusterIp and I appear to have wrong authentication setup.
`> server#1.0.0 start /usr/src/app
> node backend.js
(node:18) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:18) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:18) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:18) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
listening on 3000
events.js:292
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 10.100.77.32:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1142:16)
--------------------
at Protocol._enqueue (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/usr/src/app/node_modules/mysql/lib/Connection.js:116:18)
at Object.<anonymous> (/usr/src/app/backend.js:58:12)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Emitted 'error' event on Connection instance at:
at Connection._handleProtocolError (/usr/src/app/node_modules/mysql/lib/Connection.js:423:8)
at Protocol.emit (events.js:315:20)
at Protocol._delegateError (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:398:10)
at Handshake.<anonymous> (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:153:12)
at Handshake.emit (events.js:315:20)
at Handshake.Sequence.end (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:78:12)
at Protocol.handleNetworkError (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:369:14)
at Connection._handleNetworkError (/usr/src/app/node_modules/mysql/lib/Connection.js:418:18)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:96:8)
at emitErrorCloseNT (internal/streams/destroy.js:68:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '10.100.77.32',
port: 3306,
> node backend.js
fatal: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 start: `node backend.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-07-21T08_46_32_833Z-debug.log`
if you look at the log. it says it tries to connect to 10.100.77.32:3306 and the output of kubectl get svc is the following mysql-service ClusterIP 10.100.77.32 <none> 3306/TCP 17m
with the matching ip of my service.
kubectl get endpoints shows that the mysql-service has indeed found an endpoint:
mysql-service ClusterIP 10.100.77.32 <none> 3306/TCP 17m
and here is additional log information showing that the authentication mechanism of your nodejs application appearently is not working for the mysql pod.
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/usr/src/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/usr/src/app/node_modules/mysql/lib/Connection.js:88:28)
at Socket.<anonymous> (/usr/src/app/node_modules/mysql/lib/Connection.js:526:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:296:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
--------------------
at Protocol._enqueue (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/usr/src/app/node_modules/mysql/lib/Connection.js:116:18)
at Object.<anonymous> (/usr/src/app/backend.js:58:12)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Emitted 'error' event on Connection instance at:
at Connection._handleProtocolError (/usr/src/app/node_modules/mysql/lib/Connection.js:423:8)
at Protocol.emit (events.js:315:20)
at Protocol._delegateError (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:398:10)
at Handshake.<anonymous> (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:153:12)
at Handshake.emit (events.js:315:20)
at Handshake.Sequence.end (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:78:12)
at Handshake.ErrorPacket (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:125:8)
at Protocol._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
[... lines matching original stack trace ...]
at readableAddChunk (_stream_readable.js:272:9) {
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',
sqlState: '08004',
fatal: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 start: `node backend.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-07-21T08_55_22_133Z-debug.log
However, with the changes suggest at the beginning of the answer the issues around resolving the service name and communicating inside of kubernetes should be resolved.
backend-deployment image : bateaux/test-nginx
frontend-deployment image : bateaux/test-node-server
When deploy backend-deployment, remove [livenessProbe, readinessProbe].
Because node.js express server use #cloudnative/health-connect To readinessProbe, so call PingCheck(worker node ip).
Wow....I found solution for getaddrinfo EAI_AGAIN mysql-service.
I think if network can't find service, there is error in dns.
kubectl logs --namespace=kube-system -l k8s-app=kube-dns
Result of command is gist.
So...I finally found this link about kubernetes coredns.
By belphegor's answer, it works restart coredns.
Although, there is new error Client does not support authentication protocol requested by server; consider upgrading MySQL client, but i think to solve it is easier than dns error. hhhhhhhhhhhhhhhh
Hi my meteor js app is showing the following:
Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.
Here is the commands I ran (by following a tutorial, to get deployed thus far):
heroku create mkrteach
heroku addons:create mongolab
heroku config:set ROOT_URL=https://mkrteach.herokuapp.com/
git push heroku master
Here is what my heroku logs are showing:
2017-05-24T23:43:20.191506+00:00 app[api]: Enable Logplex by user
mohammadhunan#gmail.com
2017-05-24T23:43:20.191506+00:00 app[api]: Release v2 created by user mohammadhunan#gmail.com
2017-05-24T23:43:20.019249+00:00 app[api]: Release v1 created by user mohammadhunan#gmail.com
2017-05-24T23:43:20.019249+00:00 app[api]: Initial release by user mohammadhunan#gmail.com
2017-05-24T23:43:43.106898+00:00 app[api]: Attach MONGODB (#ref:mongolab-round-29311) by user mohammadhunan#gmail.com
2017-05-24T23:43:43.106898+00:00 app[api]: Release v3 created by user mohammadhunan#gmail.com
2017-05-24T23:44:21.663825+00:00 app[api]: Release v4 created by user mohammadhunan#gmail.com
2017-05-24T23:44:21.663825+00:00 app[api]: Set ROOT_URL config vars by user mohammadhunan#gmail.com
2017-05-24T23:44:32.978581+00:00 app[api]: Release v5 created by user mohammadhunan#gmail.com
2017-05-24T23:44:32.978581+00:00 app[api]: Set METEOR_SETTINGS config vars by user mohammadhunan#gmail.com
2017-05-24T23:44:50.000000+00:00 app[api]: Build started by user mohammadhunan#gmail.com
2017-05-24T23:46:56.713557+00:00 app[api]: Deploy 9e5efce2 by user mohammadhunan#gmail.com
2017-05-24T23:46:56.713557+00:00 app[api]: Release v6 created by user mohammadhunan#gmail.com
2017-05-24T23:46:56.746656+00:00 app[api]: Scaled to web#1:Free by user mohammadhunan#gmail.com
2017-05-24T23:44:50.000000+00:00 app[api]: Build succeeded
2017-05-24T23:47:04.554518+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js`
2017-05-24T23:47:07.867019+00:00 heroku[web.1]: Process exited with status 8
2017-05-24T23:47:07.886082+00:00 heroku[web.1]: State changed from starting to crashed
2017-05-24T23:47:07.887443+00:00 heroku[web.1]: State changed from crashed to starting
2017-05-24T23:47:07.715326+00:00 app[web.1]:
2017-05-24T23:47:07.715736+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/mini-files.js:82
2017-05-24T23:47:07.716081+00:00 app[web.1]: const unicodeNormalizePath = (path) => {
2017-05-24T23:47:07.716147+00:00 app[web.1]: ^
2017-05-24T23:47:07.741911+00:00 app[web.1]: SyntaxError: Unexpected token >
2017-05-24T23:47:07.741913+00:00 app[web.1]: at Module._compile (module.js:439:25)
2017-05-24T23:47:07.741914+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2017-05-24T23:47:07.741915+00:00 app[web.1]: at Module.load (module.js:356:32)
2017-05-24T23:47:07.741915+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2017-05-24T23:47:07.741916+00:00 app[web.1]: at Module.require (module.js:364:17)
2017-05-24T23:47:07.741917+00:00 app[web.1]: at require (module.js:380:17)
2017-05-24T23:47:07.741918+00:00 app[web.1]: at Object.<anonymous> (/app/.meteor/heroku_build/app/programs/server/boot.js:9:13)
2017-05-24T23:47:07.741918+00:00 app[web.1]: at Module._compile (module.js:456:26)
2017-05-24T23:47:07.741919+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2017-05-24T23:47:07.741919+00:00 app[web.1]: at Module.load (module.js:356:32)
2017-05-24T23:47:12.921976+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node .meteor/heroku_build/app/main.js`
2017-05-24T23:47:14.666363+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/mini-files.js:82
2017-05-24T23:47:14.665865+00:00 app[web.1]:
2017-05-24T23:47:14.672056+00:00 app[web.1]: at Module._compile (module.js:439:25)
2017-05-24T23:47:14.666824+00:00 app[web.1]: ^
2017-05-24T23:47:14.672057+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2017-05-24T23:47:14.666765+00:00 app[web.1]: const unicodeNormalizePath = (path) => {
2017-05-24T23:47:14.672054+00:00 app[web.1]: SyntaxError: Unexpected token >
2017-05-24T23:47:14.672058+00:00 app[web.1]: at Module.load (module.js:356:32)
2017-05-24T23:47:14.672058+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2017-05-24T23:47:14.672059+00:00 app[web.1]: at Module.require (module.js:364:17)
2017-05-24T23:47:14.672059+00:00 app[web.1]: at require (module.js:380:17)
2017-05-24T23:47:14.672060+00:00 app[web.1]: at Object.<anonymous> (/app/.meteor/heroku_build/app/programs/server/boot.js:9:13)
2017-05-24T23:47:14.672062+00:00 app[web.1]: at Module.load (module.js:356:32)
2017-05-24T23:47:14.672061+00:00 app[web.1]: at Module._compile (module.js:456:26)
2017-05-24T23:47:14.672061+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10)
2017-05-24T23:47:14.751083+00:00 heroku[web.1]: State changed from starting to crashed
2017-05-24T23:47:14.731102+00:00 heroku[web.1]: Process exited with status 8
2017-05-24T23:47:27.649678+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=mkred-teach.herokuapp.com request_id=ee6e0ca4-3bee-48ae-925a-562d23e47dd7 fwd="208.185.23.206" dyno= connect= service= status=503 bytes= protocol=https
2017-05-24T23:47:28.143232+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=mkred-teach.herokuapp.com request_id=5c736339-3336-4c8a-986a-ae572f99a441 fwd="208.185.23.206" dyno= connect= service= status=503 bytes= protocol=https
Mohammads-MacBook-Pro:mkrED2 minimoe$
I'm not sure how to fix this, can anyone tell me how to fix this?
I encountered the same problem. It seems the Heroku buildpack you are using no longer works. Change the buildpack to a newer one. This one is working: https://github.com/AdmitHub/meteor-buildpack-horse.git.
To change your buildpack you can use the dashboard or the command-line.
Via Dashboard
Go to your Heroku dashboard and select your app
Go to the Settings tab and find Buildpacks section
Remove the existing buildpack and add the new one
Via command-line
Find out which buildpack you are using, with
heroku buildpacks
Copy the link to the old buildpack's git repo.
heroku config:unset REPLACE_WITH_OLD_BUILDPACK_LINK
heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git
Whatever method you use, you'll have to push an update with git push heroku master to rebuild the app.
I am trying to deploy Meteor to a remote Heroku server. I am following this tutorial, but get errors. Any advise would be appreciated please.
When I do the git push heroku master:
However, the server logs:
2016-09-11T18:03:14.757898+00:00 heroku[slug-compiler]: Slug compilation started
2016-09-11T18:03:14.757903+00:00 heroku[slug-compiler]: Slug compilation finished
2016-09-11T18:03:41.646676+00:00 heroku[web.1]: Starting process with command `node build/bundle/main.js`
2016-09-11T18:03:44.098961+00:00 app[web.1]:
2016-09-11T18:03:44.099230+00:00 app[web.1]: assert.js:93
2016-09-11T18:03:44.099458+00:00 app[web.1]: throw new assert.AssertionError({
2016-09-11T18:03:44.101174+00:00 app[web.1]: AssertionError: "undefined" === "function"
2016-09-11T18:03:44.101176+00:00 app[web.1]: at Object.<anonymous> (/app/build/bundle/programs/server/mini-files.js:108:24)
2016-09-11T18:03:44.101177+00:00 app[web.1]: at Module._compile (module.js:456:26)
2016-09-11T18:03:44.101178+00:00 app[web.1]: at Module.load (module.js:356:32)
2016-09-11T18:03:44.101179+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2016-09-11T18:03:44.101180+00:00 app[web.1]: at Module.require (module.js:364:17)
2016-09-11T18:03:44.173228+00:00 heroku[web.1]: Process exited with status 8
2016-09-11T18:03:44.193642+00:00 heroku[web.1]: State changed from starting to crashed
2016-09-11T18:03:44.194826+00:00 heroku[web.1]: State changed from crashed to starting
2016-09-11T18:04:02.230596+00:00 heroku[web.1]: Starting process with command `node build/bundle/main.js`
2016-09-11T18:04:04.559800+00:00 heroku[web.1]: Process exited with status 8
2016-09-11T18:04:04.471328+00:00 app[web.1]:
2016-09-11T18:04:04.471593+00:00 app[web.1]: assert.js:93
2016-09-11T18:04:04.473451+00:00 app[web.1]: at wrapPathFunction (/app/build/bundle/programs/server/mini-files.js:77:10)
2016-09-11T18:04:04.473452+00:00 app[web.1]: at Object.<anonymous> (/app/build/bundle/programs/server/mini-files.js:108:24)
2016-09-11T18:04:04.473453+00:00 app[web.1]: at Module._compile (module.js:456:26)
2016-09-11T18:04:04.473454+00:00 app[web.1]: at Function.Module._load (module.js:312:12)
2016-09-11T18:04:04.473455+00:00 app[web.1]: at Module.require (module.js:364:17)
2016-09-11T18:04:04.581922+00:00 heroku[web.1]: State changed from starting to crashed
UPDATE
I now try this tutorial with a vanilla meteor app:
meteor create meteor-thewhozoo
But when I try push it to the Heroku server:
I have read that adding the Mongo Database eliminates the request for Credit Card info, but it didn't work for me.
heroku config:set MONGO_URL=mongodb://<dbname>:<password>#ds021026.mlab.com:21026/mongo-thewhozoo
I want to avoid giving my card details for a development environment/proof of concept.
UPDATE
Card details can be avoided. Read this, (see Setting up the build back).
I recently was trying to deploy my meteor app to Heroku for the first time the other day. I followed this tutorial and it worked no problem.
https://medium.com/#gautham.gg/deploy-a-meteor-1-3-application-to-heroku-cda1f68ca20a#.wceub1sm3
Hope this helps.
You don't need to add card details by using mlab sandbox option for the database & that will give you 500MB slug size (which is more than sufficient for a dev environment).
You can pick the mlab sandbox db from heroku cli using the following command.
$ heroku addons:create mongolab:sandbox
I am running meteorite (with a test project, so errors should not be due to anything I wrote) on OSX, and am getting the following error when I run on the default port 3000. I have checked, and no other process is accessing that port.
event.js:72
throw er; \ Unhandled 'error' event
Error: listen EADDRINUSE
at errnoExeception: (net.js:901:11)
at Server._listen2 (net.js:1039.14)
at listen (net.js:1061:10)
at net.js:1135:9
at dns.js:72:18
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:901:3
When I try to run mrt on a port I know is occupied, I get the correct error message (can't listen on port 3001), and when I try to run on another unoccupied port I get:
Error: connect ECONNREFUSED
Any suggestions?
Further update:
I just did a complete shutdown/restart, picked a new port number (3200), checked that nothing is using that port or anything near it, and ran meteor --port 3200. I got:
I20140115-14:02:29.623(-7)? ----------Wed Jan 15 2014 14:02:29 GMT-0700 (MST) SQL Driver Starting --------
W20140115-14:02:29.639(-7)? (STDERR) Error: connect ECONNREFUSED
W20140115-14:02:29.639(-7)? (STDERR) at errnoException (net.js:901:11)
W20140115-14:02:29.640(-7)? (STDERR) at Object.afterConnect [as oncomplete] (net.js:892:19)
W20140115-14:02:29.640(-7)? (STDERR) --------------------
W20140115-14:02:29.641(-7)? (STDERR) at Handshake.Sequence (/Users/a230073/.meteor/tools/09b63f1ed5/lib/node_modules/mysql/lib/protocol/sequences/Sequence.js:15:20)
W20140115-14:02:29.641(-7)? (STDERR) at new Handshake (/Users/a230073/.meteor/tools/09b63f1ed5/lib/node_modules/mysql/lib/protocol/sequences/Handshake.js:9:12)
W20140115-14:02:29.641(-7)? (STDERR) at Protocol.handshake (/Users/a230073/.meteor/tools/09b63f1ed5/lib/node_modules/mysql/lib/protocol/Protocol.js:41:50)
W20140115-14:02:29.642(-7)? (STDERR) at PoolConnection.Connection.connect (/Users/a230073/.meteor/tools/09b63f1ed5/lib/node_modules/mysql/lib/Connection.js:73:18)
W20140115-14:02:29.642(-7)? (STDERR) at Pool.getConnection (/Users/a230073/.meteor/tools/09b63f1ed5/lib/node_modules/mysql/lib/Pool.js:43:23)
W20140115-14:02:29.642(-7)? (STDERR) at app/server/dbinit.js:13:6
W20140115-14:02:29.642(-7)? (STDERR) at app/server/dbinit.js:79:3
W20140115-14:02:29.643(-7)? (STDERR) at /Users/lfrey/Desktop/Thesis/test-meteor-sql/.meteor/local/build/programs/server/boot.js:155:10
W20140115-14:02:29.643(-7)? (STDERR) at Array.forEach (native)
W20140115-14:02:29.643(-7)? (STDERR) at Function._.each._.forEach (/Users/a230073/.meteor/tools/09b63f1ed5/lib/node_modules/underscore/underscore.js:79:11)
First off, you should be starting your app with meteor and not mrt. That convention changed a few releases ago.
If you had a previously running meteor process which did not exit properly, you'd get an EADDRINUSE error when you try to start another one on the same port. The easy solution is just to reboot. You could also try to find the process and manually kill it: run ps aux | grep meteor, and kill PID where PID is the process id (2nd column from the ps output). Of course it may be that you just have some other unrelated process using that port... but try the above first.
If you try to run your process on another port, e.g. meteor --port 4000 that should work unless the port isn't available to you. For example, on *NIX machines, ports below 1024 require elevated privileges to use.
I was having the same issue with gulp... You need to find the PSID of the port, then run
kill -9 on the PSID number. After you should be able to run it again.
sudo lsof -i :3200
sudo kill -9 PSID