irods / irods_client_http_api

An iRODS C++ HTTP API using Boost.Beast
BSD 3-Clause "New" or "Revised" License
0 stars 8 forks source link

Add clear debug message if connection to oidc provider fails #244

Open ll4strw opened 9 months ago

ll4strw commented 9 months ago

If I mistakenly use a wrong IP address and/or port for my oidc provider in the config file, I get

Validating configuration file ...
No JSON schema file provided. Using default.
Configuration passed validation!
[2024-01-29 08:16:55.657] [P:1] [info] [T:1] Initializing server.
Error: connect: Connection refused [system:111 at /opt/irods-externals/boost1.81.0-0/include/boost/asio/detail/reactive_socket_service.hpp:587:33 in function 'connect']

which could be confusing, because it does not give any details of the failing connection. Is it possible to log more info in debug please? Maybe here https://github.com/irods/irods_client_http_api/blob/main/core/src/main.cpp#L745 For instance, if the api cannot connect to my iRODS server I get

ERROR: _rcConnect: connectToRhost error, server on 0.0.0.0:1247 is probably down status = -305111 USER_SOCK_CONNECT_ERR, Connection refused
Error: USER_SOCK_CONNECT_ERR: Connect error

so I would expect something similar for an oidc connection error.

korydraughn commented 9 months ago

We'll definitely improve that for the next release.

Have you tried changing the log level to see if more information is logged?

ll4strw commented 9 months ago

My level is on debug already, I will try `trace'

ll4strw commented 9 months ago

..and also with `trace' I get

Validating configuration file ...
No JSON schema file provided. Using default.
Configuration passed validation!
[2024-01-29 12:13:40.617] [P:1] [info] [T:1] Initializing server.
[2024-01-29 12:13:40.617] [P:1] [trace] [T:1] Verifying OIDC endpoint configuration
Error: connect: Connection refused [system:111 at /opt/irods-externals/boost1.81.0-0/include/boost/asio/detail/reactive_socket_service.hpp:587:33 in function 'connect']