Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: UDP - Timed out after 2000ms [valve, csgo] #108

Closed
onrdrsy opened this issue Feb 10, 2019 · 7 comments
Closed

Error: UDP - Timed out after 2000ms [valve, csgo] #108

onrdrsy opened this issue Feb 10, 2019 · 7 comments

Comments

@onrdrsy
Copy link

onrdrsy commented Feb 10, 2019

Thank you for your game project.

I get this error for some servers.
What is the problem? A bug caused by a provider?

Running attempt with options:
9:20 PM

{ socketTimeout: 2000,
9:20 PM

  attemptTimeout: 10000,
9:20 PM

  maxAttempts: 1,
9:20 PM

  port: 27015,
9:20 PM

  protocol: 'valve',
9:20 PM

  type: 'csgo',
9:20 PM

  host: '185.184.27.48',
9:20 PM

  debug: true }
9:20 PM

DNS Lookup: 185.184.27.48
9:20 PM

Raw IP Address: 185.184.27.48
9:20 PM

Requesting info ...
9:20 PM

185.184.27.48:27015 UDP-->
9:20 PM

Buffer length: 25 bytes
9:20 PM

ff ff ff ff 54 53 6f 75 72 63 65 20 45 6e 67 69 6e 65 20 51 75 
9:20 PM

            T  S  o  u  r  c  e     E  n  g  i  n  e     Q  u  
9:20 PM

65 72 79 00 
9:20 PM

e  r  y     
9:20 PM

9:20 PM

UDP timeout detected
9:20 PM

(node:8519) UnhandledPromiseRejectionWarning: Error: UDP - Timed out after 2000ms
9:20 PM

    at Timeout.setTimeout (/rbd/pnpm-volume/877d9f28-4b6e-4b14-a4c0-dacc63c02ab9/node_modules/.registry.npmjs.org/gamedig/2.0.12/node_modules/gamedig/lib/Promises.js:7:25)
9:20 PM

    at ontimeout (timers.js:498:11)
9:20 PM

    at tryOnTimeout (timers.js:323:5)
9:20 PM

    at Timer.listOnTimeout (timers.js:290:5)
9:20 PM

(node:8519) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
9:20 PM

(node:8519) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@mmorrisontx
Copy link
Member

Hey there, what version of gamedig are you using?

@onrdrsy
Copy link
Author

onrdrsy commented Feb 11, 2019

Thanks for reply.

Version 2.0.12
I see the same error for all servers right now.

@mmorrisontx
Copy link
Member

That's... very strange. The "unhandled promise rejection" is definitely being handled, as the handler is what prints out UDP timeout detected immediately before that. Which version of node.js are you using? Perhaps there's a bug on some version range that I thought we supported?

@onrdrsy
Copy link
Author

onrdrsy commented Feb 11, 2019

That's... very strange. The "unhandled promise rejection" is definitely being handled, as the handler is what prints out UDP timeout detected immediately before that. Which version of node.js are you using? Perhaps there's a bug on some version range that I thought we supported?

I'm home now, I'm sorry for the late reply. My project is completely problematic in gamedig@2.0.12. Now I'm back in the 1.0.49 version. When I debug some servers, I get the following error:

note: socketTimeout: 5000, udpTimeout: 10000

185.184.27.215:27015 UDP-->
11:06 PM

ff ff ff ff 54 53 6f 75 72 63 65 20 45 6e 67 69 6e 65 20 51 75 
11:06 PM

            T  S  o  u  r  c  e     E  n  g  i  n  e     Q  u  
11:06 PM

65 72 79 00 
11:06 PM

e  r  y     
11:06 PM


@mmorrisontx
Copy link
Member

The last snippet you've posted doesn't contain an error. If it's the same UDP timeout, either there is a firewall between you and the server, preventing you from receiving the udp responses, or the server is offline.

@mmorrisontx
Copy link
Member

If you are still receiving UnhandledPromiseRejectionWarning, ensure that you are catching the promise rejections thrown by gamedig as described in the readme.

Gamedig.query({
    type: 'minecraft',
    host: 'mc.example.com'
}).then((state) => {
    console.log(state);
}).catch((error) => {
    console.log("Server is offline");
});

Gamedig will throw an error if the server is unresponsive of offline, and if you do not catch that error, node will print the UnhandledPromiseRejectionWarning.

@mmorrisontx
Copy link
Member

If you are still having this issue, check to see if you are polyfilling node's Promise implementation with Bluebird. This seems to be an issue related to older versions conflicting with node's async/await: petkaantonov/bluebird#1404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants