mertushka / haxball.js

🎉 A powerful Node.JS library for interacting with the Haxball Headless Host API
https://github.com/haxball/haxball-issues/wiki/Headless-Host#api
MIT License
33 stars 4 forks source link

FetchError - ENOTFOUND #18

Closed furkanardagul closed 1 year ago

furkanardagul commented 1 year ago

Hi,

After a certain time, it gives an error like this and terminates the application. What could be the reason for this?

Ekran Resmi 2023-03-01 17 54 20

jakjus commented 1 year ago

the connection to the haxball endpoint failed. it is connectivity error, that may be caused by your local/remote machine losing (internet) connection or haxball provider api being temporarily unavailable.

furkanardagul commented 1 year ago

Hi,

I have been consistently receiving the "ENOTFOUND" error for a while now. It persists for a day or two and then disappears, but afterwards, it suddenly causes my computer to crash. Initially, it wasn't a problem since it didn't affect my work when my room wasn't occupied, but later on, it caused tremendous damage. Can you show me a solution or suggest any troubleshooting steps I should try regarding this issue? You can see the error I'm getting in the attachment. Attachment

mertushka commented 1 year ago

@basro How often and when does the script make requests to rs/api/host? Is there any possibilities to Cloudflare block certain requests? Or something like that on Haxball's backend? If the answer is no then i guess problem is on the @furkanardagul's network.

basro commented 1 year ago

The endpoint in question will be called at the start of the connection. It will be called about once a minute until it succeeds and then wont be called again.

That error looks to me like a DNS lookup that failed. Not sure why it would happen to @furkanardagul but it's most likely not cloudflare actively blocking him.

mertushka commented 1 year ago

@furkanardagul Run this script while hosting a Haxball Headless Room and see if its throwing any errors. Maybe this can help us to understand whats going on.

const dns2 = require('dns2');

const dns = new dns2({});

setInterval(async () => {
  await dns.resolveA('www.haxball.com').catch((error) => {
      throw new Error(error);
  });
}, 1000);
mertushka commented 1 year ago

@basro Haxball seems redirecting www.haxball.com -> haxball.com. Maybe (?) using non www API calls on script would help with less DNS queries?

basro commented 1 year ago

Haxball does not redirect from www to haxball.com, if anything it's the other way around. But in any case that's done in the http response which come after the domain name is resolved so it would be unrelated to this problem.

furkanardagul commented 1 year ago

I receive my network connection from Turkey/EtkinHost company, and I believe there is no issue with the server. After having conversations with them, they stated that there are no restrictions on their end. Once I try the relevant script, I will provide an update.

furkanardagul commented 1 year ago

photo

I have added the relevant code snippet, but it crashed again as shown in the attachment, without printing an error log.

furkanardagul commented 1 year ago

@basro , @mertushka

mertushka commented 1 year ago

@furkanardagul You must run the relevant DNS script apart from actual Haxball Room script, in a different terminal. Also what DNS servers does ur VDS use? If its using ISP-provided DNS servers, I recommend manually changing it to any public DNS server. (1.1.1.1, 8.8.8.8 etc)

furkanardagul commented 1 year ago

Ekran Resmi 2023-08-04 01 25 11

As you stated, I have opened the relevant script in a separate file and am waiting for a new output. My rooms were closed a while ago, I opened them again and I'm waiting for the new result. DNS goes over 1.1.1.1.

furkanardagul commented 1 year ago

Ekran Resmi 2023-08-04 17 58 19 New error. I couldn't catch an error in the script I ran. The game bot crashed again with an error.

mertushka commented 1 year ago

New error. I couldn't catch an error in the script I ran. The game bot crashed again with an error.

The error in screenshot is not related with this issue. There is a DDoS attack ongoing on Haxball's servers at the moment. See #20.

furkanardagul commented 1 year ago

New error. I couldn't catch an error in the script I ran. The game bot crashed again with an error.

The error in screenshot is not related with this issue. There is a DDoS attack ongoing on Haxball's servers at the moment. See #20.

CEC68C27-E345-413C-A564-AEFD02C51AA9

this new error.

mertushka commented 1 year ago

Please remove dns2 from your actual headless script. I told you to run it from different script/terminal.

furkanardagul commented 1 year ago

I'm already running it in a separate command script I removed the headless from my code.