omec-project / amf

15 stars 36 forks source link

AMF does not work when deployed with no mongoDB integration #261

Closed gruyaume closed 1 month ago

gruyaume commented 3 months ago

Description

PR #249 was supposed to remove the AMF's dependency on MongoDB, but deploying the AMF with no MongoDB integration causes errors in logs related to writing data and ultimately leads the AMF to not work at all.

I am fairly confident the code still assumes MongoDB integration elsewhere (likely in the DRSM) lib.

Logs

2024-06-13T18:53:18.331Z [amf] 2024/06/13 18:53:18 Adding chunk 8277 failed. Retry again 
2024-06-13T18:53:18.331Z [amf] 2024-06-13T18:53:18Z [DEBU][DRSM][App] Found chunk Id block  7347

Reference

thakurajayL commented 3 months ago

Do you mean you tried to install SD-Core with AMF configuration set to EnableDbStore=false? You are right. DRSM (initDRSM) tries to connect to DB and it shall fail. If DRSM init fails then AMF may not initialize cleanly. On top of that further ID allocation (e.g. TmsiAllocate) would fail.

Please note that if you disable mongoDB then you shall not be able to run multiple AMF instances. Is that ok for you?

gruyaume commented 3 months ago

Correct, we are running it with EnableDbStore=false.

We are fine with not being able to run multiple AMF instances.

thakurajayL commented 3 months ago

I am assuming following, "mongoDB is still running but EnableDbStore=false " When I do this I see registration working fine.

ajayonf@node0:~$ kubectl logs -n omec amf-7b5fdc88b6-pzvjc | more configuration: amfDBName: sdcore_amf amfName: AMF debugProfilePort: 5001 enableDBStore: false enableNrfCaching: false enableSctpLb: true kafkaInfo: brokerPort: 9092 brokerUri: kafka-headless topicName: sdcore-data-source-amf mongodb: name: free5gc url: mongodb://mongodb-arbiter-headless

I ran registration test and it worked fine. Could you please tell me what I am missing. Note in this case AMF has mongoDB connection and it does not store the subscriber in the db but you can see mongoDB config is available in the amf pod.

dariofaccin commented 3 months ago

In our scenario the mongodb object and anfDBName in config file are removed and AMF has no mongoDB connection. Is it possible to disable DRSM initialization when EnableDbStore is set to false?