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

sensu module failing on amazon linux as it is pointing to a incorrect yum repo http url which doesn't exist #821

Closed
htallur opened this issue Oct 2, 2017 · 16 comments · Fixed by #833
Assignees

Comments

@htallur
Copy link

htallur commented Oct 2, 2017

Description of problem

failure: repodata/repomd.xml from sensu: [Errno 256] No more mirrors to try.

https://sensu.global.ssl.fastly.net/yum/latest/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

#- What did you do?

  • try to install sensu agent on amazon linux using puppet run.

#- What happened?

#- What did you expect to happen?

  • expected sensu module to install the required packages on amazon linux as it is based on RHEL.

#- How can someone reproduce the problem?

  • it can be reproduced by trying installing sensu software using the repo provided by sensu on amazon linux

Command used and debugging output

  • What does your puppet config look like (including any hiera config)

- Is this a masterless or master based puppet setup?

  • master based puppet setup

Platform and version information

  • Your OS:
    NAME="Amazon Linux AMI"
    VERSION="2017.03"
    ID="amzn"
    ID_LIKE="rhel fedora"
    VERSION_ID="2017.03"
  • Your Ruby version:
  • Your version of Puppet:
    4.10.5
  • Your version of Sensu:
    1.0.2
  • Your version of this module:
    2.35.0

Anything else to add that you think will be helpful?

failure: repodata/repomd.xml from sensu: [Errno 256] No more mirrors to try.
https://sensu.global.ssl.fastly.net/yum/latest/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

yum repolist

Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main | 2.1 kB 00:00:00
amzn-updates | 2.3 kB 00:00:00
epel/x86_64/metalink | 12 kB 00:00:00
https://sensu.global.ssl.fastly.net/yum/latest/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.

https://sensu.global.ssl.fastly.net/yum/latest/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
repo id repo name status
amzn-main/latest amzn-main-Base 5,668
amzn-updates/latest amzn-updates-Base 1,616
epel/x86_64 Extra Packages for Enterprise Linux 6 - x86_64 12,407

@ghoneycutt
Copy link
Collaborator

Thanks for the great bug report! Looking into adding support for Amazon Linux.

@ghoneycutt
Copy link
Collaborator

enhancement tag added so that we officially support Amazon Linux 2017.

@alvagante
Copy link
Collaborator

@ghoneycutt I can fix this one if nobody else is working on it

@ghoneycutt
Copy link
Collaborator

@alvagante Thank you!

@alvagante
Copy link
Collaborator

@htallur so here we have the usual dilemma of figuring our what base Rhel version to use for packages on amazon ami , in this case for sensu. I would try with the 7 one, and change in /etc/yum.repos.d/the string $releasever with just 7. If then installation works well for you, I can puppettize it.
Will test this on aws anyway, but maybe you've quicker feedbacks.

@htallur
Copy link
Author

htallur commented Oct 24, 2017

if I replace $releasever with 7, sensu repo works but not default amazon repo's.


yum repolist

Loaded plugins: priorities, update-motd, upgrade-helper
Could not retrieve mirrorlist http://repo.us-west-2.amazonaws.com/7/main/mirror.list error was
14: HTTP Error 403 - Forbidden
Could not retrieve mirrorlist http://repo.us-west-2.amazonaws.com/7/updates/mirror.list error was
14: HTTP Error 403 - Forbidden
epel/x86_64/metalink | 16 kB 00:00:00
epel/x86_64 | 4.3 kB 00:00:00
epel/x86_64/group_gz | 150 kB 00:00:00
epel/x86_64/updateinfo | 760 kB 00:00:00
epel/x86_64/primary_db | 5.9 MB 00:00:00
jenkins | 2.9 kB 00:00:00
jenkins/primary_db | 22 kB 00:00:00
sensu/7/x86_64 | 2.5 kB 00:00:00
sensu/7/x86_64/primary_db | 68 kB 00:00:00
repo id repo name status
amzn-main/7 amzn-main-Base 0
amzn-updates/7 amzn-updates-Base 0
epel/x86_64 Extra Packages for Enterprise Linux 6 - x86_64 12,407
jenkins Jenkins-stable 67
sensu/7/x86_64 sensu 91
repolist: 12,565

@alvagante
Copy link
Collaborator

alvagante commented Oct 24, 2017

@htallur I intended to place the 7 ONLY on the sensu yum repo file, the others should remain as is

@alvagante
Copy link
Collaborator

@htallur and then if you have problems with version 7, try to change it to 6.
Point is what dependencies the sensu packages have and if they can coexists with the versions of software installed on amazon os.
If both 6 and 7 don't allow youto install working packages, then I suppose the problem has to be raised to Sensu packagers.

@htallur
Copy link
Author

htallur commented Oct 24, 2017

gotcha, I have now changed the value of $releasever to 7 in senu repourl
and it worked, baseurl=https://sensu.global.ssl.fastly.net/yum/7/$basearch/.

I guess you can go ahead and puppetize the update, as puppet is reverting the change to $releasever.

alvagante added a commit to alvagante/sensu-puppet that referenced this issue Oct 24, 2017
@alvagante
Copy link
Collaborator

Hei @htallur please verify if the linked fix actually does the expected job.
We might want to add correct data for other, older, Amazon Linux versions, but this should be ok for current ones.

Will add tests, and make a PR in the next days.

@htallur
Copy link
Author

htallur commented Oct 24, 2017

its able to download the required packages, but puppet run failed at a later stage of restarting sensu-client

Error: Could not start Service[sensu-client]: Execution of '/sbin/service sensu-client start' returned 1: sensu-client: unrecognized service
Error: /Stage[main]/Sensu::Client::Service/Service[sensu-client]/ensure: change from stopped to running failed: Could not start Service[sensu-client]: Execution of '/sbin/service sensu-client start' returned 1: sensu-client: unrecognized service

@alvagante
Copy link
Collaborator

@htallur did the sensu service start when you manually edited, before this patch, the sensu yum repo file and installed the package? If so, what was the sensu service name you used (sensu-client?)?

@ghoneycutt
Copy link
Collaborator

@alvagante You could use this virtualbox to test Amazon Linux 2017.03

https://app.vagrantup.com/mvbcoding/boxes/awslinux

Or could use the aws provider plugin and have our Vagrant actually talk to AWS.

https://github.com/mitchellh/vagrant-aws

@htallur
Copy link
Author

htallur commented Oct 25, 2017

@alvagante sensu packages were not even installed before the patch.

@alvagante
Copy link
Collaborator

@htallur so I've tested on the vangrant box suggested by @ghoneycutt and actually we need packages for Rhel version 6. This PR #833 has the correct fix, package is installed and service is started.
Amazon is systemd free and packages for RHEL 7 rely on systemd.

alvagante added a commit to alvagante/sensu-puppet that referenced this issue Oct 25, 2017
Use repository for rhel 6 on Amazon linux
alvagante added a commit to alvagante/sensu-puppet that referenced this issue Oct 25, 2017
Use repository for rhel 6 on Amazon linux
Experimental retrospec generated tests for sensu::repo classes
Refactored tests for sensu::repo::yum
alvagante added a commit to alvagante/sensu-puppet that referenced this issue Oct 25, 2017
Use repository for rhel 6 on Amazon linux
Experimental retrospec generated tests for sensu::repo classes
Refactored tests for sensu::repo::yum
Moves sensu::repo::yum test file
alvagante added a commit to alvagante/sensu-puppet that referenced this issue Oct 26, 2017
Use repository for rhel 6 on Amazon linux
Experimental retrospec generated tests for sensu::repo classes
Refactored tests for sensu::repo::yum
Moves sensu::repo::yum test file
Added vagrant vm for amazon linux 201703
ghoneycutt added a commit that referenced this issue Oct 26, 2017
Manage sensu on amazon Linux #821
@ghoneycutt
Copy link
Collaborator

Thanks for all the hard work @htallur and @alvagante

Released in v2.38.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants