# Too many commits

**URL:** <https://forum.genieacs.com/t/too-many-commits/1000>\
**Category:** Uncategorized\
**Created:** [September 1, 2020, 1:24pm UTC](https://forum.genieacs.com/t/too-many-commits/1000 "2020-09-01T13:24:10Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 1, 2020, 1:24pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/1 "2020-09-01T13:24:10Z")

</div>

Hi,  
I have two virtual parameters, one for the username of PPPoE and one for the password.  
When I edit these two parameters from the device and then I commit the two pending tasks I have a fault of “Too many commits”, if I click “retry” all works. Why?

Thank you for the support!

---

<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:** [September 1, 2020, 6:23pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/2 "2020-09-01T18:23:34Z")

</div>

Please post your vparam scripts for the pppoe username and password and the relevant parts of your provision script? An explicit `commit()` is not needed either, except in very rare situation.

Also, any reason you are using a vparam for the pppoe username/password? You can set the pppoe creds more simply like this and let the ACS figure things out for you:

```auto
let now = Date.now()
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", {value: now}, {value: config.username});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: now}, {value: config.password});
declare("Device.PPP.Interface.*.Username", {value: now}, {value: config.username});
declare("Device.PPP.Interface.*.Password", {value: now}, {value: config.password});

```

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 2, 2020, 3:08pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/3 "2020-09-02T15:08:15Z")

</div>

This is my vparam for un

> let username = “”;  
> if (typeof(args[1])==‘object’ && ‘value’ in args[1]) {  
> // Set declared value  
> username = args[1].value;  
> declare(“InternetGatewayDevice.WANDevice._.WANConnectionDevice._.WANPPPConnection._.Username", null, {value: username});  
> } else {  
> let igd = declare("InternetGatewayDevice.WANDevice._.WANConnectionDevice._.WANPPPConnection._.Username”, {value: 1});
> 
> ```
> if (igd.size) {
> for (let p of igd) {
> if (p.value[0]) {
> username = p.value[0];
> break;
> }
> }
> }
> 
> ```
> 
> }
> 
> return {writable: true, value: [username, “xsd:string”]};

this is my vparam for pw

> let password = “”;  
> if (typeof(args[1])==‘object’ && ‘value’ in args[1]) {  
> // Set declared value  
> password = args[1].value;  
> declare(“InternetGatewayDevice.WANDevice._.WANConnectionDevice._.WANPPPConnection._.Password", null, {value: password});  
> } else {  
> let igd = declare("InternetGatewayDevice.WANDevice._.WANConnectionDevice._.WANPPPConnection._.Password”, {value: 1});
> 
> ```
> if (igd.size) {
> for (let p of igd) {
> if (p.value[0]) {
> password = p.value[0];
> break;
> }
> }
> }
> 
> ```
> 
> }
> 
> return {writable: true, value: [password, “xsd:string”]};

And this is my piece of code where I call my vparam

> ```
> declare("VirtualParameters.pppoeUsername", {value: now});
> declare("VirtualParameters.pppoePassword",{value:now});
> 
> ```

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 2, 2020, 3:11pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/4 "2020-09-02T15:11:45Z")

</div>

I’m using vparams for setting the username and the password pppoe from the device parameters…  
My colleagues prefer that way.

With your piece of code how does it?

---

<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:** [September 2, 2020, 3:24pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/5 "2020-09-02T15:24:34Z")

</div>

> [@snuz](#):
>
> With your piece of code how does it?

It works by setting the username/password on any WANPPPConnection instance or and Device.PPP instance. I use this in production and it works without any issues.

---

<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:** [September 2, 2020, 3:27pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/6 "2020-09-02T15:27:02Z")

</div>

Your vparam scripts aren’t working because the path in the declares is invalid. I suggest you review the documentation.

---

<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:** [September 2, 2020, 3:33pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/7 "2020-09-02T15:33:31Z")

</div>

> [@snuz](#):
>
> And this is my piece of code where I call my vparam
> 
> > ```auto
> > declare("VirtualParameters.pppoeUsername", {value: now});
> > declare("VirtualParameters.pppoePassword",{value:now});
> > 
> > ```

This code will never set the username/password. There is no value provided. I highly suggest you engage the [professional services](https://genieacs.com/support/) @zaidka has to offer.

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 2, 2020, 3:51pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/8 "2020-09-02T15:51:04Z")

</div>

But…you didn’t understand me…If I edit the VirtualParameters.pppoePassword and VirtualParameters.pppoeUsername from the device parameters (as my colleagues want). On my CPE they change and it works!

But the problem is that:

> [@snuz](#):
>
> Hi,  
> I have two virtual parameters, one for the username of PPPoE and one for the password.  
> When I edit these two parameters from the device and then I commit the two pending tasks I have a fault of “Too many commits”, if I click “retry” all works. Why?
> 
> Thank you for the support!

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 2, 2020, 3:54pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/9 "2020-09-02T15:54:03Z")

</div>

To do what I’ve described, don’t I even need the provision script?

---

<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:** [September 2, 2020, 4:50pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/10 "2020-09-02T16:50:50Z")

</div>

> [@snuz](#):
>
> But…you didn’t understand me…If I edit the VirtualParameters.pppoePassword and VirtualParameters.pppoeUsername from the device parameters (as my colleagues want). On my CPE they change and it works!

Okay, now I understand the requirements. To set the un/pw from the device params page, yes this approach works.

But I would ask why you are manually setting the un/pw? This should be something that is entirely automatic. In our environment, the CPE comes online, we check the state the CPE should be in, configure it as such and the account is online. If the customer factory defaults the CPE, recovery happens automatically.

As to why you get too many commit iterations error, specify the time param:

```javascript
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: Date.now()}, {value: password});

```

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 3, 2020, 7:38am UTC](https://forum.genieacs.com/t/too-many-commits/1000/11 "2020-09-03T07:38:12Z")

</div>

I’m manually setting un/pw because my colleagues want this, I don’t know why, because I’m new in this place and they didn’t explain much to me, they just gave me this task to do.

Anyway I tried to do this, but I have the same fault: “Too many commit iterations” when I change un/pw and then I commit

> [@akcoder](#):
>
> As to why you get too many commit iterations error, specify the time param:
> 
> ```auto
> declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: Date.now()}, {value: password});
> 
> ```

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 3, 2020, 7:41am UTC](https://forum.genieacs.com/t/too-many-commits/1000/12 "2020-09-03T07:41:15Z")

</div>

I just ask you one more time if my provision script is useless for doing what I’ve described

---

<div class="post-metadata">

**Author:** ![arien](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@arien](https://forum.genieacs.com/u/arien)\
**Post date:** [September 3, 2020, 1:32pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/13 "2020-09-03T13:32:48Z")

</div>

You are using wildecard (\*) to provision values. I am not sure if that is possible because I never thought of doing that. I suspect that you get too many commit irritations because your declare statements walk entire trees of parameters.

The number of parameters is limited to 32 by default. You can set an environment variable to increase this limit, but I would not recommend to solve your problem by doing so.

It works the second time because your newly set parameters are probably skipped. The declare statement is pretty smart about that. Hence the limits are not reached then.

You probably want to change the wild cards for numbers. Most probably just number just 1. Or perhaps use a for-loop limited to the numbers you need for what you want.

---

<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:** [September 3, 2020, 3:14pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/14 "2020-09-03T15:14:08Z")

</div>

> [@arien](#):
>
> You are using wildecard (\*) to provision values. I am not sure if that is possible because I never thought of doing that

Its entirely possible. Its how I provision our CPEs, and I have absolutely no issues:

```auto
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", {value: now}, {value: config.username});
declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: now}, {value: config.password});

```

---

<div class="post-metadata">

**Author:** ![arien](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@arien](https://forum.genieacs.com/u/arien)\
**Post date:** [September 3, 2020, 7:52pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/15 "2020-09-03T19:52:30Z")

</div>

Cool, I am learning every day 🙂

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 4, 2020, 8:18am UTC](https://forum.genieacs.com/t/too-many-commits/1000/17 "2020-09-04T08:18:05Z")

</div>

And my provision script is useless for doing this?

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 4, 2020, 8:46am UTC](https://forum.genieacs.com/t/too-many-commits/1000/18 "2020-09-04T08:46:16Z")

</div>

I solved the problem by removing “xsd:string”  
before:

`return {writable: true, value: [username, "xsd:string"]};`

now:  
`return {writable: true, value: username};`

Now it works without faults

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 8, 2020, 10:21am UTC](https://forum.genieacs.com/t/too-many-commits/1000/19 "2020-09-08T10:21:55Z")

</div>

> [@akcoder](#):
>
> Ma ti chiederei perché stai impostando manualmente un / pw? Questo dovrebbe essere qualcosa che è completamente automatico. Nel nostro ambiente, il CPE è online, controlliamo lo stato in cui dovrebbe trovarsi il CPE, lo configuriamo come tale e l’account è online. Se la fabbrica del cliente imposta il CPE come predefinito, il ripristino avviene automaticamente.

I explained to my colleagues that there is the possibility of auto provision and now they want to do it this way.  
But how do I get the pppoe to be pushed back?  
I don’t understand…I need to write for example a CSV with customerCode; name; serialNumber; PPoE?  
With this the PPPoE where is it get from?

> [@akcoder](#):
>
> You can set the pppoe creds more simply like this and let the ACS figure things out for you:
> 
> ```auto
> let now = Date.now()
> declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", {value: now}, {value: config.username});
> declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Password", {value: now}, {value: config.password});
> declare("Device.PPP.Interface.*.Username", {value: now}, {value: config.username});
> declare("Device.PPP.Interface.*.Password", {value: now}, {value: config.pass
> 
> ```

---

<div class="post-metadata">

**Author:** ![snuz](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@snuz](https://forum.genieacs.com/u/snuz)\
**Post date:** [September 8, 2020, 2:28pm UTC](https://forum.genieacs.com/t/too-many-commits/1000/20 "2020-09-08T14:28:43Z")

</div>

NAME:  
SyntaxError

MESSAGE:  
Unexpected token \< in JSON at position 0

STACK:  
SyntaxError: Unexpected token \< in JSON at position 0  
at JSON.parse ()  
at IncomingMessage. (/usr/lib/node\_modules/genieacs/config/ext/cpe-config.js:35:31)  
at emitNone (events.js:111:20)  
at IncomingMessage.emit (events.js:208:7)  
at endReadableNT (\_stream\_readable.js:1064:12)  
at \_combinedTickCallback (internal/process/next\_tick.js:139:11)  
at process.\_tickCallback (internal/process/next\_tick.js:181:9)
