bosagora / agora

POC Node implementation for CoinNet
https://bosagora.io
MIT License
36 stars 22 forks source link

RestInterfaceClient: 301 causes an Exception #3066

Open Geod24 opened 2 years ago

Geod24 commented 2 years ago

Seen live:

2022-02-16 01:39:18,752 Info [agora.network.Manager] - Couldn't register our address: vibe.web.common.RestException@submodules/vibe.d/web/vibe/web/rest.d(2080): Moved Permanently
----------------
submodules/vibe.d/web/vibe/web/rest.d:2080 @safe vibe.http.client.HTTPClientResponse vibe.web.rest.request(vibe.inet.url.URL, void delegate(vibe.http.client.HTTPClientRequest) @safe, scope void delegate(vibe.http.client.HTTPClientRequest, scope vibe.core.stream.InputStream) @safe, vibe.http.common.HTTPMethod, immutable(char)[], scope ref const(vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], false, 12uL, false).DictionaryList), immutable(char)[], immutable(char)[], ref vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], false, 12uL, false).DictionaryList, ref vibe.utils.dictionarylist.DictionaryList!(immutable(char)[], false, 12uL, false).DictionaryList, in vibe.http.client.HTTPClientSettings) [0x55908f379e43]
source/agora/api/Admin.d:1945 @safe void vibe.web.rest.executeClientMethod!(agora.api.Registry.NameRegistryAPI, 1, vibe.web.rest.RestInterfaceClient!(agora.api.Registry.NameRegistryAPI).RestInterfaceClient.__mixin20.postValidator(agora.api.Registry.RegistryPayloadData, agora.crypto.Schnorr.Signature).data, vibe.web.rest.RestInterfaceClient!(agora.api.Registry.NameRegistryAPI).RestInterfaceClient.__mixin20.postValidator(agora.api.Registry.RegistryPayloadData, agora.crypto.Schnorr.Signature).sig).executeClientMethod(scope ref const(vibe.web.internal.rest.common.RestInterface!(agora.api.Registry.NameRegistryAPI).RestInterface), void delegate(vibe.http.client.HTTPClientRequest) @safe, scope void delegate(vibe.http.client.HTTPClientRequest, scope vibe.core.stream.InputStream) @safe) [0x55908ef63cd8]
submodules/vibe.d/utils/vibe/internal/meta/codegen.d-mixin-301:304 @safe void vibe.web.rest.RestInterfaceClient!(agora.api.Registry.NameRegistryAPI).RestInterfaceClient.__mixin20.postValidator(agora.api.Registry.RegistryPayloadData, agora.crypto.Schnorr.Signature) [0x55908ef6361b]
source/agora/network/Manager.d:735 @safe void agora.network.Manager.NetworkManager.onRegisterName() [0x55908eb0783e]
source/agora/common/Task.d:76 [0x55908ee4e367]
source/agora/common/Task.d:73 [0x55908ee4e34c]
submodules/vibe-core/source/vibe/core/core.d:1115 [0x55908f60029f]
submodules/vibe-core/source/vibe/core/task.d:721 nothrow void vibe.core.task.TaskFuncInfo.set!(void delegate(vibe.core.core.Timer) nothrow @safe, vibe.core.core.Timer).set(ref void delegate(vibe.core.core.Timer) nothrow @safe, ref vibe.core.core.Timer).callDelegate(ref vibe.core.task.TaskFuncInfo) [0x55908f6404f5]
submodules/vibe-core/source/vibe/core/task.d:739 void vibe.core.task.TaskFuncInfo.call() [0x55908f63de4b]
submodules/vibe-core/source/vibe/core/task.d:446 nothrow void vibe.core.task.TaskFiber.run() [0x55908f63d5a9]
??:? fiber_entryPoint [0x55908f7f764a]. Trying again later..

This happened because the endpoint was configured with http, and Nginx would redirect http to https, but 301 should just be followed IMO. Set as "Unbounded" as we can work around it for now.

Geod24 commented 2 years ago

Upstream: https://github.com/vibe-d/vibe.d/issues/2642