Confusing error message while reloading the configuration with the SIGHUP signal. #194

Open
opened 2025-01-22 08:50:58 +00:00 by KurlesHS · 5 comments
Member

If the configuration file in the "server" section describes addresses without TLS support, then when the configuration is reloaded with the SIGHUP signal, a confusing message is written to the log: "failed to reload server parameters {"error": "invalid servers configuration: no known server found"}".

Expected Behavior

When restarting the configuration without TLS support, no confusing messages are written to the log.

Current Behavior

When restarting the configuration without TLS support, a confusing message is written to the log: "failed to reload server parameters {"error": "invalid servers configuration: no known server found"}".

Possible Solution

--- a/cmd/http-gw/app.go	(revision 84ff0e662a2419a5e0b560e28a20f8281c383655)
+++ b/cmd/http-gw/app.go	(date 1737532579976)
@@ -943,9 +943,9 @@
 			if serverInfo.TLS.Enabled {
 				if err := ser.UpdateCert(serverInfo.TLS.CertFile, serverInfo.TLS.KeyFile); err != nil {
 					return fmt.Errorf("failed to update tls certs: %w", err)
-				}
-				found = true
-			}
+				}				
+			}
+			found = true
 		} else if unbind := a.updateUnbindServerInfo(serverInfo); unbind {
 			found = true
 		}

Steps to Reproduce (for bugs)

  1. Disable TLS in the configuration file,for example:
    server:
    - address: 127.0.0.1:8888
       tls:
          enabled: false 
    
  2. Execute the http gateway with this configuration;
  3. Send the SIGHUP signal to the http gateway process.
If the configuration file in the "server" section describes addresses without TLS support, then when the configuration is reloaded with the SIGHUP signal, a confusing message is written to the log: "failed to reload server parameters {"error": "invalid servers configuration: no known server found"}". ## Expected Behavior When restarting the configuration without TLS support, no confusing messages are written to the log. ## Current Behavior When restarting the configuration without TLS support, a confusing message is written to the log: "failed to reload server parameters {"error": "invalid servers configuration: no known server found"}". ## Possible Solution ````diff --- a/cmd/http-gw/app.go (revision 84ff0e662a2419a5e0b560e28a20f8281c383655) +++ b/cmd/http-gw/app.go (date 1737532579976) @@ -943,9 +943,9 @@ if serverInfo.TLS.Enabled { if err := ser.UpdateCert(serverInfo.TLS.CertFile, serverInfo.TLS.KeyFile); err != nil { return fmt.Errorf("failed to update tls certs: %w", err) - } - found = true - } + } + } + found = true } else if unbind := a.updateUnbindServerInfo(serverInfo); unbind { found = true } ```` ## Steps to Reproduce (for bugs) 1. Disable TLS in the configuration file,for example: ```yaml server: - address: 127.0.0.1:8888 tls: enabled: false ``` 2. Execute the http gateway with this configuration; 3. Send the SIGHUP signal to the http gateway process.
KurlesHS added the
bug
label 2025-01-22 08:50:58 +00:00
Member

Yay! I'm not the only one!

This behavior is confusing but known and documented. SIGHUP reloading is not supported for server endpoints. I've tripped over this too: #168

Yay! I'm not the only one! This behavior is confusing but known and [documented](https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/src/branch/master/docs/gate-configuration.md#server-section). SIGHUP reloading is not supported for `server` endpoints. I've tripped over this too: #168
Author
Member

Yay! I'm not the only one!

This behavior is confusing but known and documented. SIGHUP reloading is not supported for server endpoints. I've tripped over this too: #168

Yes, but this message only appears if there are no TLS server endpoints in the configuration. If the "server.address.tls.enabled" flag is set, nothing unnecessary is written to the log. I think it would be a good idea to avoid displaying the above error message in cases where a non-TLS configuration is used.

> Yay! I'm not the only one! > > This behavior is confusing but known and [documented](https://git.frostfs.info/TrueCloudLab/frostfs-http-gw/src/branch/master/docs/gate-configuration.md#server-section). SIGHUP reloading is not supported for `server` endpoints. I've tripped over this too: #168 Yes, but this message only appears if there are no TLS server endpoints in the configuration. If the "server.address.tls.enabled" flag is set, nothing unnecessary is written to the log. I think it would be a good idea to avoid displaying the above error message in cases where a non-TLS configuration is used.
Member

Ah, it's a separate thing then. I've misread the OP.

Ah, it's a separate thing then. I've misread the OP.
Owner

@KurlesHS Is this applicable for S3 Gateway too?

@KurlesHS Is this applicable for S3 Gateway too?
Author
Member

@KurlesHS Is this applicable for S3 Gateway too?

Yes, in s3-gw, the method responsible for updating server endpoint settings is one-to-one, as in http-gw.

> @KurlesHS Is this applicable for S3 Gateway too? Yes, in s3-gw, the method responsible for updating server endpoint settings is one-to-one, as in http-gw.
dkirillov self-assigned this 2025-01-27 11:12:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-http-gw#194
No description provided.