uptime-kuma
uptime-kuma copied to clipboard
gRPC check throws errors
β οΈ Please verify that this bug has NOT been raised before.
- [X] I checked and didn't find similar issue
π‘οΈ Security Policy
- [X] I agree to have read this project Security Policy
Description
The gRPC check fails but i get the expected output in bloomrpc.
π Reproduction steps
URL: routing.ot-hosting.de:443
Keyword: version
Enable TLS: :heavy_check_mark:
Proto Service Name:
service.v1.RoutingService
Proto Method:
Info
Proto Content:
syntax = "proto3";
package service.v1;
message Envelope {
double min_longitude = 1;
double max_longitude = 2;
double min_latitude = 3;
double max_latitude = 4;
}
message InfoRequest {
}
message InfoResponse {
string version = 1;
string gh_version = 2;
int64 data_timestamp = 3;
Envelope bounding_box = 4;
map<string,string> configuration = 5;
}
service RoutingService {
rpc Info (InfoRequest) returns (InfoResponse);
}
Body:
{}
π Expected behavior
π Actual Behavior
Depending on the case of the method Info
/info
i get the following errors:
WARN: Monitor #67 'routing': Failing: response.substring is not a function | Interval: 60 seconds | Type: grpc-keyword | Down Count: 0 | Resend Interval: 0
WARN: Monitor #67 'routing': Failing: grpcService[grpcMethod] is not a function | Interval: 60 seconds | Type: grpc-keyword | Down Count: 0 | Resend Interval: 0
π» Uptime-Kuma Version
1.19.2
π» Operating System and Arch
Ubuntu 22.04
π Browser
Firefox
π Docker Version
20.10.22
π© NodeJS Version
No response
π Relevant log output
No response
@minhhoangvn
Could you please share your configuration options for the uptime with gRPC. You can refer to the guideline for testing on this PR https://github.com/louislam/uptime-kuma/pull/1964
Same settings as noted above in the "reproduction steps" section.
Can you try to edit the service name without the package value, in your case is βRoutingServiceβ
Funny. I'm unable to remove the package. Clicking the save button automatically restores the old value.
Recreated the monitor without the package prefix. Same error.
Info
-> grpcService[grpcMethod] is not a function
info
-> response.substring is not a function
Entering a dummy value for proto method will also trigger grpcService[grpcMethod] is not a function
so I assume that info
is in fact the correct value. This should be replaced with a more understandable error message IMHO.
Can you share your proto data, I will double check itπ
syntax = "proto3";
package service.v1;
message Envelope {
double min_longitude = 1;
double max_longitude = 2;
double min_latitude = 3;
double max_latitude = 4;
}
message InfoRequest {
}
message InfoResponse {
string version = 1;
string gh_version = 2;
int64 data_timestamp = 3;
Envelope bounding_box = 4;
map<string,string> configuration = 5;
}
service RoutingService {
rpc Info (InfoRequest) returns (InfoResponse);
}
@otbutz, below is the correct configuration for your proto file. I will add the accurate log information and fix the issue when we can't update the service name π₯ The logic for updating the gRPC monitor configuration is missed with the service name value.
Feel free to use my endpoint for testing. routing.ot-hosting.de:443
with TLS enabled. This is currently not working:
@otbutz, thank you for your help in investigating the issue. The root cause is logic to truncate the response data for displaying in monitor info
https://github.com/louislam/uptime-kuma/blob/8c684e92936b5860139b09e50917d55c0b041891/server/model/monitor.js#L551
I have created a new PR to fix those issues (can't update service name and error when truncating response data)
Thanks!