question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Container Instance instanceView is undefined

See original GitHub issue

Description When getting a list of containerGroups and their containers, the instanceView value on both of them are undefined (and null using the CLI)

Code Snippet as a timer function

const msRestAzure = require("ms-rest-azure");
const { ContainerInstanceManagementClient } = require("azure-arm-containerinstance");

const clientId = "-";
const secret = "-";
const domain =  "-";
const subscriptionId =  "-";
const resourceGroupName = "-";

module.exports = async function (context, myTimer) {
    const timeStamp = new Date().toISOString();

    const creds = await msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain);
    const client = new ContainerInstanceManagementClient(creds, subscriptionId);
     const containerGroupList = await client.containerGroups.listByResourceGroup(resourceGroupName);
    containerGroupList.forEach(containerGroup => {
        containerGroup.containers.forEach(container => {
            context.log(`container: *${container.name}* instance view: ${JSON.stringify(container.instanceView)} ${JSON.stringify(containerGroup.instanceView)}`);
        })
    });


    context.log('JavaScript timer trigger function ran!', timeStamp);
};

Output:

container: *containerName*: instance view: undefined undefined 

CLI Output:

[
  {
    "containers": [
      {
        "command": null,
        "environmentVariables": [envvars],
        "image": "grabberpipelineregistry.azurecr.io/grabber:latest",
        "instanceView": null,
        "livenessProbe": null,
        "name": "containerName",
        "ports": [],
        "readinessProbe": null,
        "resources": {
          "limits": null,
          "requests": {
            "cpu": 1.0,
            "gpu": null,
            "memoryInGb": 1.0
          }
        },
        "volumeMounts": null
      }
    ],
    "diagnostics": null,
    "dnsConfig": null,
    "id": "myid",
    "identity": null,
    "imageRegistryCredentials": [
      {
        "password": null,
        "server": "grabberpipelineregistry.azurecr.io",
        "username": "grabberpipelineregistry"
      }
    ],
    "instanceView": null,
    "ipAddress": null,
    "location": "Central US",
    "name": "containerGroupName",
    "networkProfile": null,
    "osType": "Linux",
    "provisioningState": "Succeeded",
    "resourceGroup": "grabber-pipeline",
    "restartPolicy": "Never",
    "tags": null,
    "type": "Microsoft.ContainerInstance/containerGroups",
    "volumes": null
  }
]

However, they appear in the beginCreateOrUpdate function (see the very end of the block):

{
    "id": "id",
    "name": "containerGroupName",
    "type": "Microsoft.ContainerInstance/containerGroups",
    "location": "Central US",
    "provisioningState": "Pending",
    "containers": [
        {
            "name": "containerName",
            "image": "grabberpipelineregistry.azurecr.io/grabber:latest",
            "ports": [],
            "environmentVariables": [],
            "resources": {
                "requests": {
                    "memoryInGB": 1,
                    "cpu": 1
                }
            }
        }
    ],
    "imageRegistryCredentials": [
        {
            "server": "grabberpipelineregistry.azurecr.io",
            "username": "grabberpipelineregistry"
        }
    ],
    "restartPolicy": "Never",
    "osType": "Linux",
    "instanceView": {
        "events": [],
        "state": "Pending"
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lirenhecommented, May 21, 2021

The following package is deprecated, https://www.npmjs.com/package/azure-arm-containerinstance Could you please use https://www.npmjs.com/package/@azure/arm-containerinstance instead? Please let us know if you still have problems.

1reaction
qiaozhacommented, Mar 20, 2020

@evanfrawley Thanks for reporting this. @nickzhums It looks like a bug from the service because both CLI and node SDK didn’t return the instanceview in the list result. Can you help to find someone from the service team to check on that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot common issues - Azure Container Instances
This article shows how to troubleshoot common issues for managing or deploying containers to Azure Container Instances.
Read more >
laravel - 1.0.2\resources\views\products\indexpublic.blade.php)
In the indexpublic() function you're passing the $products variable to the view, but not the $teambatter variable. This should work:
Read more >
Tom-Butler-PHP/community - Gitter
I don't quite see a way to add an instance of a class to the container. ... hint and automatically create a Twig...
Read more >
Release Notes — Airflow Documentation
Always draw borders if task instance state is null or undefined (#18033) ... [AIRFLOW-7010] Skip in-container checks for Dockerhub builds (#7652).
Read more >
all-rdo-bugs-03-06-2014.txt
===RDO Bugs ==== This contains a local list of the bugs that are open ... when checking the "Name" check box in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found