[OpenSIPS-Users] Need some help on mysql error on opensips .

Bogdan-Andrei Iancu bogdan at opensips.org
Wed Nov 12 13:53:16 UTC 2025


I would say mysql Aurora is not fair playing - if it keeps the conns up, 
it should also keep all the corresponding resources up (like the pre 
statements)....

Maybe other apps are not using pre statements.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
   https://www.siphub.com

On 11.11.2025 14:44, Sasmita Panda wrote:
> Hi Bogdan-Andrei,
>
> It's aws mysql Aurora . AWS says the minor version of mysql server is 
> zero downtime upgrade . So we didn't get any such message on the 
> server side if all the connections got closed or what .
> There is no error or notification on the server side . Other 
> applications using the mysql SDK also run smoothly with this type of 
> upgrade  .
>
> */Thanks & Regards/*
> /Sasmita Panda/
> /Senior Network Testing and Software Engineer/
> /3CLogic , ph:07827611765/
>
>
> On Tue, Nov 11, 2025 at 4:18 PM Bogdan-Andrei Iancu 
> <bogdan at opensips.org> wrote:
>
>     Hi Sasmita,
>
>     At steps (3) + (4), if the db conn is not reset (from the OpenSIPS
>     perspective), the statements are kept (of course). The question is
>     - did the mysql upgrade triggered the closing of all DB conns in
>     the mysql server?
>
>     Regards,
>
>     Bogdan-Andrei Iancu
>
>     OpenSIPS Founder and Developer
>        https://www.opensips-solutions.com
>        https://www.siphub.com
>
>     On 22.10.2025 16:15, Sasmita Panda via Users wrote:
>>     Hi All ,
>>
>>     Is there any update on this ?
>>
>>     Just to elaborate the error a bit , I have opensips running on
>>     eks cluster nodes and multiple opensips nodes used to connect to
>>     the same RDS (Aurora mysql).
>>     On the RDS side there was a minor version upgrade from
>>     8.0.mysql_aurora.3.07 to 8.0.mysql_aurora.3.08.2 . After upgrade
>>     when register request comes to opensips
>>     and it goes to insert the data in the DB. It gives the above
>>     error which I shared earlier .
>>
>>     *CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute: driver
>>     error (1243): Unknown prepared statement handler (5) given to
>>     mysql_stmt_precheck*
>>     *ERROR:usrloc:db_insert_ucontact: inserting contact in db
>>     failed","attributes*
>>     *ERROR:usrloc:wb_timer: inserting contact into database failed*
>>     *
>>     *
>>     *As for my understanding : *
>>     During the Aurora mysql upgrade from 3.07 to 3.08.2
>>
>>     1.
>>
>>         All old DB sessions are terminated and reset .
>>
>>     2.
>>
>>         The Auro engine restarts and resets all session level state .
>>
>>     3.
>>
>>         However opensips SB driver (db_mysql) still holds references
>>         to old prepared statement in an old connection pool .
>>
>>     4.
>>
>>         When the connection is reused by opensips after upgrade ,
>>         those handels does not exists anymore and hence → driver
>>         Error 1243 appears in opensips logs (invalid prepared
>>         statement and failed to insert data in the database ) .
>>
>>     5.
>>
>>         Once we restarted the pods the connection pool from opensips
>>         side also got reset and hence the issue got resolved .
>>
>>     *
>>     *
>>     *But restart is not suitable for live environment . So is there
>>     any other option to recover this automatically . On opensips
>>     module documentation for db_mysql *
>>     *I am not getting any such parameter to set . Do I need to update
>>     the mysql client version to ? Please suggest . *
>>     *
>>     *
>>     */Thanks & Regards/*
>>     /Sasmita Panda/
>>     /Senior Network Testing and Software Engineer/
>>     /3CLogic , ph:07827611765/
>>
>>
>>     On Tue, Oct 21, 2025 at 11:14 AM Sasmita Panda
>>     <spanda at 3clogic.com> wrote:
>>
>>         Hi All ,
>>
>>         I am using opensips 3.4 running on EKS node and the database
>>         is AWS RDS (8.0.mysql_aurora.3.08.2) .
>>
>>         In the config  I am using sql_only mode to save/extract data
>>         from the database .
>>
>>         loadmodule "usrloc.so"
>>         modparam("usrloc", "nat_bflag", "NAT")
>>         modparam("usrloc", "working_mode_preset", "sql-only")
>>         modparam("usrloc", "db_url",
>>         "mysql://mysql-user:mysql-pass@mysql-domain/dbname")
>>         modparam("usrloc", "use_domain", 1)
>>         modparam("usrloc", "max_contact_delete", 1)
>>
>>                 if ($rm=="REGISTER") {
>>          xlog( "L_NOTICE", "Register Contact & $ct \n" );
>>                         fix_nated_register();
>>          if(!save("location","force-registration,max-contacts=10,path-lazy"))
>>                                   sl_reply_error();
>>                         exit;
>>                 }
>>
>>
>>         Below is the error I am getting in the opensips logs :
>>
>>         2025-10-20 00:30:03.120
>>         {"body":"Oct 19 19:00:03 [36] NOTICE:Register Contact \u0026
>>         \u003csip:hbh3a766 at 192.168.33.49:57670;transport=wss\u003e;expires=90
>>         <mailto:u003csip:hbh3a766 at 192.168.33.49:57670;transport=wss%5Cu003e;expires=90>","attributes":{"log.file.path":"/var/log/pods/eks-opensips_west-registrar-f5c5896d4-rgn8d_44da0dac-0521-4e1b-b4e7-89c7f0f87c11/west-registrar/0.log","log.iostream":"stderr","logtag":"F"},"resources":{"k8s.container.restart_count":"0","k8s.pod.uid":"44da0dac-0521-4e1b-b4e7-89c7f0f87c11"}}
>>         2025-10-20 00:30:03.121
>>         {"body":"Oct 19 19:00:03
>>         [36]*CRITICAL:db_mysql:wrapper_single_mysql_stmt_execute:
>>         driver error (1243): Unknown prepared statement handler (5)
>>         given to
>>         mysql_stmt_precheck","attributes*":{"log.file.path":"/var/log/pods/eks-opensips_west-registrar-f5c5896d4-rgn8d_44da0dac-0521-4e1b-b4e7-89c7f0f87c11/west-registrar/0.log","log.iostream":"stderr","logtag":"F"},"resources":{"k8s.container.restart_count":"0","k8s.pod.uid":"44da0dac-0521-4e1b-b4e7-89c7f0f87c11"}}
>>         2025-10-20 00:30:03.121
>>         {"body":"Oct 19 19:00:03
>>         [36]*ERROR:usrloc:db_insert_ucontact: inserting contact in db
>>         failed","attributes":*{"log.file.path":"/var/log/pods/eks-opensips_west-registrar-f5c5896d4-rgn8d_44da0dac-0521-4e1b-b4e7-89c7f0f87c11/west-registrar/0.log","log.iostream":"stderr","logtag":"F"},"resources":{"k8s.container.restart_count":"0","k8s.pod.uid":"44da0dac-0521-4e1b-b4e7-89c7f0f87c11"}}
>>         2025-10-20 00:30:03.121
>>         {"body":"Oct 19 19:00:03 [36]*ERROR:usrloc:wb_timer:
>>         inserting contact into database
>>         failed*","attributes":{"log.file.path":"/var/log/pods/eks-opensips_west-registrar-f5c5896d4-rgn8d_44da0dac-0521-4e1b-b4e7-89c7f0f87c11/west-registrar/0.log","log.iostream":"stderr","logtag":"F"},"resources":{"k8s.container.restart_count":"0","k8s.pod.uid":"44da0dac-0521-4e1b-b4e7-89c7f0f87c11"}}
>>
>>         *** I have 2 instance on which opensips running and the
>>         Database is common for both .
>>
>>         */Thanks & Regards/*
>>         /Sasmita Panda/
>>         /Senior Network Testing and Software Engineer/
>>         /3CLogic , ph:07827611765/
>>
>>
>>     _______________________________________________
>>     Users mailing list
>>     Users at lists.opensips.org
>>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20251112/b53702a6/attachment.html>


More information about the Users mailing list