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

ubuntu22/20240107.1 produces bad error for sudo path/to/nonexistent #9146

Closed
2 of 11 tasks
jrose-signal opened this issue Jan 10, 2024 · 7 comments
Closed
2 of 11 tasks

Comments

@jrose-signal
Copy link

jrose-signal commented Jan 10, 2024

Description

One of our private CI bots has a step

    - name: Install NDK
      run: sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;${NDK_VERSION}"

that runs on ubuntu-latest. Within the last week, jobs have started failing with

sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

In checking the jobs that succeeded vs the jobs that failed, the ones that failed are on 20240107.1.0, while the ones that passed were still using the December tag. I eventually realized this is related to the Android tools pruning, but the error message did not make that clear at all.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

20240107.1.0

Is it regression?

Unknown

Expected behavior

A reasonable error message from passwordless sudo, as documented at https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#administrative-privileges

Actual behavior

sudo: a password is required

Repro steps

Run a nonexistent command with sudo, no default shell specified, on ubuntu22/20240107.1.

@jrose-signal jrose-signal changed the title ubuntu22/20240107.1 broke passwordless sudo ubuntu22/20240107.1 broke passwordless sudo in some cases Jan 10, 2024
@jrose-signal

This comment was marked as resolved.

@jrose-signal

This comment was marked as resolved.

@jrose-signal jrose-signal changed the title ubuntu22/20240107.1 broke passwordless sudo in some cases ubuntu22/20240107.1 produces bad error for sudo path/to/nonexistent Jan 10, 2024
@mikepenz
Copy link

We are seeing the same problem. With a very similar step:

echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "build-tools;32.0.0" --sdk_root=${ANDROID_SDK_ROOT}

It worked still with Version: 20231217.2.0 but is now broken with the latest version 20240107.1 of the Ubuntu GitHub actions runner.

@jrose-signal
Copy link
Author

(by the way, we fixed our sdkmanager invocation to ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager, which should work across several versions)

@Alexey-Ayupov
Copy link
Collaborator

Hello @jrose-signal, according to the PR #9094, the obsolete package sdk tools no longer available.
The proper sdkmanager, indeed, located in ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager or full path /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager.

Do you still have an issue with the password prompt?

@mikepenz
Copy link

@Alexey-Ayupov I believe we are seeing the same issue with the latest version however we already use the full path. The exact same code was working in the prior version:

Run echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "build-tools;34.0.0" --sdk_root=${ANDROID_SDK_ROOT}
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

In case you believe it is a different problem, I am more than happy to create a separate issue for it. Thank you.

@mikhailkoliada
Copy link
Member

I believe two different issues are being mixed-up here, lets sort it! :)

  1. /usr/local/lib/android/sdk/tools/bin/sdkmanager path does not exist in runners anymore, that path existed for components that were installed before, but they are now all obsolete and removed as @Alexey-Ayupov rightly mentioned.
  2. sudo path/to/nonexistent bug is known by sudo upstream and described here, as said, it was fixed in sudo 1.9.11 and newer while canonical provides only 1.9.9 in 22.04, so there is nothing we can do to make it not happen in the moment, though the one unlikely will find calling sudo with non-existing path useful.

If there are more questions feel free to reach us out again.

wangela added a commit to googlemaps-samples/android-places-demos that referenced this issue Jan 17, 2024
GitHub Actions runner image moved SDK manager per actions/runner-images#8952. Migrate to new location of SDK manager per path listed at actions/runner-images#9146 (comment)
wangela added a commit to googlemaps-samples/android-places-demos that referenced this issue Jan 18, 2024
* docs: update places install snippet

Don't use a variable in the kotlin bom dependency.

* chore: Update build.yml

GitHub Actions runner image moved SDK manager per actions/runner-images#8952. Migrate to new location of SDK manager per path listed at actions/runner-images#9146 (comment)
hpoul added a commit to authpass/authpass that referenced this issue Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@mikepenz @jrose-signal @mikhailkoliada @Alexey-Ayupov and others