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

When nextUri is returned without a specified port, ERR_SOCKET_BAD_PORT is returned #38

Open
edwardflo opened this issue Aug 23, 2020 · 2 comments

Comments

@edwardflo
Copy link

When Presto returns a nextUri without a specified port number(e.g. http://prestoserver/v1/api/...), the following error is returned: RangeError: Port should be >= 0 and < 65536. Received .RangeError [ERR_SOCKET_BAD_PORT]: Port should be >= 0 and < 65536. Received .

This is due to the opts.port being an empty string when making a subsequent request due to: 5b87989#diff-bc0ed6253188f59cfb43f199aaea9eabR57-R67

Specifically, line 59, URL returns href.port as ''.

The way to fix this is to add the following at line 69: if (opts.port === '') delete opts.port; or opts.port = client.port;

My scenario is not an unusual situation. I simply have a firewall forwarding port 80 (as well as 443) to the presto coordinator on port 8080. The above error is seen when trying to contact it using port 80 or port 443 (with ssl turned on).

Would you be able to add one of the above-mentioned fixes?

Thanks

@tagomoris
Copy link
Owner

#37 ?

@tagomoris
Copy link
Owner

This should be fixed at v0.8.1 https://www.npmjs.com/package/presto-client/v/0.8.1

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