-
Notifications
You must be signed in to change notification settings - Fork 619
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
Cannot launch tasks on Ubuntu 22.04 #3227
Comments
It is worth noting that direct access to /run/systemd/private happens only if the dbus daemon cannot be contacted: // NewWithContext establishes a connection to any available bus and authenticates.
|
The problem was apparmor on this system blocking the call to DBUS.
Log:
Adding --security-opt apparmor:unconfined to the docker run resolved this issue. However this is not the default when it is being installed from https://amazon-ecs-agent.s3.amazonaws.com/ecs-anywhere-install-latest.sh Perhaps this issue should be moved to https://github.com/aws/amazon-ecs-init ? Working command:
|
Thanks for reporting! Currently Ubuntu22 is not an officially supported platform. ref This is tracked internally and will post there about the updates |
I ran into the same issue and fixed it by adding a custom apparmor profile that allows access to dbus as such:
Then ran |
After talking to Canonical support about this, just to get everything straight in my head I believe the issue is: Ubuntu 22 now used cgroupv2 which is a change, so
calls
a function that attempts to call if that fails it will try to use the Ubuntu 22 allows the docker-default apparmor profile to contact dbus, but not call ecs-init doesn't currently mount in the If you have the ability to tweak the apparmor profile then the above post may work for now, we are on ubuntu core 22 without that ability and have already had to patch ecs-init to make start, so will probably have to add in the extra container mount point to our local patch |
Thanks for the additional detail. I recommend you either run the agent with --security-opt apparmor:unconfined or load a new apparmor profile for Docker that allows the dbus call. Running the agent with unconfined should not increase risk as it already has broad permissions and host networking. If you want to use a modified profile, the one posted by @shanet is good. If you want to double check start with the Docker default profile https://github.com/moby/moby/tree/master/profiles/apparmor and add the extra dbus directive. You can scope it a bit more tightly:
Write this file into /etc/apparmor.d/docker-default You can install docker and then overwrite the default profile with this command:
Alternatively if you are modifying ecs-init you can run just the agent with the modified profile or unconfined.
|
Thanks @sunds and @shanet very much for bringing up this issue and sharing workaround with us. I am able to reproduce the issue, and use the custom AppArmor profile as a workaround. Repro setup
As Ubuntu 22.04 is not officially support by ECS Anywhere, and workarounds are available, this issue will be closed. Please feel free to open new issues and track the latest supported operating systems and system architectures via the public documentation. Thanks. |
It needs some additional permissions to work with ECS Anywhere on Ubuntu 22. Upstream issue: aws/amazon-ecs-agent#3227
It needs some additional permissions to work with ECS Anywhere on Ubuntu 22. Upstream issue: aws/amazon-ecs-agent#3227
It needs some additional permissions to work with ECS Anywhere on Ubuntu 22. Upstream issue: aws/amazon-ecs-agent#3227
Hi everyone, this is now supported in agent/init version 1.80.0: https://github.com/aws/amazon-ecs-agent/releases. Support was added via this PR: #4062 Working on updating the docs now. |
Summary
OS: Ubuntu 22.04 (LTS)
ECS agent version="1.61.1" commit="8dc9fdeb"
Containers will not start.
Description
err=cgroupv2 create: unable to create v2 manager: dial unix /run/systemd/private: connect: no such file or directory
The problem is ECS agent runs in docker and /run/systemd/private is not mounted into the container. Editing the container config to add that bind mount worked around the problem.
Expected Behavior
Container runs
Observed Behavior
Launch fails due to missing bind mount
Environment Details
curl http://localhost:51678/v1/metadata
{"Cluster":"dsunds-test-1","ContainerInstanceArn":"arn:aws:ecs:us-east-1:585275055393:container-instance/dsunds-test-1/17da2f096e234930a8ea495d5cb6b575","Version":"Amazon ECS Agent - v1.61.1 (8dc9fde)"}
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
Deployed onto bare metal server
Supporting Log Snippets
Error from ECS agent log:
cgroup: unable to create cgroup taskARN=arn:aws:ecs:us-east-1:585275055393:task/dsunds-test-1/383621ce97f643749b2c06061d345884 cgroupPath=ecstasks-383621ce97f643749b2c06061d345884.slice cgroupV2=true err=cgroupv2 create: unable to create v2 manager: dial unix /run/systemd/private: connect: no such file or directory"
The relevant part being that last error. Digging into the source it is trying to make a connection to the private DBUS socket
The text was updated successfully, but these errors were encountered: