farcasterxyz / hub-monorepo

Implementation of the Farcaster Hub specification and supporting libraries for building applications on Farcaster
https://www.thehubble.xyz
MIT License
675 stars 365 forks source link

The problem with port 2283 #2072

Closed Zikett closed 1 week ago

Zikett commented 1 month ago

What is the bug?

I've seen a lot of people posting about the port 2283 problem and read the replies. But they probably have nodes on their home network.

But I have a problem with port 2283 on VPS server and my friends have the same problem. We rent servers from different companies, but the problem is the same for everyone. Dashboard shows that port 2283 is not open, but it is not, I opened it with iptables, I also tried to open it with UFW. I have also asked the company tech support to open ports on their end, they say they don't block them. I have provided a screenshot of my Dashboard for 24 hours, and in 24 hours only 7.5 Inbound Sync Attempts. I think this is very low or not? How can I solve this problem or is it a problem in node or Dashboard is showing wrong information?

Specifications of my VPS: Ubuntu 22.04 6CPU + 16RAM + 300 Gb SSD + 1 Gbit/s

How can it be reproduced? (optional) I have provided a screenshot of my Dashboard for 24 hours, and in 24 hours only 7.5 Inbound Sync Attempts Снимок экрана 2024-06-19 130705

Zikett commented 1 month ago

image

prav33nm commented 3 weeks ago

Hi, @Zikett I am having the same issue. My ports were open, but the problem still persists. Have you fixed it by any chance?

Zikett commented 3 weeks ago

Hi, @Zikett I am having the same issue. My ports were open, but the problem still persists. Have you fixed it by any chance?

No, I'm waiting for an answer.

ABarinovEcom commented 2 weeks ago

I am having the same issue. My ports were open, but the problem still persists. Have you fixed it by any chance? image

Zikett commented 1 week ago

I am having the same issue. My ports were open, but the problem still persists. Have you fixed it by any chance? image

no, I'm waiting

sds commented 1 week ago

It doesn't make much sense to me that your port would only be open some of the time, unless your hub is down periodically.

Do your hub logs mention anything about the hub terminating/restarting?

What happens when you curl your hub's public IP address at port 2283? You can try something like the following:

⨠ curl https://lamia.farcaster.xyz:2283 -i
HTTP/2 415

In this case, the response is expected since we're trying to use HTTP/1.1 for a gRPC endpoint. If you're not seeing that response, however, then the issue is a network configuration problem with your VPS/cloud provider.

Zikett commented 1 week ago

It doesn't make much sense to me that your port would only be open some of the time, unless your hub is down periodically.

Do your hub logs mention anything about the hub terminating/restarting?

What happens when you curl your hub's public IP address at port 2283? You can try something like the following:

⨠ curl https://lamia.farcaster.xyz:2283 -i
HTTP/2 415

In this case, the response is expected since we're trying to use HTTP/1.1 for a gRPC endpoint. If you're not seeing that response, however, then the issue is a network configuration problem with your VPS/cloud provider.

My VPS server has been online for a whole month and it has never been turned off, there have been no problems with the Internet either. I periodically watch garfana's dashboard. After entering your command, I received the same response. Снимок экрана 2024-07-09 121215

sds commented 1 week ago

According to your screenshot you entered the literal exact same command. You need to swap https://lamia.farcaster.xyz:2283 with whatever IP address your hub's VPS has, and you need to make sure you're running curl from a different computer than the VPS.

sds commented 1 week ago

Also, if your hub isn't served using HTTPS, switch the URL to something like: http://1.2.3.4:2283 (where 1.2.3.4 is your public IP).

Zikett commented 1 week ago

Also, if your hub isn't served using HTTPS, switch the URL to something like: http://1.2.3.4:2283 (where 1.2.3.4 is your public IP).

image I used a different vps to test it out. Here's what came up. But dashboard still says that the port is closed.

sds commented 1 week ago

Using the IP address in your screenshot, I was able to confirm that you appear to have the necessary ports open (commands ran on my mac, which has a different version of nc than most Linux distros, so the below commands might not work correctly on Linux):

> echo | nc 185.103.101.62 2282 && echo 'Port open' || echo 'Port closed'
Port open
> echo | nc 185.103.101.62 2283 && echo 'Port open' || echo 'Port closed'
Port open

This might just be a confusing error message that is safe to ignore. The No Incoming Connections! Are your ports open? message you see is what Grafana displays when there are 0 inbound connections, but it doesn't necessarily mean your ports are closed.

There are a large number of hubs on the network (>13K at time of writing) which was not something we were expecting. With so many hubs, it's possible that you might not be getting inbound connections (there are so many hubs to connect to, and hubs connect to a limited number of other hubs, so you can randomly not have inbound connections to your hub). If you read the tooltip of that message:

Gossip works even without inbound connections [...]

So if your hub otherwise appears to be working fine, I would ignore this error. Going to close question as answered, but if there's something we're missing from your description let us know.