How to check a 202 response from a task

I saw in this old topic that 202 is returned for a task if the device is not found https://forum.genieacs.com/t/cant-change-parameters-via-api/2036

Is this still the case? In my case I am occasionally getting a 202 when I send quite a few “SetParameters” in one task (see example below - it if it fails, usually around the 16th or 17th entry. I understood 202 to indicate “Accepted” and would return an ID which you can use to query that task for completion (404 being better for “not found”).

[
  {
    "_id": "63ab4432286c2915fd21f671",
    "name": "setParameterValues",
    "parameterValues": [
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.3.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.4.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.5.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.6.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.SSIDAdvertisementEnabled", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.Time.NTPServer1", "172.28.107.13", "xsd:string" ],
      [ "InternetGatewayDevice.Time.NTPServer2", "172.28.103.13", "xsd:string" ],
      [ "InternetGatewayDevice.Time.Enable", "True", "xsd:boolean" ],
      [ "InternetGatewayDevice.Time.LocalTimeZone", "-00:00", "xsd:string" ],
      [ "InternetGatewayDevice.Time.LocalTimeZoneName", "Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London", "xsd:string" ],
      [ "InternetGatewayDevice.X_ASB_COM_EthPort.EthPort.1.isTr069Domain", "True", "xsd:boolean" ],
      [ "InternetGatewayDevice.X_ASB_COM_EthPort.EthPort.2.isTr069Domain", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.X_ASB_COM_EthPort.EthPort.3.isTr069Domain", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.X_ASB_COM_EthPort.EthPort.4.isTr069Domain", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.X_ALU-COM_WanAccessCfg.SshDiabled", "True", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Enable", "True", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.Enable", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.3.Enable", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.4.Enable", "True", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.5.Enable", "True", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.6.Enable", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.Enable", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.8.Enable", "False", "xsd:boolean" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.X_ASB_COM_routeMode", "2", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.X_ASB_COM_routeMode", "1", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.3.X_ASB_COM_routeMode", "1", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.4.X_ASB_COM_routeMode", "1", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.5.X_ASB_COM_routeMode", "2", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.6.X_ASB_COM_routeMode", "2", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.7.X_ASB_COM_routeMode", "2", "xsd:integer" ],
      [ "InternetGatewayDevice.LANDevice.1.WLANConfiguration.8.X_ASB_COM_routeMode", "2", "xsd:integer" ]
    ],
    "device": "D8EFCD-G%2D240W%2DB-ALCLB36A82B2",
    "timestamp": "2022-12-27T19:14:58.488Z"
  }
]

If I query a task by its ID, the return is the original task and timestamp. How do I then query for the task result if it was accepted but not immediately processed?

The only way I can see to do this now is optimistically query for faults against the device and make an assumption if I don’t find one (but how long to wait?).

If you read through that thread, you will see that I reported the regression and it was resolved in v1.2.7.

A task will only exist in the queue for a CPE if it hasn’t been accepted by the CPE, or if the task faulted.

When dealing with CPEs, its better to embrace the concept of eventual consistency. This means create your provision scripts to set the desired state of the CPE. Do any one-off config changes via a SPV and forget about it.

If you are doing integration between an existing subscriber management platform and GenieACS, I’ve found the less information you present to the end user (csr/tech/etc), the better. I used to display the status of all the tasks of the CPE in our home-grown subscriber management platform, but all that did was create anxiety for our csrs/field techs/operations. So now, unless you are a super user, you get very basic information about the status of the CPE:

1 Like

yes -sorry, I missed that part of the old thread. 404 is good so I can make assumption 202 really is a true “accepted” but not yet processed.
The issue is not so much about displaying status to users or operators, more that these values are initial service setup and some are crucial for the service to perform. for example InternetGatewayDevice.X_ASB_COM_EthPort.EthPort.1.isTr069Domain sets up a port to be routed or L2 bridged which is essential.

I didn’t want to send them one at a time - eventually we will have tens of thousands of devices and that would be noisy.

I think the strategy I will adopt is to do a post-provision audit of failures, times and counts (none = good) and then do an audit of all provisioned values to check they got set appropriately and re-apply if not.

What is the network situation on your routers? Is it possible to run two networks? We run all of our devices with two networks, management (dhcp) and router or bridged (pppoe). Management runs on a vlan, and pppoe is untagged. This has the benefit that we always have communication with the CPE no matter its configuration state (router or bridged), and regardless of if the customers service is active (a lot of snow birds who keep their equipment year after year, but disable service).

Here is the flow for a brand new CPE on our network. CPE comes online. DSL or WAN port comes up. CPE gets a dhcp addr on the mgmt network and then informs to our ACS. The default bootstrap and inform provisions run, and an additional provision that connects to our subscriber mgmt server and queries for the configuration of the CPE (router or bridged). If there is a configuration, then a tag gets added with either Routed or Bridged. Then a preset with precondition of Tags.Disabled IS NULL AND Tags.Provisioned IS NULL AND Tags.Managed IS NOT NULL kicks off the Routed provision. The routed provision script then asks the server for the pppoe credentials and wifi/lan settings for the user. Finally, the CPE is rebooted and everything comes up and works. A variation of this happens for bridged devices too.

Through no part of this process do I worry about verifying that everything worked. There are occasionally rare instances where the CPE will return a thumbs up to the ACS with regards to a SPV, but the CPE didn’t actually write the values to memory. Because it happens so infrequently, I added a “Reprovision” button to our subsriber mgmt server that removes the Provisioned tag and causes the CPE to run through the provisioning process again. If I had more serious concerns about the CPE, I would modify my provisions to double check that the CPE is actually provisioned.

I would encourage you to check out an Example of a Provisioning Flow · genieacs/genieacs Wiki · GitHub

thank you for the detail Yes the management side network has a separate management vlan and the consumer traffic is routed on separate vlans to the ISPs so we can always access the CPE (fyi this is a open fiber network so multiple ISPs operate).

Provisioning starts with ONT stack provisions which itself incudes some basic CPE setup directly via the firmware (so even if consumer does factory reset, a minimum set of common and critical values are set prior to any bootstrap). Only then we push the final provision including all the extra settings via the ACS. This final step is currently poll-and-push and I do use tags to store state so we do not repeat ourselves but I would like to get it to be event-driven but there is some development needed to get there. Meantime I am extending the process to poll-push-verify so we can assure the engineer onsite we are ready for them to test.

Thanks again for the insights. Cheers, Mark.

My experience has been very few customers f-reset the device (unless they are idiot “power users”). Most of our factory resets happen from our techs being lazy and instead of raising issues to engineering, they click the default button within our mgmt server. Because a f-default fixes everything, right?

How so? GenieACS is already event driven. A CPE event happens, then a preset kicks off based on the event (if there is a preset that matches the given event).

We must share the same techs :slight_smile:

Agreed. The AMS is the initial issue. I had to write to ACS initially as push to get around some issues with orchestration between the AMS and ACS. Ideally aiming for event → pull → configure on both.