# Too many RPC requests

**URL:** <https://forum.genieacs.com/t/too-many-rpc-requests/2364>\
**Category:** Uncategorized\
**Created:** [January 28, 2022, 9:15am UTC](https://forum.genieacs.com/t/too-many-rpc-requests/2364 "2022-01-28T09:15:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcielec](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/lcielec/32/781_2.png) [@lcielec](https://forum.genieacs.com/u/lcielec)\
**Post date:** [January 28, 2022, 9:15am UTC](https://forum.genieacs.com/t/too-many-rpc-requests/2364/1 "2022-01-28T09:15:32Z")

</div>

Hi everyone,  
When I trying to execute the code:  
declare (“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection. []”, null, {path: 0});  
I got an error:  
“Too many commit iterations”  
So in the configuration file /opt/genieacs/genieacs.env I added:  
GENIEACS\_MAX\_COMMIT\_ITERATIONS=500  
Then I got the error:  
Too many RPC requests

How I can fix it? I have genieacs version 1.2.8

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 28, 2022, 5:04pm UTC](https://forum.genieacs.com/t/too-many-rpc-requests/2364/2 "2022-01-28T17:04:52Z")

</div>

Look in your logs. You likely have one script trying to add WANIpConnection instances. And this one which is clearing them out.

---

<div class="post-metadata">

**Author:** ![lcielec](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/lcielec/32/781_2.png) [@lcielec](https://forum.genieacs.com/u/lcielec)\
**Post date:** [January 31, 2022, 6:52am UTC](https://forum.genieacs.com/t/too-many-rpc-requests/2364/3 "2022-01-31T06:52:20Z")

</div>

This is my script:

let login = args[0]  
let haslo = args[1]

const now = Date.now();

declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.[]”, null, {path: 0});

declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.\*”, null, {path: 2});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.X\_WANGponLinkConfig.802-1pMark”, {value: now}, {value: 1});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.X\_WANGponLinkConfig.VLANIDMark”, {value: now}, {value: 100});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.X\_WANGponLinkConfig.Mode”, {value: now}, {value: 2});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.X\_WANGponLinkConfig.Enable”, {value: now}, {value: 1});

declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.\*”, null, {path: 1});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.ConnectionType”, {value: now}, {value: ‘IP\_Routed’});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.NATEnabled”, {value: now}, {value: true});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.X\_ServiceList”, {value: now}, {value: ‘TR069,INTERNET’});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.X\_LanInterface-DHCPEnable”, {value: now}, {value: true});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username”, {value: now}, {value: login});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Password”, {value: now}, {value: haslo});  
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Enable”, {value: now}, {value: true});

When I comment declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.[]”, null, {path: 0}); everything works correctly.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [January 31, 2022, 6:40pm UTC](https://forum.genieacs.com/t/too-many-rpc-requests/2364/4 "2022-01-31T18:40:55Z")

</div>

What **other** provision scripts do you have? This script isn’t the root-cause of your issue.

Also, the second half of your script only works by pure luck. You are never guaranteed an instance number. I.e., if you delete all the instances from `InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection` and add a new `WANPPPConnection` instance, the new instance number is not guaranteed to be 1.

This is how you want to change your script:

```auto
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.[ConnectionType:IP_Routed,NATEnabled:true,X_ServiceList:'TR069,INTERNET',X_LanInterface-DHCPEnable:true,Enabled:true,Username:" + username + ',Password:' + haslo, {path: 1}, {path: 1});

```

The only syntax I’m not 100% sure on is the argument with an embedded “,”. Maybe @zaidka could chime in on this part.
