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

grpc port config included server block bug (Version: 1.10.1) #4557

Closed
interc0der opened this issue Jun 5, 2023 · 1 comment
Closed

grpc port config included server block bug (Version: 1.10.1) #4557

interc0der opened this issue Jun 5, 2023 · 1 comment
Assignees
Labels
Bug Good First Issue Great issue for a new contributor Will Need Documentation

Comments

@interc0der
Copy link
Collaborator

Issue Description

When building the rippled config, the grpc port cannot be included in the server block stanza.
If included, rippled will not boot. This seems odd, and I am suggesting that all ports/server stanzas should be included in the server block.

Steps to Reproduce

A handful of different configurations were tested to verify the behavior.

  1. All ports removed and isolated down to grpc_port - node stop
  2. Isolated down to grpc_port and add protocol - node stop
  3. grpc_port removed from server block - successful boot

  1. All ports removed and isolated down to grpc_port - node stop

Reason :

2023-May-25 06:23:58.886615258 UTC Application:ERR Missing 'protocol' in [port_grpc]
[server]
port_grpc
#ssl_key = /etc/letsencrypt/live/
#ssl_cert = /etc/letsencrypt/live/

[port_grpc]
port = 50051
ip = 0.0.0.0
secure_gateway = 127.0.0.1

  1. Isolated down to grpc_port and add protocol - node stop

Reason:

2023-May-25 06:25:31.239412338 UTC gRPC Server:NFO Starting gRPC server at 0.0.0.0:50051
E0525 06:25:31.239850513       1 chttp2_server.cc:1057]      UNKNOWN:No address added out of total 1 resolved for '0.0.0.0:50051' {created_time:"2023-05-25T06:25:31.239801722+00:00", children:[UNKNOWN:Failed to add any wildcard listeners {created_time:"2023-05-25T06:25:31.239796042+00:00", children:[UNKNOWN:Address family not supported by protocol {created_time:"2023-05-25T06:25:31.239732694+00:00", errno:97, os_error:"Address family not supported by protocol", syscall:"socket", target_address:"[::]:50051"}, UNKNOWN:Unable to configure socket {created_time:"2023-05-25T06:25:31.239763291+00:00", fd:32, children:[UNKNOWN:Address already in use {syscall:"bind", os_error:"Address already in use", errno:98, created_time:"2023-05-25T06:25:31.239761217+00:00"}]}]}]}
[server]
port_grpc
#ssl_key = /etc/letsencrypt/live/
#ssl_cert = /etc/letsencrypt/live/

[port_grpc]
port = 50051
ip = 0.0.0.0
secure_gateway = 127.0.0.1
protocol = http

  1. grpc_port removed from server block - successful boot
[server]
port_rpc_admin_local
port_rpc_public
port_peer
port_ws_admin_local
port_ws_public
#port_grpc
#ssl_key = /etc/letsencrypt/live/
#ssl_cert = /etc/letsencrypt/live/

[port_rpc_admin_local]
port = 5005
ip = 127.0.0.1
admin = 127.0.0.1
protocol = http

[port_rpc_public]
port = 51234
ip = 0.0.0.0
secure_gateway = 127.0.0.1
protocol = http,https

[port_peer]
port = 51235
ip = 0.0.0.0
# alternatively, to accept connections on IPv4 + IPv6, use:
#ip = ::
protocol = peer

[port_ws_admin_local]
port = 6006
ip = 127.0.0.1
admin = 127.0.0.1
protocol = ws

[port_ws_public]
port = 6005
ip = 0.0.0.0
protocol = ws,wss

[port_grpc]
port = 50051
ip = 0.0.0.0
secure_gateway = 127.0.0.1

Expected Result

See reproduce section

Actual Result

See reproduce section

Environment

Ubuntu 20.04 with official build,
Docker

Supporting Files

@legleux
Copy link
Collaborator

legleux commented Jun 5, 2023

dup/related:
#4015
This has caught me and probably many others as well.

@intelliot intelliot added Good First Issue Great issue for a new contributor Bug Will Need Documentation labels Jun 5, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Core Ledger Jun 5, 2023
@ckeshava ckeshava self-assigned this Jun 6, 2023
ckeshava added a commit to ckeshava/rippled that referenced this issue Jun 7, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.
ckeshava added a commit to ckeshava/rippled that referenced this issue Sep 22, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.
ckeshava added a commit to ckeshava/rippled that referenced this issue Sep 25, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.
ckeshava added a commit to ckeshava/rippled that referenced this issue Sep 25, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.
ckeshava added a commit to ckeshava/rippled that referenced this issue Sep 25, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.
ckeshava added a commit to ckeshava/rippled that referenced this issue Sep 25, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.

Introduce a constant (SECTION_PORT_GRPC) for port_grpc configuration section

Replace all usages of "port_grpc" raw string with a constant

Created macros for "port_ws", "port_rpc" and "port_peer" for unit test files.
Removed unused imports in some files
ckeshava added a commit to ckeshava/rippled that referenced this issue Sep 25, 2023
…ormation in ServerHandler. Pass the responsibility of grpc port information validation to GRPCServer constructor. Both GRPCServer and ServerHandler are created during the construction of Application instance.

Introduce a constant (SECTION_PORT_GRPC) for port_grpc configuration section

Replace all usages of "port_grpc" raw string with a constant

Created macros for "port_ws", "port_rpc" and "port_peer" for unit test files.
Removed unused imports in some files
sophiax851 pushed a commit to sophiax851/rippled that referenced this issue Jun 12, 2024
)

Prior to this commit, `port_grpc` could not be added to the [server]
stanza. Instead of validating gRPC IP/Port/Protocol information in
ServerHandler, validate grpc port info in GRPCServer constructor. This
should not break backwards compatibility.

gRPC-related config info must be in a section (stanza) called
[port_gprc].

* Close XRPLF#4015 - That was an alternate solution. It was decided that with
  relaxed validation, it is not necessary to rename port_grpc.
* Fix XRPLF#4557
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Good First Issue Great issue for a new contributor Will Need Documentation
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants