Migration to a newer version

123 views
Skip to first unread message

Domen Kosmač

unread,
Feb 20, 2025, 12:26:54 PMFeb 20
to CGRateS
Hey,

I'm trying to migrate CGRates to the latest version. Now I've copied and changed some of the configuration from the legacy server and changed the storDB to postgreSQL. But whatever I do, it seems I cannot process the CDRs.

So I've tried to do a simpler setup like the one shown on:
https://nickvsnetworking.com.

I've then flushed out my dbs and gave it the example csv files.
I've kept most of the configuration same to the one I have, but added the different reader definition. Even with this change the processed rows are always 0.

I'm guessing this points to my configuration file being incorrect, but I have no idea where.

I am providing versions and configuration files for each server.

Legacy server CGRates version: CGR...@v0.11.0~dev-20210727141433-2b8d5917a030
Prod server CGRates version: CGR...@v0.11.0~dev-20250219131455-ce764e48bb20

Thank you for your help and best regards,

Domen

cgrates.json
cgrates_legacy.json

Armir Veliaj

unread,
Feb 21, 2025, 11:07:46 AMFeb 21
to CGRateS
Hi Domen,

Based on your configuration, we see that you're listing a profile in your online CDR export: "online_cdr_exports": ["newbill_export"], but this profile doesn’t appear in your ERs readers.

However, to better investigate, can you please provide us with the logs from your cgr-engine? Also  put all connections over localhost and send us ngreps and logs. That would help us to check further.

Thanks,
Armir

Domen Kosmač

unread,
Feb 23, 2025, 12:24:31 PMFeb 23
to CGRateS
Hey,

thank you for the fast reply, so I've decided to do a cleaner json, to just get a basic example working, but with no success.

Here is the new json I'm using and the logs, when I send in the dummycsv. I created a new account with the matching account number in the CSV, but the problem persisted.

Regarding the previous setup, I did get an error with the EE but I think that it didnt matter because the ER still didn't do any events and my CDR table was empty as well. The logs look the similar as the one below.

Thanks,

Domen

LOGS:
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <CoreS> starting <AttributeS> subsystem
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: Registering CDRS HTTP Handlers.
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: Registering CDRS RPC service.
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <CoreS> starting <ChargerS> subsystem
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <CoreS> starting <ERs> subsystem
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <ERs> monitoring </usr/local/cdrs> for file moves.
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <Scheduler> processing 0 action plans
Feb 21 15:57:18 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <Scheduler> queued 0 action plans
Feb 21 15:57:34 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: <ERs> parsing </usr/local/cdrs/DummyCSV.csv>
Feb 21 15:57:34 pc cgr-engine[344665]: CGRateS <58e021d> [344665]: ERs finished processing file </usr/local/cdrs/DummyCSV.csv>. Total records processed: 0, events posted: 0, run duration: 197.248µs

petek, 21. februar 2025 ob 17:07:46 UTC+1 je oseba armir....@itsyscom.com napisala:
cgrates_cleaned.json
DummyCSV.csv

Domen Kosmač

unread,
Feb 24, 2025, 2:29:15 AMFeb 24
to CGRateS
I forgot to provide the csvs,  used to setup the rates, destinations, accounts etc...

nedelja, 23. februar 2025 ob 18:24:31 UTC+1 je oseba Domen Kosmač napisala:
setup_csv.zip

Armir Veliaj

unread,
Feb 24, 2025, 10:54:06 AMFeb 24
to CGRateS
Hi Domen,

We tried to reproduce your scenario using the same CSV files and the configuration you sent to us. It worked perfectly fine, and the CDRs were processed. But, I noticed that in your config file, there was a typo (a comma was needed at the end of the 'ers' config), and also, the source path in your config:
"source_path": "/var/spool/cgrates/blog_example_csv_parser/in"
was different from the one in your logs:
"/usr/local/cdrs/DummyCSV.csv".
 
Please double-check that you are using the same config file that you sent to us.

Thanks,
Armir

Domen Kosmač

unread,
Feb 25, 2025, 3:23:23 AMFeb 25
to CGRateS
Hey,

so I've checked the files and the setup and everything is identical to what I've sent. The paths were fixed to match and also the comma was added, yet the problem persisted.
As I've ran out of ideas, I decided to check what the server differences were and after awhile came to permissions of the folders. I've checked if they were identical (between the legacy and the new production) and it was not the case. 
After I've fixed the permissions of the folder to match the legacy server the CDRs began to be processed correctly. As the example worked, I've setup the cgrates to match the legacy production and voila everything worked. 

So weeks lost on what a simple chown command fixed is bad, but athleast it works now.

Thank you again for your patience and all the help.

Best regards,

Domen

ponedeljek, 24. februar 2025 ob 16:54:06 UTC+1 je oseba armir....@itsyscom.com napisala:

Armir Veliaj

unread,
Feb 25, 2025, 12:56:52 PMFeb 25
to CGRateS

Hi Domen,


Great to hear it’s all working now!

Feel free to reach us if you're having any other issue,

Thanks,
Armir
Reply all
Reply to author
Forward
0 new messages