I'm trying to deploy a new artifact version on a client but it keeps failing every time and I don't understand what's wrong.
This is is the only client (as of now) that exhibits this problem: other similar clients have no problems at all updating from the same server and using the very same artifact.
I tried also launching the mender client with `-debug -daemon` to better see error messages, if any, but to no avail.
INFO[0001] successfuly received new authorization data module=mender
INFO[0001] State transition: authorize [Sync] -> check-wait [Idle] module=mender
DEBU[0001] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0001] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0001] handle check wait state module=state
DEBU[0001] check wait state; next checks: (update: 0001-01-01 00:05:00 +0000 UTC) (inventory: 0001-01-01 00:00:00 +0000 UTC) module=state
DEBU[0001] next check: 0001-01-01 00:00:00 +0000 UTC:&{{4 2}}, (2018-05-15 09:08:43.194575885 +0000 UTC m=+1.201161619) module=state
DEBU[0001] check wait returned: &{{4 2}} module=state
INFO[0001] State transition: check-wait [Idle] -> inventory-update [Sync] module=mender
DEBU[0001] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0001] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0004] Read data from device manifest file: device_type=my-device-type module=mender
DEBU[0004] Found needed line: device_type=my-device-type module=mender
DEBU[0004] Current manifest data: my-device-type module=mender
DEBU[0004] Read data from device manifest file: artifact_name=update_20180322_1 module=mender
DEBU[0004] Found needed line: artifact_name=update_20180322_1 module=mender
DEBU[0004] Current manifest data: update_20180322_1 module=mender
DEBU[0004] inventory update sent, response &{200 OK 200 HTTP/1.1 1 1 map[Content-Type:[application/json; charset=utf-8] Content-Length:[0] Vary:[Accept-Encoding] X-Inventory-Version:[unknown] X-Men-Requestid:[cbc781ff-4f9a-40ea-84a8-6f9e731da1e2] X-Xss-Protection:[1; mode=block] Cache-Control:[no-cache, no-store] Connection:[keep-alive] X-Frame-Options:[DENY] Date:[Tue, 15 May 2018 09:08:46 GMT] Content-Encoding:[gzip] Server:[nginx/1.10.3] X-Content-Type-Options:[nosniff] Pragma:[no-cache]] 0x44201c8020 0 [] false false map[] 0x44201a0600 0x442033a000} module=client_inventory
DEBU[0004] inventory refresh complete module=state
INFO[0004] State transition: inventory-update [Sync] -> check-wait [Idle] module=mender
DEBU[0004] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0004] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0004] handle check wait state module=state
DEBU[0004] check wait state; next checks: (update: 0001-01-01 00:05:00 +0000 UTC) (inventory: 2018-05-15 09:23:43.196025803 +0000 UTC m=+901.202611336) module=state
DEBU[0004] next check: 0001-01-01 00:05:00 +0000 UTC:&{{6 2}}, (2018-05-15 09:08:46.720001488 +0000 UTC m=+4.726587121) module=state
DEBU[0004] check wait returned: &{{6 2}} module=state
INFO[0004] State transition: check-wait [Idle] -> update-check [Sync] module=mender
DEBU[0004] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0004] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0004] handle update check state module=state
DEBU[0004] Read data from device manifest file: artifact_name=update_20180322_1 module=mender
DEBU[0004] Found needed line: artifact_name=update_20180322_1 module=mender
DEBU[0004] Current manifest data: update_20180322_1 module=mender
DEBU[0004] Read data from device manifest file: device_type=my-device-type module=mender
DEBU[0004] Found needed line: device_type=my-device-type module=mender
DEBU[0004] Current manifest data: my-device-type module=mender
DEBU[0004] Received response:200 OK module=client_update
DEBU[0004] Have update available module=client_update
INFO[0004] Correct request for getting image from:
https://update.example.com/mender-artifact-storage/<OMISSIS> [name: 0x5eeeb0; devices: [my-device-type]] module=client_update
DEBU[0004] received update response: {{{
https://update.example.com/mender-artifact-storage/<OMISSIS> 2018-05-15T10:08:46.760786361Z} [my-device-type] update_20180328_2} 0cc6f0e3-e6c6-42c5-9d1d-0cc68983446d} module=mender
INFO[0004] State transition: update-check [Sync] -> update-fetch [Download] module=mender
DEBU[0004] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
DEBU[0004] statescript: timeout for executing scripts is not defined; using default of 60 seconds module=executor
INFO[0004] State transition: update-fetch [Download] -> update-status-report [none] module=mender
DEBU[0004] handle update status report state module=state
DEBU[0004] status reported, response &{204 No Content 204 HTTP/1.1 1 1 map[Server:[nginx/1.10.3] X-Frame-Options:[DENY] X-Content-Type-Options:[nosniff] Access-Control-Allow-Headers:[Authorization,Content-type] Connection:[keep-alive] X-Deployments-Version:[unknown] Cache-Control:[no-cache, no-store] Access-Control-Allow-Origin:[*] Date:[Tue, 15 May 2018 09:08:46 GMT] Content-Encoding:[gzip] Pragma:[no-cache] X-Xss-Protection:[1; mode=block] Access-Control-Allow-Methods:[GET, POST, OPTIONS, PUT, DELETE] Content-Type:[application/json; charset=utf-8] Vary:[Accept-Encoding] X-Men-Requestid:[c5a15df4-645f-4cb1-a5be-290734ae950c]] 0x44201b8880 0 [] false false map[] 0x44204d8100 0x442033a000} module=client_status
DEBU[0004] attempting to upload deployment logs for failed update module=state
ERRO[0004] got unexpected HTTP status when uploading log: 400 module=client_log
ERRO[0004] error uploading logs: uploading logs failed, bad status 400 module=mender
ERRO[0004] failed to report deployment logs: transient error: uploading logs failed, bad status 400 module=state
ERRO[0004] failed to send deployment logs to server: transient error: failed to send deployment logs: transient error: uploading logs failed, bad status 400 module=state
INFO[0004] State transition: update-status-report [Download] -> update-retry-report [none] module=mender
DEBU[0124] wait complete module=state
INFO[0124] State transition: update-retry-report [Download] -> update-status-report [Download] module=mender
DEBU[0124] handle update status report state module=state
DEBU[0124] attempting to upload deployment logs for failed update module=state
ERRO[0125] got unexpected HTTP status when uploading log: 400 module=client_log
ERRO[0125] error uploading logs: uploading logs failed, bad status 400 module=mender
ERRO[0125] failed to report deployment logs: transient error: uploading logs failed, bad status 400 module=state
ERRO[0125] failed to send deployment logs to server: transient error: failed to send deployment logs: transient error: uploading logs failed, bad status 400 module=state
INFO[0125] State transition: update-status-report [Download] -> update-retry-report [none] module=mender
The client seems to fail as soon as the "Download" state is reached, but I cannot understand what's causing it to fail.
It then starts trying to upload the error log, but the file does not exist at all, resulting in HTTP 400 errors when trying to PUT it on the server.
mender-deployments_1 | time="2018-05-15T09:33:34Z" level=error msg="no messages: invalid deployment log" device_id=5abb88e148949e0001934536 file="controller_deployments.go" func="controller.(*DeploymentsController).PutDeploymentLogForDevice" line=377 request_id=ba8816f4-8311-4776-82be-c1e79f634e23
mender-deployments_1 | time="2018-05-15T09:33:34Z" level=info msg="400 1922μs PUT /api/devices/v1/deployments/device/deployments/db2a7bfd-e25b-4fe9-b87e-e7af32ed2aa8/log HTTP/1.0 - Go-http-client/1.1" device_id=5abb88e148949e0001934536 file=middleware.go func="accesslog.(*AccessLogMiddleware).MiddlewareFunc.func1" line=60 request_id=ba8816f4-8311-4776-82be-c1e79f634e23
I tried creating a fake log file in `/var/lib/mender/deployments.0001.0cc6f0e3-e6c6-42c5-9d1d-0cc68983446d.log` and "unlocked" the client which could now upload something to the server and return to the "Idle" state. From here, trying to perform another deployment results in the client failing the same way again as soon as the "Download" state is reached, failing to upload a non-existing log file.