InnateAlpaca / BedrockBridge

BedrockBridge provides Bedrock Dedicated Servers with connection to discord for chat and commands
https://bedrockbridge.esploratori.space
MIT License
36 stars 4 forks source link

Giving Error "IP Invalid when trying !connect" #6

Closed SamDaaEpic closed 4 months ago

SamDaaEpic commented 4 months ago

The title basically explains my issue. When I try to connect to the discord server from the bds chat by typing !connect, it gives impossible to connect, please check !messages or something and when I check !messsages, it says Invalid IP. I have tried putting the Origin in the forum also when it pops up, but that didn't help also.

InnateAlpaca commented 4 months ago

Hello! There could be a number of reasons for this behavior. Please let me know your setup (software, hosting, network...).

Your issue should be fixed by requesting a new token, and adding it to the form. Please note that each token is associated with the domain, and is invalidated by newer token requests. So make sure you did stuff in the right order (new token, setup, connect).

If the error persists it may be due to your network setup (e.g. using certain proxies), if that's the case you need a different solution.

SamDaaEpic commented 4 months ago

Hello, I'm hosting my server on a Dedicated Linux Server in my house. But I do have a weird networking setup for exposing to the internet. Basically I have a Oracle Cloud Instance running in the cloud and I'm routing my traffic through the Oracle Cloud Instance for exposing the Server. I'm having to do all this because my ISP puts me behind CG-NAT.

Could that be a issue?

InnateAlpaca commented 4 months ago

ok, so you are routing bds traffic through that. Thing is that the rest of your traffic is probably not. This includes the tcp requests made by the bds-server to our endpoint. As a consequence the "origin" address you are using is not the actual address tcp requests are made from.

The solution is not to use the origin parameter at all (just request a new token). Or use your own ip as origin, the same address you would gather e.g. form here.

SamDaaEpic commented 4 months ago

I did try not using the Origin at all but that didn't work. And I also tried using my Own IP but that also didn't work because nothing is open in my IP and I'm using Oracle Cloud IP to connect to my server as I'm routing my UDP server traffic through that.

Could you tell me the TCP Ports that are required to be opened for communication of the BDS server with Discord, so that I can open them and route them through the Oracle Cloud Instance also and It might work?

InnateAlpaca commented 4 months ago

Are you saying that you use your personal pc uniquely for the bedrock server? You don't even use it for downloading the new versions of bds? (which requires ofc tcp connection to get it from the website)

Also remember that you need to generate and fill in a new token at each attempt. Please try again using a new token each time.

The TCP requests made by the behaviour pack are no different from any browser request, and ofc they don't have a fixed port on your device. So, unless you are filtering them by destination port I don't see how that would help. The destination port rn is 60 anyway (will be changed with bridge v2.0).

Please also provide me with your discord server name, or part of it, so that I can check what's the setup status from backend.

SamDaaEpic commented 4 months ago

I'm running BDS in a lxc container on Proxmox. And it does have a internet connection and does autoupdate to the latest bds versions ('m using the docker image of bds server from itzg).

I do know that you need to fill in the forum with the new token every time, I've tried numerous times now and it does not work as intended.

The discord server name is WayneSMP.

InnateAlpaca commented 4 months ago

Ok, so what I can see from logs is that requests never reached my endpoint. There is no domain or ip associated rn. So I would assume that requests simply didn't get through. Which makes sense if you only allow udp traffic. Can you allow tcp traffic as well?

SamDaaEpic commented 4 months ago

I don't know much about about this. But I can open up TCP ports. rn I only have exposed the UDP 19132 port on that lxc container. I basically have a wireguard server running on oracle cloud and have the wireguard client on my server connected to the wireguard server on the Oracle Cloud and is routing traffic through that.

Will I have to expose the TCP port 60 to get it working?

InnateAlpaca commented 4 months ago

no, that's the destination port, don't you have a option for outgoing tcp traffic?

InnateAlpaca commented 4 months ago

The discord requests are HTTP POST from your device to our endpoint, not the reverse.

SamDaaEpic commented 4 months ago

I don't see any option of allowing outgoing tcp traffic in wireguard. Is there any way I can host the Discord Bot myself on my server?

InnateAlpaca commented 4 months ago

Please if you can reach out on discord do that, so to have a faster (and private) communication. The bot can't be self hosted. Also, even if that was the case it wouldn't seem like it would solve your issue. We'd need to make a few tests about your setup:

Finally you can send me your address and I can set it up manually. As you see there's a number of things we can try. And a number of reasons you could be having this issue. We may even try to reset the entire bot for your server.

SamDaaEpic commented 4 months ago

I have reached out to you on discord, please check your DM's.

Yeah, I'm able to make outgoing requests from my server, as I can reach out to the minecraft server and download the bds server from there with wget or curl. On the server startup logs I see some beta api messages about it granting access to beta api and when I try to !connect, in the logs I see Connection established, but from the server, I see it is not actually established and the connection is still offline