Azure / cli

Automate your GitHub workflows using Azure CLI scripts
MIT License
124 stars 52 forks source link

Azure CLI use_dynamic_install throws Unhandled promise rejection #72

Closed briglx closed 2 years ago

briglx commented 2 years ago

I'm trying to run code that requires the az automation extension.

I'm calling az config set extension.use_dynamic_install=yes_without_prompt

Related Issue here https://github.com/Azure/azure-cli/issues/21505

- name: Clean Up Resources
        uses: azure/CLI@v1
        with:
          azcliversion: 2.30.0
          inlineScript: |

            # Allow Dynamic installation of extensions
            az config set extension.use_dynamic_install=yes_without_prompt

However it throws the following error:

UnhandledPromiseRejectionWarning: Error: az cli script failed.
    at /home/runner/work/_actions/azure/CLI/v1/dist/index.js:1:2[39](https://github.com/xxx/xxx/runs/5400826457?check_suite_focus=true#step:8:39)64
    at Generator.throw (<anonymous>)
    at rejected (/home/runner/work/_actions/azure/CLI/v1/dist/index.js:1:20436)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:1861) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1861) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
aparna-ravindra commented 2 years ago

Hey @briglx, I see that you have already linked the related issue in Azure/azure-cli. Can you please help me understand your expectation from the action?

From your description, my understanding is that the action should continue fail if azure-cli fails but the failure should be handled gracefully so that we do not see the UnhandledPromiseRejectionWarning message. Is my understanding correct?

briglx commented 2 years ago

Ideally, the solution should not fail. It's not clear what the root cause is for the failure. Is it the Action container version or is it the CLI

OmpahDev commented 2 years ago

I'm also receiving this error when using the Azure/cli githu action.

t-dedah commented 2 years ago

Hi @briglx @tdevopsottawa Can you please provide us with complete logs as there should be a ERROR field with correct error message.

image

github-actions[bot] commented 2 years ago

This issue is idle because it has been open for 14 days with no activity.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 7 days with no activity.

t-dedah commented 2 years ago

Hi @briglx Are you still facing this issue?

briglx commented 2 years ago

Hi, I think there was an error happening above this line.... I've been able to either work around or resolve the issue.