upptime icon indicating copy to clipboard operation
upptime copied to clipboard

Status evaluated before getting tcp-ping results

Open jayantkatia opened this issue 4 years ago • 4 comments

Status evaluated before getting tcp-ping results

https://github.com/upptime/uptime-monitor/blob/master/src/update.ts#L116 While performing tcp-ping in update.ts, status is evaluated before pinging the website.

jayantkatia avatar Aug 23 '21 18:08 jayantkatia

So this is what causes #328

kescherCode avatar Aug 27 '21 19:08 kescherCode

Using tcp-ping instead of curl
Got pinging error ReferenceError: Cannot access 'responseTime' before initialization
    at performTestOnce (/home/runner/work/_actions/jayantkatia/uptime-monitor/scripts-enabled/dist/update.js:124:38)
    at Object.update (/home/runner/work/_actions/jayantkatia/uptime-monitor/scripts-enabled/dist/update.js:190:58)
Using tcp-ping instead of curl
Got result {
  address: 'https://thissitedoesnotexist.koj.co',
  port: 80,
  attempts: 5,
  avg: NaN,
  max: undefined,
  min: undefined,
  results: [
Error: eq: 0, time: undefined, err: [Error] },
Error: eq: 1, time: undefined, err: [Error] },
Error: eq: 2, time: undefined, err: [Error] },
Error: eq: 3, time: undefined, err: [Error] },
Error: eq: 4, time: undefined, err: [Error] }
  ]
}
[master 0dd42ca] 🟩 Test Broken Site is up (200 in 0 ms) [skip ci] [upptime]

Reference error in the logs is due to #436 #328 is due to no checks for errors returned in the results array. Refer: #6 of tcp-ping.

jayantkatia avatar Aug 27 '21 21:08 jayantkatia

upptime/uptime-monitor#157 might solve this.

jayantkatia avatar Aug 28 '21 07:08 jayantkatia

So is that the solution or not? Its an old problem, tcp-ping just does not work. What does @AnandChowdhary think about this issue?

The CLA problem is to blame on github, as i see that often here, ppl that want to help cant handle it correctly, must be an implementation detail at this site. Something seems not to be clear enough.

What can we do next?

gitgrub avatar Sep 22 '21 05:09 gitgrub