IotEdge Internal Server Error

WHen working with IotEdge, you might get following error, when executing setup or uninstall command with iotedgectl cli.

500 Server Error: Internal Server Error ("unable to remove filesystem for 2a212583833c8564679cf1bc13b0072508baa06aab844645d9cd075720a80dee: remove C:\ProgramData\Docker\containers\2a212583833c8564679cf1bc13b0072508baa06aab844645d9cd075720a80dee\2a212583833c8564679cf1bc13b0072508baa06aab844645d9cd075720a80dee-json.log: The process cannot access the file because it is being used by another process.")

Traceback (most recent call last):

File "c:\users\damirdobric\anaconda3\lib\site-packages\docker\api\client.py", line 222, in _raise_for_status

response.raise_for_status()

File "c:\users\damirdobric\anaconda3\lib\site-packages\requests\models.py", line 935, in raise_for_status

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localnpipe/v1.30/containers/2a212583833c8564679cf1bc13b0072508baa06aab844645d9cd075720a80dee?v=False&force=False&link=False

This usually happen if you try to recreate IotEdge device on the box, which is already provisioned with some device identifier.

To workaround this you will have to restart the docker on the box.