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

Connexion problem #158

Open
eldarius24 opened this issue Nov 14, 2021 · 11 comments
Open

Connexion problem #158

eldarius24 opened this issue Nov 14, 2021 · 11 comments
Labels
enhancement New feature or request

Comments

@eldarius24
Copy link

Hello @CreepPork i have a problem with the bot, when i try to connect this to my server, i have this message

Bot has logged in
Apollo is ready.
Performing first-start refresh.
Error: Failed all 2 attempts
at QueryRunner.run (/apollo/Apollo/node_modules/gamedig/lib/QueryRunner.js:88:21)
Attempt #1 - Port=2333 Retry=0:
Error: UDP - Timed out after 2000ms
at Timeout.setTimeout (/apollo/Apollo/node_modules/gamedig/lib/Promises.js:7:25)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
Attempt #2 - Port=2332 Retry=0:
Error: UDP - Timed out after 2000ms
at Timeout.setTimeout (/apollo/Apollo/node_modules/gamedig/lib/Promises.js:7:25)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
Failed to refresh server info. Remaining retries: 1/3

I try with 2 VPS on debian (same problem)
I try différent arma ip server (and a server arma with your bot)

if you have an idea 👍

@CreepPork CreepPork added the question Further information is requested label Nov 15, 2021
@CreepPork
Copy link
Owner

Hi, it seems that from Apollo's side your server is not accessible. It could be either the server's firewall blocking it, wrong IP address and/or ports are not correct.

Try a port checker and see if you can connect to that server.

@eldarius24
Copy link
Author

i think the same, the firewall side apollo block the connexion, you have a default port define ?

@eldarius24
Copy link
Author

eldarius24 commented Nov 15, 2021

For more information,
From the beginning i have the bot connected to my discord server and when i tried to discute with it, it responds
image

So i have a connexion with it.

But...
image

And i open the firewall
image

@CreepPork
Copy link
Owner

You need to expose Steam Query ports too: see all ports here.

@eldarius24
Copy link
Author

On my arma server or Apollo server, because my Apollo is already open

@CreepPork
Copy link
Owner

On your Arma 3 server.

@CreepPork
Copy link
Owner

Closing as no response, if you experience the issue once again, feel free to re-open this issue.

@eldarius24

This comment was marked as off-topic.

@eldarius24
Copy link
Author

eldarius24 commented Feb 18, 2022

hello @CreepPork, i reopen this discussion because i want to put your bot in a docker and after trying on several machines and looking for different solutions, I really think that setting a port on gamedig will solve the problem. (https://www.npmjs.com/package/gamedig)

Can you tell me what you think about it and if it is difficult for you to solve?

thank you for you'r work

Common Issues

Firewalls block incoming UDP

(replit / docker / some VPS providers)

Most game query protocols require a UDP request and response. This means that in some environments, gamedig may not be able to receive the reponse required due to environmental restrictions.

Some examples include:

Docker containers

You may need to run the container in --network host mode so that gamedig can bind a UDP listen port.
Alternatively, you can forward a single UDP port to your container, and force gamedig to listen on that port using the instructions in the section down below.
replit
Most online IDEs run in an isolated container, which will never receive UDP responses from outside networks.
Various VPS / server providers
Even if your server provider doesn't explicitly block incoming UDP packets, some server hosts block other server hosts from connecting to them for DDOS-mitigation and anti-botting purposes.
Gamedig doesn't work in the browser
Gamedig cannot operate within a browser. This means you cannot package it as part of your webpack / browserify / rollup / parcel package. Even if you were able to get it packaged into a bundle, unfortunately no browsers support the UDP protocols required to query server status from most game servers. As an alternative, we'd recommend using gamedig on your server-side, then expose your own API to your webapp's frontend displaying the status information. If your application is thin (with no constant server component), you may wish to investigate a server-less lambda provider.

Specifying a listen UDP port override

In some very rare scenarios, you may need to bind / listen on a fixed local UDP port. The is usually not needed except behind some extremely strict firewalls, or within a docker container (where you only wish to forward a single UDP port). To use a fixed listen udp port, construct a new Gamedig object like this:

const gamedig = new Gamedig({
    listenUdpPort: 13337
});
gamedig.query(...)

@CreepPork CreepPork reopened this Feb 19, 2022
@CreepPork
Copy link
Owner

Hello, once again!

Sorry, missed your first reply after the closing.

I'm not sure, I understand your issue fully. You stated before that you tried it on 2 VPSes and it still didn't work. Are these your VPS or are you purchasing them from a provider, if so what provider?

You've also mentioned docker containers. Is Arma running in a Docker container or have you made a container for Apollo?

Please, try to elaborate on the infrastructure you are using, so I can help you better.

@eldarius24
Copy link
Author

Indeed, from the beginning I try to make an apollo docker that I could share to simplify the installation of the bot.
I tried my container on several servers, and each time the same error which is quite clear, there was not the right port open for apollo.
So I searched on the side of gamedig and I came across this article.

on https://www.npmjs.com/package/gamedig

Firewalls block incoming UDP

(replit / docker / some VPS providers)

Most game query protocols require a UDP request and response. This means that in some environments, gamedig may not be able to receive the reponse required due to environmental restrictions.

Some examples include:

Docker containers
You may need to run the container in --network host mode so that gamedig can bind a UDP listen port.
Alternatively, you can forward a single UDP port to your container, and force gamedig to listen on that port using the instructions in the section down below.

I tried the method -> You may need to run the container in --network host mode so that gamedig can bind a UDP listen port. and everything works fine.

but you have to think about opening the ports on the server and to simplify things I would have preferred it to be directly in the container that the port is defined

That's why I wanted to know if it was possible easily for you ?

@CreepPork CreepPork added enhancement New feature or request and removed question Further information is requested labels Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants