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

Installing plugin exits due to yum unavailability #2561

Closed
aweeraman opened this issue Jul 6, 2021 · 8 comments
Closed

Installing plugin exits due to yum unavailability #2561

aweeraman opened this issue Jul 6, 2021 · 8 comments
Labels
type/bug Issues that are bugs.

Comments

@aweeraman
Copy link

Attempting to install session manager plugin exits due to unavailability of yum on a Debian system.

$ copilot svc exec --name service --env dev -c /bin/sh
Looks like the Session Manager plugin is not installed yet.
Would you like to install the plugin to execute into the container? Yes
[sudo] password for foo:
sudo: yum: command not found
✘ install ssm plugin: exit status 1

It would be good if copilot could use the apt-get equivalent, or give a helpful message that the plugin cannot be installed if the Debian-based distributions are not supported.

@danelige
Copy link

danelige commented Dec 6, 2022

+1 is there a fix?

AWS Fargate.

when running

copilot svc exec --name xxx --env xxx -c /bin/sh

getting:


sudo: yum: command not found
install ssm plugin: exit status 1

@iamhopaul123
Copy link
Contributor

Hello @danelige. It seems like session manager plugin(prerequisite plugin for running ecs exec) only supports ubuntu for Debian-based distribution. What happen if you run uname -a?

@kangere
Copy link
Contributor

kangere commented Sep 13, 2023

I am using Pop OS which is an ubuntu based distro and I am getting the same error described in this issue.

The command uname -a produces the output below

Linux pop-os 6.4.6-76060406-generic #202307241739~1692717645~22.04~5597803 SMP PREEMPT_DYNAMIC Tue A x86_64 x86_64 x86_64 GNU/Linux

@kangere
Copy link
Contributor

kangere commented Sep 13, 2023

It seems there is an explicit check for the string Ubuntu when the copilot is trying to determine if the linux distribution is ubuntu based here .

Is there a better way of doing this for Ubuntu based distributions that don't have the string Ubuntu in the output of the uname -a command

@Lou1415926
Copy link
Contributor

@kangere good find! I wonder what your output is for lsb_release -a? I'm trying to see if this could solve the issue for you.

@kangere
Copy link
Contributor

kangere commented Sep 14, 2023

This is my output for lsb_release -a

Pop

The output for cat /etc/os-release below seems to be more ideal since it has a reference to Ubuntu

NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 22.04 LTS"
VERSION_ID="22.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=jammy
UBUNTU_CODENAME=jammy
LOGO=distributor-logo-pop-os

the /etc/os-release files seems to be what is also used in places like the docker installation scripts, see get_distribution function here. You could probably read that file to determine if the linux distro is ubuntu based. I'd be willing to make a PR with this fix.

Let me know what you think

@Lou1415926
Copy link
Contributor

Thank you @kangere for looking this up! This looks promising - seems like all systems using systemd would have this file. From the docker installation scripts:

get_distribution() {
	lsb_dist=""
	# Every system that we officially support has /etc/os-release
	if [ -r /etc/os-release ]; then
		lsb_dist="$(. /etc/os-release && echo "$ID")"
	fi
	# Returning an empty string here should be alright since the
	# case statements don't act unless you provide an actual value
	echo "$lsb_dist"
}

Reading the os-release doc, it seems like there are two fields we can read to tell if the distro is ubuntu or ubuntu-based:

ID=
  A lower-case string (no spaces or other characters outside of 0–9, a–z, ".", "_" and "-") identifying the operating system, excluding any version information and suitable for processing by scripts or usage in generated filenames. If not set, a default of "ID=linux" may be used. Note that even though this string may not include characters that require shell quoting, quoting may nevertheless be used.

  Examples: "ID=fedora", "ID=debian".

ID_LIKE=
  A space-separated list of operating system identifiers in the same syntax as the ID= setting. It should list identifiers of operating systems that are closely related to the local operating system in regards to packaging and programming interfaces, for example listing one or more OS identifiers the local OS is a derivative from. An OS should generally only list other OS identifiers it itself is a derivative of, and not any OSes that are derived from it, though symmetric relationships are possible. Build scripts and similar should check this variable if they need to identify the local operating system and the value of ID= is not recognized. Operating systems should be listed in order of how closely the local operating system relates to the listed ones, starting with the closest. This field is optional.

  Examples: for an operating system with "ID=centos", an assignment of "ID_LIKE="rhel fedora"" would be appropriate. For an operating system with "ID=ubuntu", an assignment of "ID_LIKE=debian" is appropriate.

I'd be willing to make a PR with this fix.

Thank you very much! That'd be a huge help - we'd be very happy to see your PR ❤️ !

mergify bot pushed a commit that referenced this issue Dec 19, 2023
related #2561


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
@iamhopaul123
Copy link
Contributor

Hello this is now fixed in https://github.com/aws/copilot-cli/releases/tag/v1.33.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issues that are bugs.
Projects
None yet
Development

No branches or pull requests

6 participants