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

Postgres rpm url returns 404 #142

Open
kcondon opened this issue Jan 15, 2020 · 5 comments
Open

Postgres rpm url returns 404 #142

kcondon opened this issue Jan 15, 2020 · 5 comments

Comments

@kcondon
Copy link
Contributor

kcondon commented Jan 15, 2020

Installing on Amazon 2 Linux instance

Ansible script fails at this point with 404:

https://download.postgresql.org/pub/repos/yum/reporpms/EL-2-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Output from Ansible script:

TASK [dataverse : restart httpd on RedHat / CentOS 7.] **********************************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [dataverse : install postgres repo RPM] ********************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failure downloading https://download.postgresql.org/pub/repos/yum/reporpms/EL-2-x86_64/pgdg-redhat-repo-latest.noarch.rpm, HTTP Error 404: Not Found"}

PLAY RECAP ******************************************************************************************
localhost : ok=26 changed=12 unreachable=0 failed=1 skipped=50 rescued=0 ignored=0

We believe this is the section that is failing and perhaps the Amazon 2 Linux version is confusing the variable in the script to be 2 rather than 7:

cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

@kcondon
Copy link
Contributor Author

kcondon commented Jan 15, 2020

as a workaround, we edited postgres.yaml to use 7 hard-coded. After rerunning ansible it hit another snag and would you like your opinion on Amazon 2 Linux support:

TASK [dataverse : restart httpd on RedHat / CentOS 7.] ***********************************************
skipping: [localhost] => {"changed": false, "skip_reason": "Conditional result was False"}

TASK [dataverse : install postgres repo RPM] *********************************************************
fatal: [localhost]: FAILED! => {"changed": false, "changes": {"installed": ["/root/.ansible/tmp/ansible-tmp-1579126243.82-234325683114549/pgdg-redhat-repo-latest.noarchH5g23E.rpm"]}, "msg": "Error: Package: pgdg-redhat-repo-42.0-5.noarch (/pgdg-redhat-repo-latest.noarchH5g23E)\n Requires: /etc/redhat-release\n", "rc": 1, "results": ["Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\nExamining /root/.ansible/tmp/ansible-tmp-1579126243.82-234325683114549/pgdg-redhat-repo-latest.noarchH5g23E.rpm: pgdg-redhat-repo-42.0-5.noarch\nMarking /root/.ansible/tmp/ansible-tmp-1579126243.82-234325683114549/pgdg-redhat-repo-latest.noarchH5g23E.rpm to be installed\nResolving Dependencies\n--> Running transaction check\n---> Package pgdg-redhat-repo.noarch 0:42.0-5 will be installed\n--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-5.noarch\n203 packages excluded due to repository priority protections\n--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-5.noarch\n--> Finished Dependency Resolution\n You could try using --skip-broken to work around the problem\n You could try running: rpm -Va --nofiles --nodigest\n"]}

PLAY RECAP *******************************************************************************************
localhost : ok=26 changed=3 unreachable=0 failed=1 skipped=50 rescued=0 ignored=0

@donsizemore
Copy link
Contributor

so Amazon Linux identifies as RHEL/CentOS but advertises a different major version. lovely.

I can just make the RPM a group_var and we can find an appropriate repo RPM for Amazon Linux, though they seem to offer amazon-linux-extras:

sudo amazon-linux-extras install postgresql10

@donsizemore
Copy link
Contributor

my official response, for the time being: Amazon Linux, while based on RHEL/CentOS, is not-yet-supported (though I could make it so).

Our current AWS testing (via ec2-create) uses ami-9887c6e7 aka https://aws.amazon.com/marketplace/pp/Centosorg-CentOS-7-x8664-with-Updates-HVM/B00O7WM7QW

This morning I've run into dependency issues by way of AWS' default RHEL8 subscription not allowing the enabling of the rhel-8-optional-rpms repo needed to install R the "proper" way, but CentOS 8.1 dropped yesterday so according to Karanbir we should expect the official CentOS8 AMI Real Soon Now: https://bugs.centos.org/view.php?id=16614

Amazon Linux support can and probably should happen, though I need to dig my way out of some other projects first.

@kcondon
Copy link
Contributor Author

kcondon commented Jan 16, 2020

@donsizemore I understand and thanks for looking into it. We normally use a CentOS image but local OPs suggested trying Amazon AMI and I then noticed Amazon 2 is the recommended version.

@donsizemore
Copy link
Contributor

@kcondon once I get time I can throw in some switches for Amazon 2... ansible_distribution_major_version = ansible_distribution_major_version + 6 if nothing else ;)

pallinger pushed a commit to dsd-sztaki-hu/dataverse-ansible-deprecated that referenced this issue Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants