Version: v0.11.0~dev-20230123163036-0b9cf7ba7af5
My action plans get executed 1st of month.
I had a crash, and going back in the log, I see several lines like this:
Mar 1 00:00:00 cgr CGRateS <Rapyd_CGRates_1> [1190636]: Error executing accountless action *debit: nil account!
Mar 1 00:00:00 cgr CGRateS <Rapyd_CGRates_1> [1190636]: Error executing accountless action *debit: nil account!
Then:
Mar 1 00:00:02 cgr CGRateS <Rapyd_CGRates_1> [1190636]: <EEs> Exporter <4c3ff2364b4499a8ae049ed2a300c865:01USERS:1users> could not export because err: <Post "http ://
127.0.0.1:11444/cgr/account-debit?product=users": dial tcp
127.0.0.1:11444: connect: connection refused>
Mar 1 00:00:02 cgr CGRateS <Rapyd_CGRates_1> [1190636]: <EEs> Exporter <4c3ff2364b4499a8ae049ed2a300c865:03USERS:3users> could not export because err: <Post "http ://
127.0.0.1:11444/cgr/account-debit?product=users": dial tcp
127.0.0.1:11444: connect: connection refused>
Mar 1 00:00:02 cgr cgr-engine[1190636]: panic: runtime error: invalid memory address or nil pointer dereference
Mar 1 00:00:02 cgr cgr-engine[1190636]: [signal SIGSEGV: segmentation violation code=0x1 addr=0xa0 pc=0x1745d39]
Mar 1 00:00:02 cgr cgr-engine[1190636]: goroutine 5576979 [running]:
Mar 1 00:00:02 cgr cgr-engine[1190636]:
github.com/cgrates/cgrates/ees.AddFailedPost({0xc00090a7c0, 0x1f}, {0xc000a9f9c0, 0x36}, {0x0, 0x0}, {0x198bd20, 0xc0006eef78}, 0x0)
Mar 1 00:00:02 cgr cgr-engine[1190636]: #011/root/go/src/cgrates/ees/libcdre.go:66 +0xd9
Mar 1 00:00:02 cgr cgr-engine[1190636]:
github.com/cgrates/cgrates/ees.ExportWithAttempts.func1()Mar 1 00:00:02 cgr cgr-engine[1190636]: #011/root/go/src/cgrates/ees/ees.go:291 +0xf1
Mar 1 00:00:02 cgr cgr-engine[1190636]:
github.com/cgrates/cgrates/ees.ExportWithAttempts({0x2373da0, 0xc000b6a240}, {0x198bd20, 0xc0006eef78}, {0x0, 0x0})
Mar 1 00:00:02 cgr cgr-engine[1190636]: #011/root/go/src/cgrates/ees/ees.go:326 +0x551
Mar 1 00:00:02 cgr cgr-engine[1190636]: created by
github.com/cgrates/cgrates/ees.callURLAsyncMar 1 00:00:02 cgr cgr-engine[1190636]: #011/root/go/src/cgrates/ees/libactions.go:86 +0x22e
So it looks like the POST failed and that caused a crash? Not sure if the "nil account" lines are related to that or not? If not, what do they mean?
Most of the debit actions I think were processed, but there was at least one debit that was logged in StorDB, but not actually processed, so I don't know if that was in process when the crash happened or what. The HTTP POST was expected to fail, as there is no service currently listening at that URL just yet (it's in development) but I assumed it would just timeout or something and move on, rather than crashing so that's why I went ahead and had it on some of the actions I have in place.
Here is an example of the actions I have that use http_post_async (this is the one referenced above as 4c3ff2364b4499a8ae049ed2a300c865:03USERS:3users):
{
"id": null,
"result": [
{
"Identifier": "*debit",
"BalanceId": "",
"BalanceUuid": "",
"BalanceType": "*monetary",
"Units": "225",
"ExpiryTime": "*unlimited",
"Filters": "",
"TimingTags": "",
"DestinationIds": "",
"RatingSubject": "",
"Categories": "",
"SharedGroups": "",
"BalanceWeight": "0",
"ExtraParameters": "",
"BalanceBlocker": "false",
"BalanceDisabled": "false",
"Weight": 0
},
{
"Identifier": "*http_post_async",
"BalanceId": "",
"BalanceUuid": "",
"BalanceType": "",
"Units": "0",
"ExpiryTime": "*unlimited",
"Filters": "",
"TimingTags": "",
"DestinationIds": "",
"RatingSubject": "",
"Categories": "",
"SharedGroups": "",
"BalanceWeight": "0",
"ExtraParameters": "
http://127.0.0.1:11444/cgr/account-debit?product=users",
"BalanceBlocker": "false",
"BalanceDisabled": "false",
"Weight": 0
},
{
"Identifier": "*cdrlog",
"BalanceId": "",
"BalanceUuid": "",
"BalanceType": "",
"Units": "0",
"ExpiryTime": "*unlimited",
"Filters": "",
"TimingTags": "",
"DestinationIds": "",
"RatingSubject": "",
"Categories": "",
"SharedGroups": "",
"BalanceWeight": "0",
"ExtraParameters": "{\"Category\":\"USER\",\"ExtraInfo\":\"Users: 3 for 225.00\"}",
"BalanceBlocker": "false",
"BalanceDisabled": "false",
"Weight": 0
},
{
"Identifier": "*log",
"BalanceId": "",
"BalanceUuid": "",
"BalanceType": "",
"Units": "0",
"ExpiryTime": "*unlimited",
"Filters": "",
"TimingTags": "",
"DestinationIds": "",
"RatingSubject": "",
"Categories": "",
"SharedGroups": "",
"BalanceWeight": "0",
"ExtraParameters": "",
"BalanceBlocker": "false",
"BalanceDisabled": "false",
"Weight": 0
}
],
"error": null
}
I can of course remove the POST action if that will solve this temporarily, but what worries me is later on when I do have that endpoint working for CGRateS to POST to, what if that service goes down or something temporarily---I wouldn't want CGRateS to crash on that.
Any input is appreciated. Thanks!