Meteor deploy error on meteor host - node.js

I have an app without database functionality today I added some simple sitemap code with Mongo collection to app and test it locally all of things worked well but when I deployed application to meteor hosting with meteor deploy command my app crashed. I give this detail from meteor logs command:
[Wed Jun 24 2015 08:01:42 GMT+0000 (UTC)] WARNING MongoError: auth fails
at Object.Future.wait
(/meteor/dev_bundles/0.4.18/lib/node_modules/fibers/future.js:398:15)
at new MongoConnection (packages/mongo/mongo_driver.js:213:1)
at new MongoInternals.RemoteCollectionDriver
(packages/mongo/remote_collection_driver.js:4:1)
at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:1)
at Object.defaultRemoteCollectionDriver
(packages/underscore/underscore.js:750:1)
at new Mongo.Collection (packages/mongo/collection.js:98:1)
at app/server/sitemap.js:1:44
at app/server/sitemap.js:22:3
at
/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/boot.js:222:10
at Array.forEach (native)
- - - - -
at Object.toError
(/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/utils.js:114:11)
at
/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1194:31
at
/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/db.js:1903:9
at Server.Base._callHandler
(/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/base.js:453:41)
at
/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:487:18
at [object Object].MongoReply.parseBody
(/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
at [object Object].<anonymous>
(/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/server.js:445:20)
at [object Object].emit (events.js:95:17)
at [object Object].<anonymous>
(/meteor/containers/9d7d4183-ba55-fb30-3eb2-d6bceabe37e2/bundle/programs/server/npm/mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:207:13)
at [object Object].emit (events.js:98:17)
[Wed Jun 24 2015 08:01:42 GMT+0000 (UTC)] ERROR Application crashed with code:
8
[Wed Jun 24 2015 08:01:42 GMT+0000 (UTC)] INFO STATUS running -> waiting
[Wed Jun 24 2015 08:01:45 GMT+0000 (UTC)] INFO HIT / 89.165.17.140
And this is my sitemap.xml code:
Pages = new Mongo.Collection("pages");
// https://atmospherejs.com/gadicohen/sitemaps
sitemaps.add('/sitemap.xml', function() {
var out = [], pages = Pages.find().fetch();
out.push({
page: '/',
lastmod: new Date(),
changefreq: 'always'
});
_.each(pages, function(page) {
out.push({
page: page.url,
lastmod: page.lastUpdated,
changefreq: 'weekly'
});
});
return out;
});
Please guide me how to fix this issue on deployment. On the local machine all things working right. )-:
After two days there is still a problem. My site is still not available and this is error:
This site has crashed.
Site administrators can examine the logs with:
meteor logs example.com
Retrying in x seconds...

It seems to be an error in the way the deploy scripts set up your deployment that has nothing to do with your code. To fix it, the app must first be deleted then re-deployed (or simply deployed under a different name):
meteor deploy xxx --delete
meteor deploy xxx

Related

Lighthouse reporting is failing in Jenkins with below error

Fri, 28 May 2021 09:27:18 GMT ChromeLauncher Waiting for browser.............................................................................................
Fri, 28 May 2021 09:27:19 GMT ChromeLauncher Waiting for browser...............................................................................................
Fri, 28 May 2021 09:27:19 GMT ChromeLauncher Waiting for browser.................................................................................................
Fri, 28 May 2021 09:27:20 GMT ChromeLauncher Waiting for browser...................................................................................................
Fri, 28 May 2021 09:27:20 GMT ChromeLauncher Waiting for browser.....................................................................................................
Fri, 28 May 2021 09:27:21 GMT ChromeLauncher Waiting for browser.......................................................................................................
Fri, 28 May 2021 09:27:21 GMT ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:36157
Fri, 28 May 2021 09:27:21 GMT ChromeLauncher:error Logging contents of /tmp/lighthouse.mOZ6RIf/chrome-err.log
Fri, 28 May 2021 09:27:21 GMT ChromeLauncher:error Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"
Inconsistency detected by ld.so: ../elf/dl-tls.c: 488: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!
Unable to connect to Chrome
370/0: Lighthouse analysis FAILED for https://website.com/en/....
rm: no such file or directory: report/lighthouse/website/en....report.json
/var/lib/jenkins/workspace/project/node_modules/lighthouse-batch/index.js:219
const score = toScore(summary.detail.performance)
TypeError: Cannot read property 'performance' of undefined
at checkBudgets (/var/lib/jenkins/workspace/project/node_modules/lighthouse-batch/index.js:219:42)
at /var/lib/jenkins/workspace/project/node_modules/lighthouse-batch/index.js:67:20
at Array.map (<anonymous>)
at execute (/var/lib/jenkins/workspace/project/node_modules/lighthouse-batch/index.js:39:38)
at Object.<anonymous> (/var/lib/jenkins/workspace/project/node_modules/lighthouse-batch/run.js:28:1)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Lighthouse_Reports#1.0.0 lighthouse: `lighthouse-batch -f sites.txt -p --config-path=config.js -h --performance 75 --score 70 --no-report –chrome-flags='–headless','--no-sandbox'`
npm ERR! Exit status 1
I'm running this report for 900+ page urls.
As the logs tell, ChromeLauncher is refusing connection to Jenkins. You might want to check if Jenkins is allowed to access this running service.
This can also happen if your ChromeLauncher is not running in headless mode, or multiple instances of ChromeLauncher are running, and no available ports for it are left.
You can try adding the following to you ChromeLauncher launch configs. In fact, you should mention these.
chromeOptions = {
chromeFlags: ["--disable-gpu", "--headless", "--enable-logging"]
}
Find more details to this here.
As an alternative, you can consider running Lighthouse in a Docker instead, to isolate it from Jenkins. This way, you can scan your project, generate HTML reports and publish it back to Jenkins.
You can follow the approach mentioned here.

Using Azure Redis Cache with Node.js (for Hubot's brain)?

I am trying to use Azure Redis Cache as the storage for my Hubot's brain.
I have followed the instructions here to configure the Redis brain. I have also tried both SSL and unencrypted connections, as I read here that the Redis Node client does not support SSL.
I also updated the Redis client in my hubot-redis-brain from 0.8.4 to 2.6.2, but my Hubot is still unable to connect to Redis.
Here is a screen shot of the port config in Azure:
And this is the output when my Hubot starts:
[Fri Sep 23 2016 09:00:14 GMT+0100 (GMT Daylight Time)] INFO hubot-redis-brain: Discovered redis from REDISTOGO_URL environment variable
node_redis: Deprecated: The AUTH command contains a "undefined" argument.
This is converted to a "undefined" string now and will return an error from v.3.0 on.
Please handle this in your code to make sure everything works as you intended it to.
[Fri Sep 23 2016 09:00:21 GMT+0100 (GMT Daylight Time)] ERROR hubot-redis-brain: Failed to authenticate to Redis
[Fri Sep 23 2016 09:00:21 GMT+0100 (GMT Daylight Time)] ERROR ReplyError: Ready check failed: NOAUTH Authentication required.
at parseError (C:\projects\hubot-tryout\node_modules\redis-parser\lib\parser.js:163:12)
at parseType (C:\projects\hubot-tryout\node_modules\redis-parser\lib\parser.js:224:14)
Any help on this would be much appreciated.
UPDATE
This is the code I'm using to connect unencrypted:
client = Redis.createClient("6379", "my-host.redis.cache.windows.net" , { auth_pass: "access-key" } )
And this for the encrypted connection:
client = Redis.createClient("6380", "my-host.redis.cache.windows.net" , { auth_pass: "access-key" } ), tls: {servername: 'my-host.redis.cache.windows.net'} })
I would try URL encoding the password. I wonder if you are running into the same problem that is described here for using Azure Redis for PHP Session...
https://azure.microsoft.com/en-us/documentation/articles/cache-faq/#can-i-use-azure-redis-cache-as-a-php-session-cache

Restarted my server and started getting this error: Forever detected script exited with code: 8

I resized my Digital ocean droplet (Permanently) This required I powered off my droplet and then powered on again. When I visit the webpage I get a typical NGINX page saying that I have succesfully installed NGINX, the web app can no longer be seen
I did a mup logs -f to see what is going on and I am continually getting this error.
I am not sure what is wrong and it looks like something is off with my cron jobs but I am not sure what. Any ideas:
error: Forever detected script exited with code: 8
[xxx.xxx.xxx.xx] error: Script restart attempt #75[xxx.xxx.xxx.xx]
[xxx.xxx.xxx.xx] {"line":"63","file":"synced-cron-server.js","message":"SyncedCron: Scheduled \"Email Weekly Todos for Mentors\" next run #Mon Nov 30 2015 07:00:00 GMT-0500 (EST)","time":{"$date":1448741207434},"level":"info"}[xxx.xxx.xxx.xx]
[xxx.xxx.xxx.xx] {"line":"63","file":"synced-cron-server.js","message":"SyncedCron: Scheduled \"Weekly Push Notifications to students\" next run #Sun Nov 29 2015 10:00:00 GMT-0500 (EST)","time":{"$date":1448741207437},"level":"info"}[xxx.xxx.xxx.xx]
[xxx.xxx.xxx.xx]
[xxx.xxx.xxx.xx] events.js:72[xxx.xxx.xxx.xx]
[xxx.xxx.xxx.xx] throw er; // Unhandled 'error' event
[xxx.xxx.xxx.xx] [xxx.xxx.xxx.xx] ^
Error: listen EADDRINUSE
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1043:14)
at listen (net.js:1065:10)
at net.js:1147:9
at dns.js:72:18
at process._tickCallback (node.js:442:13)
error: Forever detected script exited with code: 8[xxx.xxx.xxx.xx]
Any ideas would help a lot
I fixed the issues by setting the app file in sites-enabled folder to listen to port 3000. I think it was listening to 80 by default and conflicting with nginx

Node.js stopped with "Sending SIGTERM to child" for no reason

This problem is pretty much the same issue posted on https://www.openshift.com/forums/openshift/nodejs-process-stopping-for-no-reason. Unfortunately it remains unanswered.
Today my Node.js app stopped few times with DEBUG: Sending SIGTERM to child... on the logfile. No more, no less. My application is a very simple single-page app with single AJAX endpoint, serving 1k-2k pageviews per day. It has been running well for days without any problem.
I use these modules:
express
body-parser
request
cheerio
-- Update:
I'm using one small gear. 512MB mem, 1 GB storage
Excerpts from log file (~/app-root/logs/nodejs.log)
Thu Jul 17 2014 09:12:52 GMT-0400 (EDT) <redacted app log message>
Thu Jul 17 2014 09:13:09 GMT-0400 (EDT) <redacted app log message>
Thu Jul 17 2014 09:14:33 GMT-0400 (EDT) <redacted app log message>
DEBUG: Sending SIGTERM to child...
#### below are the log entries after issuing "ctl_app restart"
DEBUG: Running node-supervisor with
DEBUG: program 'server.js'
DEBUG: --watch '/var/lib/openshift/redacted/app-root/data/.nodewatch'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js|coffee'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node server.js'
Stats from oo-cgroup-read, as suggested by #niharvey. A bit too long, so I put it on http://pastebin.com/c31gCHGZ. Apparently I use too much memory: memory.failcnt 40583. I suppose Node.js is automatically (?) restarted on memory overusage events, but in this case it's not. I had to restart manually.
I forgot that I have an idle MySQL cartridge installed, now removed.
-- Update #2
The app crashed again just now. Value of memory.failcnt stays same (full stats on http://pastebin.com/LqbBVpV9), so it's not memory problem (?). But there are differences in the log file. The app seems restarted, but failed. After ctl_app restart it works as intented.
Thu Jul 17 2014 22:14:46 GMT-0400 (EDT) <redacted app log message>
Thu Jul 17 2014 22:15:03 GMT-0400 (EDT) <redacted app log message>
DEBUG: Sending SIGTERM to child...
==> app-root/logs/nodejs.log-20140714113010 <==
at Function.Module.runMain (module.js:497:10)
DEBUG: Program node server.js exited with code 8
DEBUG: Starting child process with 'node server.js'
module.js:340
throw err;
^
Error: Cannot find module 'body-parser'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
To simulate this problem on your local machine run your server with supervisor in one terminal window:
supervisor server.js
Then from another terminal use the kill command
kill process_id#
The kill command with no parameters sends a SIGTERM message to the application. If supervisor receives a SIGTERM it will stop immediately.
The sample code from the sample application provided by OpenShift listens to 12 different unix signals and exits. It could be that someone at OpenShift is manually killing the process because the application is not listening to a signal that was intended to reboot it. I'm adding this code to my application to see if the behavior is more stable.
function terminator(sig){
if (typeof sig === "string") {
console.log('%s: Received %s - terminating sample app ...',
Date(Date.now()), sig);
process.exit(1);
}
console.log('%s: Node server stopped.', Date(Date.now()) );
};
process.on('exit', function() { terminator(); });
['SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT',
'SIGBUS', 'SIGFPE', 'SIGUSR1', 'SIGSEGV', 'SIGUSR2', 'SIGTERM'
].forEach(function(element, index, array) {
process.on(element, function() { terminator(element); });
});
Usually this is because your app became idle. When you ssh into the app you should see something like:
*** This gear has been temporarily unidled. To keep it active, access
*** your app # http://abc.rhcloud.com/
You can try to use a scheduled ping to keep the app alive.
I had this same issue. I deleted the gear and created a new one. The new one has been running for a few days and doesn't seem to have the issue.
[Update]
After a few days, the issue appeared on my new gear.

Hubot-hipchat works 1-1 chat but not on a room

Whenever I throw a command at hubot in a room i.e #hubot help I get nothing, but typing help in 1-1 chat works fine, am I missing something? has anyone else had this problem??
i have followed the setup instructions to the tee, and it still wont work
Did you end up specifying a host? I was having a similar problem, and removing the hostname fixed it. See the GH issue here:
https://github.com/github/hubot/issues/651
In my case, I could see in the logs that Hubot was receiving the commands, and even replying with the correct response, but the response was never showing up in the channel:
In the chat room (no visible in-room response):
#hubot ping
[Mon Feb 24 2014 02:04:21 GMT+0000 (UTC)] DEBUG Message '[object Object]' matched regex //^[#]?hubot[:,]?\s*(?:PING$)/i/
[Mon Feb 24 2014 02:04:21 GMT+0000 (UTC)] DEBUG OUT >
<message to="XXXXXX_hubot_test#conf.hipchat.com" type="chat" from="XXXXXX_XXXXXX#chat.hipchat.com/hubot-hipchat">
<inactive xmlns="http://jabber/protocol/chatstates"/>
<body>PONG</body>
</message>
In 1:1 messages:
[Mon Feb 24 2014 02:06:01 GMT+0000 (UTC)] DEBUG Message '[object Object]' matched regex //^[#]?hubot[:,]?\s*(?:PING$)/i/
[Mon Feb 24 2014 02:06:01 GMT+0000 (UTC)] DEBUG OUT >
<message to="XXXXX_188883#chat.hipchat.com" type="chat" from="XXXXXXXX#chat.hipchat.com/hubot-hipchat">
<inactive xmlns="http://jabber/protocol/chatstates"/>
<body>PONG</body>
</message>
I think the issue is that it uses chat.hipchat.com for 1:1 chat, and conf.hipchat.com for rooms. If you specified a specific hostname, you'll get one or the other, but not both.
If you set the environmental variables via CLI, to unset it, do
unset HUBOT_HIPCHAT_HOST.
Have you only tried: #hubot help? You can set up your prefix via: Here It does say that the
For example, the HipChat Adapter converts #hubot into hubot: before passing it to Hubot.
But I'd go ahead and try the following. Also attempt to try it locally via bin/hubot running it via the shell.
Hubot help
hubot help
Not to mention check heroku logs to make sure that hubot is showing up in your hipchat channel correctly.
Hope this helps.

Resources