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

Godot Engine - Project Manager 4.0.alpha4 - can't resolve https://godotengine.org/asset-library/api/ #59037

Closed
mo-moxi-gd opened this issue Mar 11, 2022 · 5 comments · Fixed by #59351

Comments

@mo-moxi-gd
Copy link

Godot version

v4.0.alpha4.official(f470979)

System information

Debian 11 (Bulleye)

Issue description

Project manager can't resolve https://godotengine.org/asset-library/api/

Steps to reproduce

Load Godot alpha 4, then select asset library projects

Minimal reproduction project

No response

@Sauermann
Copy link
Contributor

I am unable to reproduce this issue on Debian 11 with v4.0.alpha4.official [f470979].
It works for me.

@Calinou
Copy link
Member

Calinou commented Mar 11, 2022

@mo-moxi-gd Are you behind an HTTP proxy or a dual-stack IPv4/IPv6 connection?

Support for HTTP proxies was added in master, but it currently needs to be configured manually in the Editor Settings (after creating a project).

@Sniperchang
Copy link

I have this issue. According to the conversation in this issue, I seem to have a broken dual-stack, where I can ping godotengine.org via IPv4 but not IPv6. But I don't have this issue with V3.4.3

@RibalGZ
Copy link

RibalGZ commented Mar 19, 2022

I have this issue. According to the conversation in this issue, I seem to have a broken dual-stack, where I can ping godotengine.org via IPv4 but not IPv6. But I don't have this issue with V3.4.3

Same problem here using the master branch.

@akien-mga akien-mga added this to the 4.0 milestone Mar 19, 2022
@taisph
Copy link
Contributor

taisph commented Mar 20, 2022

Godot outputs the message below to the console:

ERROR: getaddrinfo failed! Cannot resolve hostname.
   at: _resolve_hostname (drivers/unix/ip_unix.cpp:98)

int s = getaddrinfo(p_hostname.utf8().get_data(), nullptr, &hints, &result);
if (s != 0) {
ERR_PRINT("getaddrinfo failed! Cannot resolve hostname.");
return;
}

It seems to be caused by the proxy handling code. It expects the proxy host to be empty or the port to be -1, but when it gets the proxy config from the editor settings, if they are not set, proxy host is U"null" (.is_empty() is then false) and port is 0, which makes godot try and fail to resolve the proxy host.

void HTTPClientTCP::set_http_proxy(const String &p_host, int p_port) {
if (p_host.is_empty() || p_port == -1) {
http_proxy_host = "";
http_proxy_port = -1;
} else {
http_proxy_host = p_host;
http_proxy_port = p_port;
}
}
void HTTPClientTCP::set_https_proxy(const String &p_host, int p_port) {
if (p_host.is_empty() || p_port == -1) {
https_proxy_host = "";
https_proxy_port = -1;
} else {
https_proxy_host = p_host;
https_proxy_port = p_port;
}
}

Adding network/http_proxy/port = -1 to the "~/.config/godot/editor_settings-4.tres" file is enough to make Godot ignore the proxy and the asset library no longer fails to lookup the host. Maybe setting the editor defaults is a good approach.

taisph added a commit to taisph/godot that referenced this issue Mar 20, 2022
HTTPClientTCP expects proxy host to be empty or port to be -1 to ignore
the proxy. When getting the proxy config from the settings file, the
values will default to U"null" and 0, respectively, making HTTPClientTCP
to attempt to use the values as a proxy, which causes getaddrinfo to
fail looking up a "null" hostname.

Setting the default config values seems like a good approach to prevent
this issue.

Fixes godotengine#59037
gaudecker pushed a commit to gaudecker/godot that referenced this issue Apr 3, 2022
HTTPClientTCP expects proxy host to be empty or port to be -1 to ignore
the proxy. When getting the proxy config from the settings file, the
values will default to U"null" and 0, respectively, making HTTPClientTCP
to attempt to use the values as a proxy, which causes getaddrinfo to
fail looking up a "null" hostname.

Setting the default config values seems like a good approach to prevent
this issue.

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

Successfully merging a pull request may close this issue.

8 participants