Preauthorization no longer working after upgrading to v2.6

Hi, device preauthorization is no longer working after an upgrade from 2.4 to 2.6.

Full story :

  • We have just upgraded our Mender installation as it is documented here
  • We have experienced some issues with mongodb, they were resolved with this help
  • Strange data was displayed in the UI, everything was okay again after running deviceauth propagate-inventory commands

But one problem is remaining: device preauthorization API calls are returning 500 internal errors

We send:

{
    "identity_data" : {
        "barcode" : "AB123412341234"
    },
    "pubkey": "-----BEGIN PUBLIC KEY-----\nMIIBojAN...-----END PUBLIC KEY-----"
}

We can see this in menderproduction_mender-device-auth_1 container logs :

time="2021-03-15T15:12:53Z" level=error msg="update device status request POST http://mender-workflows-server:8080/api/v1/workflow/update_device_status failed with status 400 Bad Request, response text: {\"error\":\"Missing input parameters: [device_ids]\"}" file=client_orchestrator.go func="orchestrator.(*Client).SubmitUpdateDeviceStatusJob" line=247 request_id=7d0d92d4-7484-4e0f-b030-2961544a6306 user_id=26cd8868-7a66-4b72-acb1-65f0b29fbab0
time="2021-03-15T15:12:53Z" level=info msg="500 4402μs POST /api/management/v2/devauth/devices HTTP/1.1 - PostmanRuntime/7.26.8" byteswritten=103 file=middleware.go func="accesslog.(*AccessLogMiddleware).MiddlewareFunc.func1" line=71 method=POST path=/api/management/v2/devauth/devices qs= request_id=7d0d92d4-7484-4e0f-b030-2961544a6306 responsetime=0.004402464 status=500 ts="2021-03-15 15:12:53.250713544 +0000 UTC" type=http user_id=26cd8868-7a66-4b72-acb1-65f0b29fbab0

If we resend a second time, we receive a 409 conflict (device was created the first time without auth set) :

{
    "id": "87d5584e-5446-...",
    "id_data": "{\"barcode\":\"AB123412341234\"}",
    "IdDataStruct": {
        "barcode": "AB123412341234"
    },
    "IdDataSha256": "jttlfbu....",
    "decommissioning": false,
    "created_ts": "2021-03-15T14:47:36.502Z",
    "updated_ts": "2021-03-15T14:47:36.502Z",
    "auth_sets": null
}

Thanks for the help.

Hello @jean-fabien

There seems to be an issue where workflows-server keeps the old (2.4) definitions in memory.
Can you try restarting the service?

Hi, problem is solved after a restart ! thank you and sorry we just didn’t try it

1 Like