Bug #103769 ER_SP_WRONG_NO_OF_ARGS - reporting incorrectly
Submitted: 21 May 2021 13:11 Modified: 23 Jul 2021 16:39
Reporter: Chris Naviaux Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:8.0.21 OS:Any
Assigned to: CPU Architecture:Any
Tags: ER_SP_WRONG_NO_OF_ARGS

[21 May 2021 13:11] Chris Naviaux
Description:
We are using MySQL on RDS, v8.0.21.  Over the past several weeks we have been getting notified of seemingly random ER_SP_WRONG_NO_OF_ARGS errors.

We have an automated system that monitors and notifies of ALL errors through our API.  I was able to make this same issue occur on Workbench for a short period of time.

The stored procedure is called correctly, the correct number of Args are passed, but mySQL reports it back as one short.  The following is an example:

"code": "ER_SP_WRONG_NO_OF_ARGS",
  "errno": 1318,
  "sqlMessage": "Incorrect number of arguments for PROCEDURE weaver.usp_app_ups_sale_event; expected 25, got 24",
  "sqlState": "42000",
  "index": 0,
  "sql": "CALL usp_app_ups_sale_event(  NULL, NULL, NULL, NULL, NULL, NULL, 'xxxxxxxxxx', 'SND', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'xxxxxxxxxx', 1)"

How to repeat:
Unable to consistently repeat
[24 May 2021 12:33] MySQL Verification Team
Hi Mr. Naviaux,

Thank you for your bug report.

We have tried to repeat your problem. We made two stored routines, one with 25 and the other with 24 arguments and called each one of those 1000 times, without any errors.

Hence, we can not repeat your problem.
[23 Jul 2021 16:36] Chris Naviaux
more examples: 7-23 12:12pm
  "code": "ER_SP_WRONG_NO_OF_ARGS",
  "errno": 1318,
  "sqlMessage": "Incorrect number of arguments for PROCEDURE weaver.usp_app_ups_event_shift; expected 10, got 9",
  "sqlState": "42000",
  "index": 0,
  "sql": "CALL usp_app_ups_event_shift(NULL, 'xxxxxxx', 'xxxxxx', 'xxxxxx', '14:00', '16:00', '1',0, 'system', 1)"

 
7/17/2021 1:03a
			{
  "code": "ER_SP_WRONG_NO_OF_ARGS",
  "errno": 1318,
  "sqlMessage": "Incorrect number of arguments for PROCEDURE weaver.usp_app_del_sale_event; expected 6, got 2",
  "sqlState": "42000",
  "index": 0,
  "sql": "CALL usp_app_del_sale_event('xxxxx', NULL, NULL, NULL, NULL, 1)"
}

6/11 1:02a
			{
  "code": "ER_SP_WRONG_NO_OF_ARGS",
  "errno": 1318,
  "sqlMessage": "Incorrect number of arguments for PROCEDURE weaver.usp_app_ups_sale_event; expected 25, got 24",
  "sqlState": "42000",
  "index": 0,
  "sql": "CALL usp_app_ups_sale_event(  NULL, NULL, NULL, NULL, NULL, NULL, 'xxxxxxxx', 'SND', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'xxxxxxxx', 1)"

We do not change anything, these calls all work before and after these errors.  There is no pattern as to which proc call is affected, etc.  This only started occurring after the upgrade to MySQL 8.
[23 Jul 2021 16:39] Chris Naviaux
To clarify we make millions of procedure calls/day.

The lastest call has been called 20k times in the past 7 days.  Only 1 of those calls had ER_SP_WRONG_NO_OF_ARGS as the result.