Internal error when using devauth api to add preauthorized new device. https://docs.mender.io/api/2.5/#preauthorize
The POST call is done with a Authorization Bearer jwt token in the header and PreAuthSet containing both identity_data and pubkey in the body as show in the coed snipet. The jwt token is taken from a POST call to …/useradm/auth/login using basic auth.
The device does seem to be added correctly but error 500 is returned with the request id.
Following the request id in the logs I find these log entries:
logs from mendersoftware/deviceauth container
time="2020-11-02T22:39:00Z" level=error msg="request PATCH http://mender-inventory:8080/api/internal/v1/inventory/tenants//device/e4e4289e-b6db-4554-8434-87183eee14b7/attribute/scope/identity failed with status 400 Bad Request, response: {\"error\":\"value: supported types are string, float64, and arrays thereof.\",\"request_id\":\"8fdb2f63-c94e-493c-98fe-999c6035f6fe\"}" file=entry.go func="logrus.(*Entry).Errorf" line=362 request_id=3d3d6f2b-e854-4d3f-aeb9-e62f478d6d86 user_id=007bc2d1-7919-5568-b934-e6c5cdd546f5
time="2020-11-02T22:39:00Z" level=error msg="internal error: failed to propagate device identity to inventory service: PATCH http://mender-inventory:8080/api/internal/v1/inventory/tenants//device/e4e4289e-b6db-4554-8434-87183eee14b7/attribute/scope/identity request failed with status 400 Bad Request" file=response_helpers.go func=rest_utils.restErrWithLogMsg line=110 request_id=3d3d6f2b-e854-4d3f-aeb9-e62f478d6d86 user_id=007bc2d1-7919-5568-b934-e6c5cdd546f5
time="2020-11-02T22:39:00Z" level=info msg="500 25014μs POST /api/management/v2/devauth/devices HTTP/1.1 - PostmanRuntime/7.26.5" byteswritten=103 file=entry.go func="logrus.(*Entry).Print" line=300 method=POST path=/api/management/v2/devauth/devices qs= request_id=3d3d6f2b-e854-4d3f-aeb9-e62f478d6d86 responsetime=0.025014599 status=500 ts="2020-11-02 22:39:00.75230408 +0000 UTC" type=http user_id=007bc2d1-7919-5568-b934-e6c5cdd546f5
logs from mendersoftware/inventory container
time="2020-11-02T22:39:00Z" level=warning msg="Failed to extract identity from header: malformed authorization data" file=entry.go func="logrus.(*Entry).Warnf" line=354 request_id=8fdb2f63-c94e-493c-98fe-999c6035f6fe
time="2020-11-02T22:39:00Z" level=error msg="value: supported types are string, float64, and arrays thereof." file=response_helpers.go func=rest_utils.restErrWithLogMsg line=110 request_id=8fdb2f63-c94e-493c-98fe-999c6035f6fe
time="2020-11-02T22:39:00Z" level=info msg="400 921μs PATCH /api/internal/v1/inventory/tenants//device/e4e4289e-b6db-4554-8434-87183eee14b7/attribute/scope/identity HTTP/1.1 - Go-http-client/1.1" byteswritten=138 file=entry.go func="logrus.(*Entry).Print" line=300 method=PATCH path=/api/internal/v1/inventory/tenants//device/e4e4289e-b6db-4554-8434-87183eee14b7/attribute/scope/identity qs= request_id=8fdb2f63-c94e-493c-98fe-999c6035f6fe responsetime=0.000921416 status=400 ts="2020-11-02 22:39:00.760744792 +0000 UTC" type=http
Logs seem to lead to an authorization error in the header of the internal PATCH call.
All suggestions and troubleshooting ideas are greatly appreciated.
My apologizes if there is an enforced forum format which I have not followed.