Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

[V2] Json Error on Set Modules deployment #612

Closed
Strandfelt opened this issue May 23, 2018 · 3 comments
Closed

[V2] Json Error on Set Modules deployment #612

Strandfelt opened this issue May 23, 2018 · 3 comments

Comments

@Strandfelt
Copy link

  • V2 issue

  • OS version and architecture used: Windows 10 x86_64

  • Version used: 1.0.0rc22

  • V2 Docker version and container type: linux

Description of the issue:

I have followed the guide on setting up the OPC Publisher module from the README of the module source here: https://github.com/Azure/iot-edge-opc-publisher
Once I finish setting the module on the IoT Edge tab of the portal, I get the error message shown in the section below, after running docker logs -f edgeAgent
The deployment generated by the Azure portal is as follows:

{
    "moduleContent": {
        "$edgeAgent": {
            "properties.desired": {
                "schemaVersion": "1.0",
                "runtime": {
                    "type": "docker",
                    "settings": {
                        "minDockerVersion": "v1.25",
                        "loggingOptions": ""
                    }
                },
                "systemModules": {
                    "edgeAgent": {
                        "type": "docker",
                        "settings": {
                            "image": "microsoft/azureiotedge-agent:1.0-preview",
                            "createOptions": "{}"
                        }
                    },
                    "edgeHub": {
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always",
                        "settings": {
                            "image": "microsoft/azureiotedge-hub:1.0-preview",
                            "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}}"
                        }
                    }
                },
                "modules": {
                    "iot-edge-opc-publisher": {
                        "type": "docker",
                        "status": "running",
                        "restartPolicy": "always",
                        "settings": {
                            "image": "microsoft/iot-edge-opc-publisher:latest",
                            "createOptions": "{\"Hostname\":\"publisher\",\"Cmd\":[\"dotnet\",\"/build/out/OpcPublisher.dll\",\"publisher\",\"--pf\",\"/docker/publishednodes.json\",\"--lf\",\"/docker/publisher.log.txt\",\"--si\",\"1\",\"--ms\",\"0\",\"--di\",\"5\",\"--fd\",\"true\",\"--tm\",\"true\",\"--as\",\"true\",\"--vc\",\"true\",\"--ih\",\"Mqtt_Tcp_Only\"],\"HostConfig\":{\"Binds\":[\"//d/docker/docker:/docker\"]}}"
                        }
                    }
                }
            }
        },
        "$edgeHub": {
            "properties.desired": {
                "schemaVersion": "1.0",
                "routes": {
                    "upstream": "FROM /* INTO $upstream"
                },
                "storeAndForwardConfiguration": {
                    "timeToLiveSecs": 7200
                }
            }
        }
    }
}

Console log of the issue:

2018-05-23 09:39:49.015 +00:00 [ERR] - Error updating deployment config from edge agent desired properties.
Newtonsoft.Json.JsonSerializationException: Value cannot be null.
Parameter name: version
   at Microsoft.Azure.Devices.Edge.Agent.Core.Serde.TypeSpecificSerDe`1.Deserialize[TU](String json) in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/serde/TypeSpecificSerDe.cs:line 56
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.UpdateDeploymentConfig() in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/EdgeAgentConnection.cs:line 165
2018-05-23 09:39:49.017 +00:00 [ERR] - Edge agent failed to process desired properties update patch
Microsoft.Azure.Devices.Edge.Agent.Core.ConfigSources.ConfigFormatException: Agent configuration format is invalid. ---> Newtonsoft.Json.JsonSerializationException: Value cannot be null.
Parameter name: version
   at Microsoft.Azure.Devices.Edge.Agent.Core.Serde.TypeSpecificSerDe`1.Deserialize[TU](String json) in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/serde/TypeSpecificSerDe.cs:line 56
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.UpdateDeploymentConfig() in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/EdgeAgentConnection.cs:line 165
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.UpdateDeploymentConfig() in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/EdgeAgentConnection.cs:line 177
   at Microsoft.Azure.Devices.Edge.Agent.IoTHub.EdgeAgentConnection.<ApplyPatchAsync>d__21.MoveNext() in /opt/vsts/work/1/s/edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/EdgeAgentConnection.cs:line 141
@Strandfelt
Copy link
Author

Duplicate issue of: #611

@aribeironovaes
Copy link
Contributor

Thanks @Strandfelt . Closing this issue and following up on #611.

@jongio
Copy link
Member

jongio commented May 23, 2018

Please use the Az IoT CLI Extension as a workaround: https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-create-deployment-with-cli-iot-extension

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants