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

[v0.10]DispatcherS - Methods routing issue #2954

Closed
vtzan opened this issue May 18, 2021 · 3 comments
Closed

[v0.10]DispatcherS - Methods routing issue #2954

vtzan opened this issue May 18, 2021 · 3 comments
Assignees

Comments

@vtzan
Copy link
Contributor

vtzan commented May 18, 2021

Dear Team,

if CGRateS has DispatcherS enabled with the following config

DispatcherProfiles.csv

----------------------------------------------------------------------------------------------------
#Tenant,ID,Subsystems,FilterIDs,ActivationInterval,Strategy,StrategyParameters,ConnID,ConnFilterIDs,ConnWeight,ConnBlocker,ConnParameters,Weight
voiceland.dev,ALL,*any,,,*weight,,SELF,,20,false,,10
voiceland.dev,RALS,*rals;*responder,,,*weight,,RALS,,20,false,,20
voiceland.dev,RALS,,,,,,RALS2,,10,,,
----------------------------------------------------------------------------------------------------

DispatcherHosts.csv

----------------------------------------------------------------------------------------------------
#Tenant[0],ID[1],Address[2],Transport[3],TLS[4]
voiceland.dev,SELF,*internal,,
voiceland.dev,RALS,ns-dev-cgrates-rals-1-87cb29be59d6bac1.elb.eu-central-1.amazonaws.com:2070,*json,
voiceland.dev,RALS2,ns-dev-cgrates-rals-2-5337e20271c10a49.elb.eu-central-1.amazonaws.com:2070,*json,
----------------------------------------------------------------------------------------------------

I have seen the following problems :

For Requests from OpenSIPS, if sessions section has attributes conns set to *localhost then I am receiving the following error.
This was supposed to go through dispatcher engine. if section has attributes conns set to *internal system is working fine.

ngrep

----------------------------------------------------------------------------------------------------
T 2021/05/18 10:22:21.468161 127.0.0.1:40230 -> 127.0.0.1:2014 [AP] #128
{ "method": "SessionSv1.AuthorizeEventWithDigest", "id": 1007600844, "params": [ { "GetAttributes": true, "Tenant": "voiceland.dev", "Event": { "ID": "GET_USER_PROFILE", "Account": "+302107001397", "Tenant": "voiceland.dev" } } ] }
#
T 2021/05/18 10:22:21.468680 127.0.0.1:2014 -> 127.0.0.1:40230 [AP] #129
{"id":1007600844,"result":null,"error":"ATTRIBUTES_ERROR:DISPATCHER_ERROR:NOT_FOUND"}
----------------------------------------------------------------------------------------------------

Responder.GetCostOnRatingPlans is not passing through DispatcherS engine.
I see that the Responder.GetMaxSessionTime method is sent correctly to the dispatcher engine but Responder.GetCostOnRatingPlans is not

ngrep

----------------------------------------------------------------------------------------------------
T 2021/05/18 10:36:46.764191 127.0.0.1:32944 -> 127.0.0.1:2012 [AP] #197
{"method":"SupplierSv1.GetSuppliers","params":[{"IgnoreErrors":false,"MaxCost":"","Tenant":"voiceland.dev","ID":"b1afc443-4f02-455a-9cb6-2b767ccbf0eb","Time":null,"Event":{"Account":"9b83b82a-878c-457d-8879-eece6a492994",".XXXXXXXXXXXXXX"},"Limit":null,"Offset":null}],"id":3}

##
T 2021/05/18 10:36:46.814141 127.0.0.1:32944 -> 127.0.0.1:2012 [AP] #199
{"method":"Responder.GetCostOnRatingPlans","params":[{"Account":"9b83b82a-878c-457d-8879-eece6a492994","Subject":"9b83b82a-878c-457d-8879-eece6a492994","Destination":"+302107001397","Tenant":"voiceland.dev","SetupTime":"2021-05-18T10:36:46Z","Usage":10800000000000,"RatingPlanIDs":["TP_RP_SPL_VOICELAND_INTERNAL_DST_ID_RT_GR_LANDLINE_2020_02_IN"]}],"id":4}

##
T 2021/05/18 10:36:46.814203 127.0.0.1:2012 -> 127.0.0.1:32944 [AP] #201
{"id":4,"result":null,"error":"rpc: can't find method Responder.GetCostOnRatingPlans"}

#
T 2021/05/18 10:36:46.814263 127.0.0.1:2012 -> 127.0.0.1:32944 [AP] #202
{"id":3,"result":null,"error":"SERVER_ERROR: rpc: can't find method Responder.GetCostOnRatingPlans"}

----------------------------------------------------------------------------------------------------

thank you in advance for your support

Vasilios Tzanoudakis

@Trial97
Copy link

Trial97 commented May 19, 2021

Hi @vtzan,

In order to better track them please open a separate issue regarding the ATTRIBUTES_ERROR:DISPATCHER_ERROR:NOT_FOUND error.

Thanks,
Trial97

@vtzan
Copy link
Contributor Author

vtzan commented May 20, 2021

Dear Team,

I tried to test the code and CGRateS is crashing...

/ # /go/bin/cgr-engine 
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting version <CGRateS@v0.10.3~dev-20210519162139-116e77822833><go1.16.4>
2021/05/20 17:07:41 CGRateS <1> [INFO] Starting CGRateS Dispatcher service.
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <ChargerS> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <ResourceS> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] Starting CGRateS BiJSON server at <127.0.0.1:2014>
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <CDRs> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <SessionS> subsystem
2021/05/20 17:07:41 CGRateS <1> [WARNING] WARNING: missing TLS certificate/key file!
2021/05/20 17:07:41 CGRateS <1> [WARNING] WARNING: missing TLS certificate/key file!
2021/05/20 17:07:41 CGRateS <1> [WARNING] WARNING: missing TLS certificate/key file!
2021/05/20 17:07:41 CGRateS <1> [INFO] <HTTP> enabling handler for JSON-RPC
2021/05/20 17:07:41 CGRateS <1> [INFO] <HTTP> enabling handler for WebSocket connections
2021/05/20 17:07:41 CGRateS <1> [INFO] <HTTP> start listening at <:2080>
2021/05/20 17:07:41 CGRateS <1> [INFO] Starting CGRateS JSON server at <:2012>.
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <Stats> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <SupplierS> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] Starting CGRateS GOB server at <:2013>.
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <ApierS> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <AttributeS> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] <CoreS> starting <ThresholdS> subsystem
2021/05/20 17:07:41 CGRateS <1> [INFO] Registering CDRS HTTP Handlers.
2021/05/20 17:07:41 CGRateS <1> [INFO] Registering CDRS RPC service.
panic: reflect: Call using *utils.GetCostOnRatingPlansArgs as type *utils.TenantWithArgDispatcher

goroutine 144 [running]:
reflect.Value.call(0x1634fe0, 0xc0009faf00, 0x2e13, 0x17022ad, 0x4, 0xc000952ef0, 0x2, 0x2, 0x1b6d858, 0xc000a07140, ...)
	/usr/local/go/src/reflect/value.go:406 +0x1317
reflect.Value.Call(0x1634fe0, 0xc0009faf00, 0x2e13, 0xc000952ef0, 0x2, 0x2, 0xc0009faf00, 0x2e13, 0x2)
	/usr/local/go/src/reflect/value.go:337 +0xb9
github.com/cgrates/cgrates/engine.(*Responder).Call(0xc0009faf00, 0x17166ca, 0x12, 0x142d040, 0xc000a52380, 0x144c8c0, 0xc00097ef00, 0xc0008c27b8, 0x94cdb8)
	/usr/src/cgrates/engine/responder.go:366 +0x2ab
github.com/cgrates/rpcclient.(*RPCClient).Call.func1(0xc000a009a0, 0xc0000f6240, 0xc0004ae540, 0x17166ca, 0x12, 0x142d040, 0xc000a52380, 0x144c8c0, 0xc00097ef00)
	/go/pkg/mod/github.com/cgrates/rpcclient@v0.0.0-20200528120144-984f478f0a69/rpcclient.go:299 +0xf5
created by github.com/cgrates/rpcclient.(*RPCClient).Call
	/go/pkg/mod/github.com/cgrates/rpcclient@v0.0.0-20200528120144-984f478f0a69/rpcclient.go:286 +0x325

thank you in advance for your support.

Vasilios Tzanoudakis

@Trial97
Copy link

Trial97 commented May 21, 2021

Hi @vtzan,

Thank you for your report.
We fixed this on the latest v0.10 please update and retest.

Thanks,
Trial97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants