I am trying to run step by step here.

And an error text with several large logs being shown on screen, as below:

Google Cloud IoT Core MQTT example:

    error { '0': {},
    { [Function: require]
     resolve: [Function: resolve],
      Module {
        id: '.',
        exports: {},
        parent: null...

I am using ES256 private key created IoT device and registries as specified in the quickstart guide.

My question is NOT this one, as the logs are different. Mine says "error" instead of "connect"


2 Answers 2


This error can be caused by the --cloud_region being incorrectly or not specified. For example, here is the command line taken from the Quickstart guide with the --cloud_region added for europe-west1.

node cloudiot_mqtt_example_nodejs.js \
    --project_id=PROJECT_ID \
    --registry_id=my-registry \
    --device_id=my-device \
    --cloud_region=europe-west1 \
    --private_key_file=rsa_private.pem \
    --num_messages=5 \

My best bet is to look their own troubleshooting manual because the Google Iot Cloud is in so early beta that there is no proper error handling / tracing available and as an outsider I can only guess what is wrong with that little log snippet.

API there is changing and the procedure to establish connection is quite lengthy so places of error may be many. Thus more precise instructions cannot be given based on this information.

  • 1
    agree with you, anyway I used clean environment to build up from ground to get it working now. Looks like an issue of access management
    – Saurabh J
    Commented Oct 10, 2017 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.