Does anyone has any idea of the following error when registering an UE?

When registering an UE for a second time is giving me this series of errors but I cannot figure out what it means or how to solve it. This happens if I register the same imsi a second time after signing it up into MongoDB. in order to prevent it I must create it in the ddbb each time I want to register it, otherwise it gives me the following error.

Maybe the IMSI, K, Op/Opc was not match between UE and CN?

I do not think that is the issue since when I run for a first time and it works fine. A second time is when I get those errors. If I put the same subscribers on the database again I will be able to make the same registering without errors. however, a second execution will show those errors. This is why I´m a bit stuck.

Which UE are you using?

In the condition, I think it may cause by the sequence number are not increase both in UE and CN.

I´m using the Free5GC test with some changes to register several UEs sequentially. Originally, I took the register test and made a for loop to subscirbe and register each imsi incremented. This worked fine, I could executed as many times as I wanted.

The next thing I did was to separate the subscription code to make a tool to put N number of subscribers intto database and then execute the same test. The first time works as it should be, the second time it gives me all those errors.

One thing I think it could be happening is that in the original script, it puts a subscribers into the DDBB and then it registers it. If I do it again it will do the same thing with the same imsi so I suppose when puting it into the DDBB it overwrittes it, and then it registers it. In my script Since I do not overwrite it anymore because I only execute the subscription script once, I register some UEs and I may not be able to register the same ones again unless it deregister them. Although this seems reasonable, the errors I do not know if this is related with the errors that I am recieving in the screenshot…

What do you think?

Try to increase the sqn number every when a registration success.

On ue.AuthenticationSubs.SequenceNumber which has been new from test.NewRanUeContext:

As look like this

Hello,

Thank you for your message. I tried to use that code but I did not work, I’m having the same issue with the same log errors. Any other idea?