Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action is not compatible with latest Github base image #175

Open
Tolsto opened this issue Jan 14, 2025 · 9 comments · May be fixed by #176
Open

Action is not compatible with latest Github base image #175

Tolsto opened this issue Jan 14, 2025 · 9 comments · May be fixed by #176
Assignees
Labels
good first issue Good for newcomers P0 Action not working

Comments

@Tolsto
Copy link

Tolsto commented Jan 14, 2025

This action expects the access token to be in ${process.env.HOME}/.azure. However, the latest Github base image now uses /opt/az-config As a result, this action doesn't work anymore when using it together with the azure/login action.

@Tolsto
Copy link
Author

Tolsto commented Jan 14, 2025

As a workaround you can use

- name: 'Run Az login'
  uses: azure/login@v2
  with:
    client-id: ${{ inputs.client-id }}
    tenant-id: ${{ inputs.tenant-id }}
    subscription-id: ${{ inputs.subscription-id }}
  env:
    AZURE_CONFIG_DIR: "/home/runner/.azure"
  
- name: Run Az CLI
  uses: azure/CLI@v2
  with:
    azcliversion: 2.65.0
    inlineScript: |
      ...
  env:
    AZURE_CONFIG_DIR: "/root/.azure"

@mcalthrop
Copy link

mcalthrop commented Jan 14, 2025

@Tolsto, @MoChilia What value should be specified for AZURE_CONFIG_DIR when az is run directly from a bash step?

Context: when using nick-fields/retry, and setting AZURE_CONFIG_DIR: "/root/.azure", an error results:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/az/lib/python3.12/site-packages/azure/cli/__main__.py", line 30, in <module>
    az_cli = get_default_cli()
             ^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/__init__.py", line 922, in get_default_cli
    from azure.cli.core.azlogging import AzCliLogging
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/azlogging.py", line 30, in <module>
    from azure.cli.core.commands.events import EVENT_INVOKER_PRE_CMD_TBL_TRUNCATE
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 27, in <module>
    from azure.cli.core.extension import get_extension
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/extension/__init__.py", line 18, in <module>
    az_config = CLIConfig(config_dir=GLOBAL_CONFIG_DIR, config_env_var_prefix=ENV_VAR_PREFIX)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/knack/config.py", line 40, in __init__
    ensure_dir(config_dir)
  File "/opt/az/lib/python3.12/site-packages/knack/util.py", line 114, in ensure_dir
    raise e
  File "/opt/az/lib/python3.12/site-packages/knack/util.py", line 111, in ensure_dir
    os.makedirs(d)
  File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: '/root/.azure'

The YML looks roughly like this:

    - name: 'Login via Azure CLI'
      uses: azure/[email protected]
      env:
        AZURE_CONFIG_DIR: '/home/runner/.azure'
      with:
        client-id: ${{ some.value }}
        tenant-id: ${{ some.value }}
        subscription-id: ${{ some.value }}
     
    - name: Do something
      uses: nick-fields/[email protected]
      env:
        AZURE_CONFIG_DIR: '/root/.azure'
      with:
        timeout_seconds: 360
        max_attempts: 5
        retry_wait_seconds: 10
        command: |
          az some command

This is a blocking issue right now.

@mcalthrop
Copy link

Looks like the following works:

AZURE_CONFIG_DIR: '/home/runner/.azure'

@MoChilia MoChilia added P0 Action not working and removed need-to-triage Requires investigation labels Jan 15, 2025
@MoChilia
Copy link
Member

Thank you for reporting this! We are now looking into this issue.

@MoChilia MoChilia added P1 Some scenario broken but workaround exists P0 Action not working and removed P0 Action not working P1 Some scenario broken but workaround exists labels Jan 15, 2025
@MoChilia
Copy link
Member

Hi @Tolsto, @mcalthrop, may I know which runner image you are using to trigger this issue? I want to test the fix.

@mcalthrop
Copy link

Hi @Tolsto, @mcalthrop, may I know which runner image you are using to trigger this issue? I want to test the fix.

@MoChilia We've narrowed it down to a specific image that always fails: 20250113.1.0.

It never fails with the previous image: 20250105.1.0.

The problem is that the GitHub code seems to choose the image at random. So it's really hard to test: if the good image is chosen, we have to re-run the workflow until it so happens to choose the bad image.

@MoChilia
Copy link
Member

The Azure CLI product team demands an immediate revert of this change: actions/runner-images#11173 (comment).

@Tolsto
Copy link
Author

Tolsto commented Jan 15, 2025

Hi @Tolsto, @mcalthrop, may I know which runner image you are using to trigger this issue? I want to test the fix.

We use ubuntu-latest (for x86) and the default image provided by the ARM runner. As already pointed out by @mcalthrop the rollout of the new image seems to be staged, i.e. failures are random.

@MoChilia
Copy link
Member

MoChilia commented Jan 16, 2025

The GitHub runner image team has started the rollback: actions/runner-images#11400. The issue should be resolved soon. Let's wait for them to complete the rollback.

And I would like to send a big thank you to @Tolsto for bringing this issue to our attention. Your immediate report has helped us prevent a large-scale outage. 👍

@MoChilia MoChilia added the good first issue Good for newcomers label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers P0 Action not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants