# Reboot task during BOOTSTRAP provision

**URL:** <https://forum.genieacs.com/t/reboot-task-during-bootstrap-provision/2437>\
**Category:** Uncategorized\
**Created:** [February 18, 2022, 11:53am UTC](https://forum.genieacs.com/t/reboot-task-during-bootstrap-provision/2437 "2022-02-18T11:53:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olebowle](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@olebowle](https://forum.genieacs.com/u/olebowle)\
**Post date:** [February 18, 2022, 11:53am UTC](https://forum.genieacs.com/t/reboot-task-during-bootstrap-provision/2437/1 "2022-02-18T11:53:38Z")

</div>

Hi,

we occasionally have issues with provisioning CPEs coming from “0 BOOTSTRAP” while still having a left-over enqueued reboot task. It seems both the task and BOOTSTRAP provision (via the corresponding preset) are fired at the same time, leading to an unsuccessful provision due to the parallel reboot.

```auto
2022-01-17T08:49:58.475Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: Inform; cpeRequestId="100" informEvent="4 VALUE CHANGE,1 BOOT,0 BOOTSTRAP" informRetryCount=0
2022-01-17T08:49:58.503Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90000" acsRequestName="Reboot"
2022-01-17T08:49:58.540Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90200" acsRequestName="GetParameterNames"
2022-01-17T08:49:58.605Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90201" acsRequestName="GetParameterNames"
2022-01-17T08:49:58.671Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90202" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.191Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90203" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.664Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90204" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.683Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90205" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.740Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90206" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.815Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90207" acsRequestName="GetParameterValues"
2022-01-17T08:49:59.885Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90208" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.922Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90209" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.981Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b9020a" acsRequestName="GetParameterNames"
2022-01-17T08:49:59.995Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b9020b" acsRequestName="GetParameterValues"
2022-01-17T08:50:00.010Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b9020c" acsRequestName="GetParameterNames"
2022-01-17T08:50:00.095Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b9020d" acsRequestName="GetParameterValues"
2022-01-17T08:50:00.174Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b9020e" acsRequestName="GetParameterNames"
2022-01-17T08:50:00.499Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b9020f" acsRequestName="GetParameterValues"
2022-01-17T08:50:00.527Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: ACS request; acsRequestId="17e673a90b90210" acsRequestName="SetParameterValues"
2022-01-17T08:50:28.932Z [ERROR] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: Bad session state
2022-01-17T08:52:29.277Z [INFO] 127.0.0.1 00040E-FRITZ%21Box-3810D55B7F09: Inform; cpeRequestId="100" informEvent="4 VALUE CHANGE,1 BOOT,M Reboot" informRetryCount=0

```

How can this be avoided / worked around? Some ideas from my side:

1. Can provisions/presets be prioritized over tasks? Can tasks be of a lower priority compared to a provision/preset?
2. Is it possible to delete tasks within a provision? We already do the following for every BOOTSTRAP provision:

```auto
clear('Device', Date.now());
clear('InternetGatewayDevice', Date.now());

```

Deleting a task here might be too late though, since I think the task and provision are fired at the same time.

1. Can reboot tasks generally be ignored for BOOTSTRAP provisions/presets?

What are your thoughts?

---

<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:** [February 18, 2022, 10:30pm UTC](https://forum.genieacs.com/t/reboot-task-during-bootstrap-provision/2437/2 "2022-02-18T22:30:40Z")

</div>

Which version of GenieACS are you using? IIRC, a BOOTSTRAP should cause all queued tasks to be removed.

---

<div class="post-metadata">

**Author:** ![olebowle](https://avatars.discourse-cdn.com/v4/letter/o/bcef8e/32.png) [@olebowle](https://forum.genieacs.com/u/olebowle)\
**Post date:** [February 19, 2022, 11:12am UTC](https://forum.genieacs.com/t/reboot-task-during-bootstrap-provision/2437/3 "2022-02-19T11:12:00Z")

</div>

I’m on v1.2.8. It is still doing it. I just double checked:

```auto
$ rpm -q genieacs
genieacs-1.2.8-1.x86_64

$ curl -i 'http://localhost:7557/devices/00040E-FRITZ%2521Box-E0286D191E9A/tasks?connection_request' -X POST --data '{ "name": "factoryReset" }'
HTTP/1.1 200 OK
GenieACS-Version: 1.2.8+20211027200938
Content-Type: application/json
Date: Sat, 19 Feb 2022 11:03:59 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

{"name":"factoryReset","device":"00040E-FRITZ%21Box-E0286D191E9A","timestamp":"2022-02-19T11:03:58.112Z","_id":"6210ce9e8a435f1dd10b2c6b"}

$ curl -i 'http://localhost:7557/devices/00040E-FRITZ%2521Box-E0286D191E9A/tasks' -X POST --data '{ "name": "reboot" }'
HTTP/1.1 202 Accepted
GenieACS-Version: 1.2.8+20211027200938
Content-Type: application/json
Date: Sat, 19 Feb 2022 11:04:20 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

{"name":"reboot","device":"00040E-FRITZ%21Box-E0286D191E9A","timestamp":"2022-02-19T11:04:20.375Z","_id":"6210ceb406374f2124f2db01"}

$ curl -i 'http://localhost:7557/tasks' -X GET
HTTP/1.1 200 OK
GenieACS-Version: 1.2.8+20211027200938
Content-Type: application/json
total: 1
Date: Sat, 19 Feb 2022 11:05:07 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Transfer-Encoding: chunked

[
{"_id":"6210ceb406374f2124f2db01","name":"reboot","device":"00040E-FRITZ%21Box-E0286D191E9A","timestamp":"2022-02-19T11:04:20.375Z"}
]

```

The log looks like this:

```auto
2022-02-19T11:03:58.374Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: Inform; cpeRequestId="123" informEvent="6 CONNECTION REQUEST" informRetryCount=0
2022-02-19T11:03:58.430Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: ACS request; acsRequestId="17f11a71a8b0100" acsRequestName="FactoryReset"
2022-02-19T11:03:58.719Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: ACS request; acsRequestId="17f11a71a8b0300" acsRequestName="GetParameterNames"
2022-02-19T11:03:58.735Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: ACS request; acsRequestId="17f11a71a8b0301" acsRequestName="GetParameterValues"
2022-02-19T11:07:54.956Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: Inform; cpeRequestId="100" informEvent="4 VALUE CHANGE,1 BOOT,0 BOOTSTRAP" informRetryCount=0
2022-02-19T11:07:55.012Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: ACS request; acsRequestId="17f11aab6a60000" acsRequestName="Reboot"
2022-02-19T11:07:55.081Z [INFO] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: ACS request; acsRequestId="17f11aab6a60200" acsRequestName="GetParameterNames"
2022-02-19T11:08:26.102Z [ERROR] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: Session timeout; sessionTimestamp=1645268874918
2022-02-19T11:08:26.103Z [WARN] ::ffff:127.0.0.1 00040E-FRITZ%21Box-E0286D191E9A: Channel has faulted; channel="default" retries=0 faultCode="session_terminated" faultMessage="The TR-069 session was unsuccessfully terminated"

```

---

<div class="post-metadata">

**Author:** ![mtarifa](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mtarifa/32/848_2.png) [@mtarifa](https://forum.genieacs.com/u/mtarifa)\
**Post date:** [February 28, 2022, 1:18pm UTC](https://forum.genieacs.com/t/reboot-task-during-bootstrap-provision/2437/4 "2022-02-28T13:18:50Z")

</div>

may be you need to add “-6 CONNECTION REQUEST” on default preset or any that will trigger in that condition like refresh\_vparams. i had similar issue on a “reboot” command during boostrap provision.
