aws-codedeploy-agent: Installation broken on Ubuntu 20.04

Following the official guide to installing fails on Ubuntu 20.04 with the following error: Traceback (most recent call last): 8: from /tmp/codedeploy-agent-install:33:in <main>' 7: from /tmp/codedeploy-agent-install:33:in new’ 6: from /usr/lib/ruby/2.7.0/logger.rb:389:in initialize' 5: from /usr/lib/ruby/2.7.0/logger.rb:389:in new’ 4: from /usr/lib/ruby/2.7.0/logger/log_device.rb:18:in initialize' 3: from /usr/lib/ruby/2.7.0/logger/log_device.rb:83:in set_dev’ 2: from /tmp/codedeploy-agent-install:21:in method_missing' 1: from /tmp/codedeploy-agent-install:21:in map’ /tmp/codedeploy-agent-install:22:in block in method_missing': undefined method path’ for #<IO:<STDOUT>> (NoMethodError)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 24 (4 by maintainers)

Most upvoted comments

worked for me: repack .deb package and add ruby 2.7 as compatible instead of outdated 2.0:

apt-get update
apt-get install -y ruby
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/releases/codedeploy-agent_1.0-1.1597_all.deb
mkdir codedeploy-agent_1.0-1.1597_ubuntu20
dpkg-deb -R codedeploy-agent_1.0-1.1597_all.deb codedeploy-agent_1.0-1.1597_ubuntu20
sed 's/2.0/2.7/' -i ./codedeploy-agent_1.0-1.1597_ubuntu20/DEBIAN/control
dpkg-deb -b codedeploy-agent_1.0-1.1597_ubuntu20
dpkg -i codedeploy-agent_1.0-1.1597_ubuntu20.deb
systemctl start codedeploy-agent
systemctl enable codedeploy-agent

tnx to @takenoko-str for this AWS CodeDeploy Agent install script (Ubuntu 18 LTS)

Not to sound rude but the last release is from late 2018, there where just a hand full of commits since then, the most recent Ubuntu version you support is 16.04, and angry people are pilling up in the GitHub issues because from an outside perspective this project is totally dead…

Not even your own PAID support could give me some informations on this and just gave the hint to just restart the agent every time to “resolve” the memory leak which is present since nearly 4 or 5 years now. And the only information we get from you since February is “we are working on a new release process”. As a customer this is totally frustrating that a multi billion dollar company with some of the best software devs in the world is not able to maintain a little Ruby tool on which thousands of paying customers depend on in their day-to-day business.

can you give us at least a rough estimates on when the “new release process” will be finished? 16.04 will be EOL in 2024, so please don’t take THAT long…

CodeDeploy Agent does not support Ubuntu 20.x so far. Check our documentation. The support is in our plan

Okay, know you got me curious because after migrating a lot of customers to Ubuntu Focal I was really confused by the amount of people who still have bugs with this so I started digging 😄

We setup all our servers with a standardized AMI which we build with Packer and Chef. One of the cookbooks is responsible for installing the latest CodeDeploy agent and this cookbook just runs fine with the latest version and we have the latest Codedeploy Agent installed afterwards.

Now the funny part: When I start the exact same base AMI by hand and try to execute the installer I get the error from the first post… 😕 Thinking about this for a while what the differences could be, I read the error message again and stumbled upon the io:STDOUT part of the errormessage. And yes, thats the only difference: Chef runs its cookbooks non-interactively, so there is no real stdout present. Therefore the easiest way to fix the installer is to redirect its output into a file, and yes this fixed the problem 🎉

Screenshot_2020-09-25_16:00:25

tl,dr: Yes this bug should still be open, but can be circumvented with an easy workaround 😃

thanks @fleaz

$ sudo ./install auto > /tmp/logfile - worked for me

@sapphirecat, CodeDeploy is not deprecated. We are actively working on changing our release process for the Agent. The fix will be released as soon as we switch to a new release process

Hi Folks. 👋

I’m the new SDM for the CodeDeploy teams at AWS and I wanted to chime in here briefly.

While we don’t have any public dates we can share at the moment, we are concurrently working on several successive and very near-term releases to the CodeDeploy agent. These releases will include a litany fixes and features that many members of the community have been asking for including a resolution to this issue of Ubuntu support.

Part of the delay at the moment is that we’re putting in place a better set of release and update mechanisms (as Alena mentioned). This upfront investment will pave the way for both faster and safer iterations with the agent – allowing us to release our work as well as community contributions much quicker and more frequently.

We’re also working on a plan to share a public version of the CodeDeploy roadmap with you so that our customer community can have better insight into our vision for the CodeDeploy agent and the timelines around it.

We appreciate your patience while we get all this work completed, but rest assured a lot is happening even though it isn’t all visible to you yet.

Is there a time frame where this is expected to be resolved, or should I consider CodeDeploy to be deprecated/abandoned?

@AnandarajuCS @brblck I just encountered this while setting up the install script.

Instance: Ubuntu 20.04

Ruby info:

$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

Download info: wget https://aws-codedeploy-ca-central-1.s3.ca-central-1.amazonaws.com/latest/install

Result:

$ sudo ./install auto
Traceback (most recent call last):
        8: from ./install:34:in `<main>'
        7: from ./install:34:in `new'
        6: from /usr/lib/ruby/2.7.0/logger.rb:389:in `initialize'
        5: from /usr/lib/ruby/2.7.0/logger.rb:389:in `new'
        4: from /usr/lib/ruby/2.7.0/logger/log_device.rb:18:in `initialize'
        3: from /usr/lib/ruby/2.7.0/logger/log_device.rb:83:in `set_dev'
        2: from ./install:22:in `method_missing'
        1: from ./install:22:in `map'
./install:23:in `block in method_missing': undefined method `path' for #<IO:<STDOUT>> (NoMethodError)

Going with the fix by @osterik for now

A possible workaround:

  • A compatible ruby version could be installed using snap - snap install ruby --channel=2.5/stable --classic and then proceed to install using the manual instructions in the README
  • This might mess up things if you are using any other package / code that rely on system ruby
  • Gist with all the steps needed to run codedeploy agent as a systemd service https://gist.github.com/lifeeth/557722cd62eb41010807ad1a2ce6ba41

@fleaz this worked for me. Thank you!

@AnandarajuCS @brblck I just encountered this while setting up the install script.

Instance: Ubuntu 20.04

Ruby info:

$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

Download info: wget https://aws-codedeploy-ca-central-1.s3.ca-central-1.amazonaws.com/latest/install

Result:

$ sudo ./install auto
Traceback (most recent call last):
        8: from ./install:34:in `<main>'
        7: from ./install:34:in `new'
        6: from /usr/lib/ruby/2.7.0/logger.rb:389:in `initialize'
        5: from /usr/lib/ruby/2.7.0/logger.rb:389:in `new'
        4: from /usr/lib/ruby/2.7.0/logger/log_device.rb:18:in `initialize'
        3: from /usr/lib/ruby/2.7.0/logger/log_device.rb:83:in `set_dev'
        2: from ./install:22:in `method_missing'
        1: from ./install:22:in `map'
./install:23:in `block in method_missing': undefined method `path' for #<IO:<STDOUT>> (NoMethodError)

Going with the fix by @osterik for now

Same here… just experienced this too.