fzaninotto / uptime

A remote monitoring application using Node.js, MongoDB, and Twitter Bootstrap.
http://fzaninotto.github.com/uptime/
MIT License
3.62k stars 703 forks source link

Fix IntervalBuilder crash during a check deletion #246

Closed soullivaneuh closed 7 years ago

soullivaneuh commented 10 years ago

As I said in #243, if we delete a check with a huge pings history, it's very long (Because of I/O mass operations, #245) and finally crash certainly because the IntervalBuilder try to calculate duration and/or downtime of a check that doesn't exist anymore.

I managed to find a workaround by invoking the calculation function only if check exists.

I don't know if is the best way but now, the very long delete processing works after all and the all of the uptime system seems to work properly.

richardsonlima commented 10 years ago

Hello Soullivaneuh , what's the solution for this problem ?

soullivaneuh commented 10 years ago

This workaround is the only solution I found...

richardsonlima commented 10 years ago

Sullivan,

I need fix it,what's the how to for use this workaround ?

On Wednesday, July 16, 2014, Sullivan SENECHAL notifications@github.com wrote:

This workaround is the only solution I found...

— Reply to this email directly or view it on GitHub https://github.com/fzaninotto/uptime/pull/246#issuecomment-49140176.

Enviado do Gmail para celular

soullivaneuh commented 10 years ago

You can checkout my fork until the PR is not merged: https://github.com/Soullivaneuh/uptime/tree/try-fix-builder

richardsonlima commented 10 years ago

Cannot find module 'express' =/


user@uptime:~/uptime-try-fix-builder# node app

module.js:340 throw err; ^ Error: Cannot find module 'express' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/root/uptime-try-fix-builder/app.js:7:18) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10)

2014-07-18 6:57 GMT-03:00 Sullivan SENECHAL notifications@github.com:

You can checkout my fork until the PR is not merged: https://github.com/Soullivaneuh/uptime/tree/try-fix-builder

— Reply to this email directly or view it on GitHub https://github.com/fzaninotto/uptime/pull/246#issuecomment-49414504.

[image: Blog] http://www.richardsonlima.com.br/

Richardson Lima / IT network and systems administrator 558196871061/ contatorichardsonlima@gmail.com

http://www.richardsonlima.com.br Blog: http://blog.richardsonlima.com.br

Recife, Brazil

[image: Facebook] https://www.facebook.com/richardson.hachid [image: Twitter] https://twitter.com/richardsonlima [image: Google Plus] https://plus.google.com/u/0/+RichardsonLimaBjj/posts [image: Linkedin] http://br.linkedin.com/in/richardsonlima [image: Instagram] http://instagram.com/richardsonlimagbbjj [image: Skype]

This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.

Linux User #338927

soullivaneuh commented 10 years ago

Check if all your npm modules are installed.

richardsonlima commented 10 years ago

Hello Sullivan,

Thanks !!!


apt-get install mongodb-server

apt-get install npm

wget https://github.com/Soullivaneuh/uptime/archive/try-fix-builder.zip .

apt-get install nodejs

cd try-fix-builder


Create a mongodb user:

$ mongo

use uptime db.addUser('user','pw'); exit WARNING: The 'addUser' shell helper is DEPRECATED. Please use 'createUser' instead

Restart mongo:

/etc/init.d/mongo restart

Add the data to config/default.yml:

mongodb: server: localhost database: uptime user: mongouser

password: mongopass

npm install

node app

http://localhost:8082/dashboard/events

2014-07-21 11:41 GMT-03:00 Sullivan SENECHAL notifications@github.com:

Check if all your npm modules are installed.

— Reply to this email directly or view it on GitHub https://github.com/fzaninotto/uptime/pull/246#issuecomment-49613969.

[image: Blog] http://www.richardsonlima.com.br/

Richardson Lima / IT network and systems administrator 558196871061/ contatorichardsonlima@gmail.com

http://www.richardsonlima.com.br Blog: http://blog.richardsonlima.com.br

Recife, Brazil

[image: Facebook] https://www.facebook.com/richardson.hachid [image: Twitter] https://twitter.com/richardsonlima [image: Google Plus] https://plus.google.com/u/0/+RichardsonLimaBjj/posts [image: Linkedin] http://br.linkedin.com/in/richardsonlima [image: Instagram] http://instagram.com/richardsonlimagbbjj [image: Skype]

This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. Company Name is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.

Linux User #338927

lippoliv commented 10 years ago

Seems to work für me for #266 But it's still a workarround.

marcusramberg commented 10 years ago

I hit this crash almost as soon as I started uptime as well. Would be very good to see a fix here. Not sure why you consider this a "workaround"? It's just argument checking afaict?

soullivaneuh commented 10 years ago

Yes @marcusramberg, just a test that will ignore duration calculation if check does not exist! :+1:

JaySim20 commented 9 years ago

Hi - I've applied this fix and it seems to resolve the crash, but now I can't seem to add any new tags. I see this in the logs:

{ [MongoError: assertion src/mongo/db/query/planner_analysis.cpp:114] name: 'MongoError' }

Thoughts?

JaySim20 commented 9 years ago

FWIW, I ended up reverting the fix here because I had an issue with tags going forward (my previous comment). I ended up discovering that in my situation, this crash would happen awhile after I deleted the last check that referenced a particular tag. For example if you were to click on the tag name in the tags view, you would not see any checks. I was able to workaround this by fixing qosAggregator.createTagDailyStats - in there I wrapped lines 388-402 in a condition where I make sure that there is at least one check before using intervalBuilder: if (checks && (checks.length > 0)) {

hope this helps someone

soullivaneuh commented 7 years ago

Closing as this project is not maintained anymore.

ingobaab commented 6 years ago

404 try-fix-builder is gone to nirvana.. why?