Curl 22 the requested url returned error 404 not found

I did this $ curl -D - -o - google.com/asdfhjashdf curl: (22) The requested URL returned error: 404 Not Found I expected the following HTTP/1.1 404 Not Found Date: Mon, 22 Feb 2016 00:41:31 GMT Con...

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


Closed

dhowden opened this issue

Feb 22, 2016

· 2 comments

Comments

@dhowden

I did this

$ curl -D - -o - google.com/asdfhjashdf
curl: (22) The requested URL returned error: 404 Not Found

I expected the following

HTTP/1.1 404 Not Found
Date: Mon, 22 Feb 2016 00:41:31 GMT
Content-Type: text/html
Server: HTTP server (unknown)
Content-Length: 49
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

<html><body><h1>404 Not Found</h1></body></html>

curl/libcurl version

curl 7.46.0 (x86_64-apple-darwin15.0.0) libcurl/7.46.0 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets

operating system

OS X, El Capitan (10.11.3).

@jay

@dhowden

Perfect, found it! Thanks.

@lock
lock
bot

locked as resolved and limited conversation to collaborators

May 7, 2018

2 participants

@dhowden

@jay

Обновлено Обновлено: 20.06.2020
Опубликовано Опубликовано: 13.11.2016

Описание

При попытке выполнить команды yum update или yum install в CentOS консоль выдает ошибку [Errno 14] PYCURL ERROR 22 — «The requested URL returned error: 404»

Причина

Пути в кэше одного из репозирориев устарели и ведут на страницы, которых больше не существует (об этом говорит строка «The requested URL returned error: 404»).

Это могло произойти по причине использования Linux, который долгое время не обновлялся.

Решение

1. Просто очистите кэш следующей командой:

yum clean all

и выполните команду по обновлению:

yum update

2. Если этого окажется недостаточно, смотрим список подключенных репозиториев:

yum repolist -v

… и отключаем их по одному.

Например, для отключения репозитория epel:

Repo-id            : epel

Repo-filename      : /etc/yum.repos.d/epel.repo

… открываем файл:

vi /etc/yum.repos.d/epel.repo

Находим опцию enabled и меняем ей значение на 0:


enabled=0

После отключения каждого из репозиториев пробуем команду:

yum update

В чем была проблема?

Если вам удалось решить проблему, поделитесь своим опытом для других. Что помогло:

* в процентах показаны результаты ответов других посетителей.

Дмитрий Моск — частный мастер

Помогла ли вам эта статья?

Да            Нет

Calling curl without parameters, i get the page output, even with an http status code = 404:

$ curl http://www.google.com/linux;
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/errors/logo_sm_2.png) no-repeat}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/errors/logo_sm_2_hr.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/errors/logo_sm_2_hr.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/errors/logo_sm_2_hr.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:55px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/linux</code> was not found on this server.  <ins>That’s all we know.</ins>

$ echo $?;
0

The status code is 0.

Calling it with —fail will not show the output:

$ curl --fail http://www.google.com/linux;
curl: (22) The requested URL returned error: 404 Not Found

$ echo $?;
22

The status code is 22 now …

Id’ like to get the output even when http status = 404, 500 (like the first curl execution) and, at the same time, get a different system error (like in the second curl execution, $? = 22).
Is it possible with curl? If not, how could I achieve this with another tool (this tool must accept file uploads e post data! wget doesn’t seems to be an alternative …)

Thanks.

asked Mar 19, 2014 at 12:35

Thom Thom Thom's user avatar

Thom Thom ThomThom Thom Thom

1,2191 gold badge11 silver badges21 bronze badges

First of all the maximum value for the error code(or exit code) is 255. Here is the reference.

Also, the --fail will not allow you to do what you are looking for. However, you can use alternate ways(writing a shell script) to handle the scenario, but not sure it will be effective or not for you!

http_code=$(curl -s -o out.html -w '%{http_code}'  http://www.google.com/linux;)

if [[ $http_code -eq 200 ]]; then
    exit 0
fi

## decide which status you want to return for 404 or 500
exit  204

Now do the $? and you’ll get the exit code from there.

You’ll find the response html inside the out.html file.

You can also pass the url to the script as commandline argument. Check here.

answered Mar 19, 2014 at 14:18

Sabuj Hassan's user avatar

Sabuj HassanSabuj Hassan

37.7k12 gold badges75 silver badges85 bronze badges

0

This is now possible with curl. Since version 7.76.0 you can do

curl --fail-with-body ...

Which does exactly what OP asked: shows the document body and exits with code 22.

See https://curl.se/docs/manpage.html#—fail-with-body

answered Dec 3, 2021 at 1:47

ppar's user avatar

Unfortunately not possible with curl. But you can do this with wget.

$ wget --content-on-error -qO- http://httpbin.org/status/418

    -=[ teapot ]=-

       _...._
     .'  _ _ `.
    | ."` ^ `". _,
    _;`"---"`|//
      |       ;/
      _     _/
        `"""`
$ echo $?
8

answered May 18, 2017 at 21:41

Subhas's user avatar

SubhasSubhas

14.2k1 gold badge28 silver badges37 bronze badges

1

I found a solution because wget was not suitable for sending multipart/form-data

curl -o - -w "n%{http_code}n" http://httpbin.org/status/418 | tee >(tail -n 1 | cmp <(echo 2xx) - ) | tee >(grep "char 2"; echo $? > status-code) && grep 0 status-code

Explanation

-o - -w "n%{http_code}n" — prints out to stdout (actually it’s piped to the next command) with status code at the end
tee — output will be piped to next command and additionally printed to stdout
tail -n 1 — extract status code from the last line
cmp <(echo 2xx) - compare status code, first char only
grep "char 2" — if first character needs to be 2, otherwise fail

In a shell script you can also do better comparison (currently it only allows 2xx, so redirect like 300 are are handled as an error with cmp how it is used above)

answered Mar 19, 2018 at 16:08

timaschew's user avatar

timaschewtimaschew

16k5 gold badges59 silver badges78 bronze badges

6

Thanks @timaschew, here is my enhanced version based on pure awk:

curl_fail_with_body() {
  curl -o - -w "n%{http_code}n" "$@" | awk '{l[NR] = $0} END {for (i=1; i<=NR-1; i++) print l[i]}; END{ if ($0<200||$0>299) exit $0 }'
}

# example usage
curl_fail_with_body -sS http://httpbin.org/status/418

Explanation

  • -o - -w "n%{http_code}n" — prints out to stdout (actually it’s piped to the next command) with status code at the end
  • {l[NR] = $0} END {for (i=1; i<=NR-1; i++) print l[i]} — print all the lines except the last one
  • END{ if ($0<200||$0>299) exit $0 } — will exit with non zero code if the last line != 2xx

alternative version, if you want to output the error code after command:
END{ if ($0<200||$0>299) {print "The requested URL returned error: " $0; exit 1}


BTW, curl supports --fail-with-body option since v7.76.0.
This option allows you to achieve the desired behavior without using external tools.

answered Apr 22, 2021 at 16:09

kvaps's user avatar

kvapskvaps

2,3091 gold badge20 silver badges20 bronze badges

1

Here was my solution — it uses jq and assumes the body is json

#  this code adds a statusCode field to the json it receives and then jq squeezes them together
# curl 7.76.0 will have curl --fail-with-body and thus eliminate all this
  local result
  result=$(
    curl -sL -w ' { "statusCode": %{http_code}} ' -X POST "${headers[@]}" "${endpoint}" 
      -d "${body}"  "$curl_opts" | jq -ren '[inputs] | add'
  )
#   always output the result
  echo "${result}"
#  jq -e will produce an error code if the expression result is false or null - thus resulting in a
# error return code from this function naturally. This is much preferred rather than assume/hardcode
# the existence of a error object in the body payload
  echo "${result}" | jq -re '.statusCode >= 200 and .statusCode < 300' > /dev/null

answered Jul 31, 2021 at 23:49

Christian Bongiorno's user avatar

#1 2012-10-04 22:56:51

einsiedlerkrebs
Member
Registered: 2012-10-04
Posts: 5

[solved] yaourt: Curl 404

Hello,

i am having a problem with yaourt. Which is a pitty, cause i like(d) it. What i am getting if i am trying to update, for example is:

curl: (22) The requested URL returned error: 404 Not Found
curl error: Couldn't connect to server
curl error: Couldn't connect to server

I found a realated topic, which had to do with tor. I am not using tor, but i onced istalled it, but removed, since that thread was recomending that. It didnt help.
my mirrorlist is fine, and new. pacman is working, as it is supposed to be.
An update with yaourt «just» fails the AUR part of it.

does anyone of you have ideas, a hint about this. What output would you like to see?

Thanks a lot.

Last edited by einsiedlerkrebs (2012-10-05 14:08:24)

#2 2012-10-04 23:00:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 10,046

Re: [solved] yaourt: Curl 404

What package does it fail on? Sounds to me like the URL for the source download is gone.

Last edited by Scimmia (2012-10-04 23:01:09)

#3 2012-10-05 09:55:33

einsiedlerkrebs
Member
Registered: 2012-10-04
Posts: 5

Re: [solved] yaourt: Curl 404

hi.

It fails on any package (not that i tried to prove this),

for example:

$ yaourt -S openwrt-buildroot
curl error: Couldn't connect to server

more output comes, when i try to syncronize via yaourt:

$ yaourt -Syua
[sudo] password for USERNAME: 
:: Synchronisiere Paketdatenbanken...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  106k  100  106k    0     0  82383      0  0:00:01  0:00:01 --:--:--  159k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1422k  100 1422k    0     0   573k      0  0:00:02  0:00:02 --:--:--  629k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1786k  100 1786k    0     0   689k      0  0:00:02  0:00:02 --:--:--  750k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 93632  100 93632    0     0   105k      0 --:--:-- --:--:-- --:--:--  139k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 32658  100 32658    0     0   113k      0 --:--:-- --:--:-- --:--:--  224k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
curl error: Couldn't connect to server
curl error: Couldn't connect to server
 Foreign packages: / 25 / 25

==> Software upgrade (new version) :
extra/libshout 1:2.3.0-1 -> 1:2.3.1-1

==> Continue upgrade ? [Y/n]
==> [V]iew package detail   [M]anually select packages
==> --------------------------------------------------

It seems that ether curl is not working right, or something to do with kind of a «mirrorlist», while i don’t know, what mechanism yaourt using for such.

Thanks

Last edited by einsiedlerkrebs (2012-10-05 09:58:12)

#4 2012-10-05 11:10:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,833
Website

Re: [solved] yaourt: Curl 404

Do you get similar errors with pacman -Syu?

Can you ping the urls from AUR PKGBUILDs that give this error?

I suspect this is not a problem with curl or yaourt, but either with your mirrorlist or networking.  If you get similar errors from pacman, please post (or post a link to a pastebin) your mirrorlist.


«UNIX is simple and coherent…» — Dennis Ritchie, «GNU’s Not UNIX» —  Richard Stallman

#5 2012-10-05 12:13:57

einsiedlerkrebs
Member
Registered: 2012-10-04
Posts: 5

Re: [solved] yaourt: Curl 404

hi,

actually i do get similar errors using pacman:

$ sudo pacman -Syu
[sudo] password for USERNAME: 
:: Synchronisiere Paketdatenbanken...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  106k  100  106k    0     0  89551      0  0:00:01  0:00:01 --:--:--  161k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1422k  100 1422k    0     0   618k      0  0:00:02  0:00:02 --:--:--  680k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1785k  100 1785k    0     0   665k      0  0:00:02  0:00:02 --:--:--  722k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 93632  100 93632    0     0   106k      0 --:--:-- --:--:-- --:--:--  139k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 32658  100 32658    0     0   112k      0 --:--:-- --:--:-- --:--:--  224k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found
:: Starte komplette Systemaktualisierung...
 Es gibt nichts zu tun

if i ping the URL from a packagebuild, i can observe that:

$ ping http://openwrt.org #<--- this is what i can find in the PKGBUILD of https://aur.archlinux.org/packages.php?ID=57132
ping: unknown host http://openwrt.org
USERNAME@HOSTNAME ~ $ ping https://openwrt.org
ping: unknown host https://openwrt.org
USERNAME@HOSTNAME ~ $ ping openwrt.org
PING openwrt.org (78.24.191.177) 56(84) bytes of data.
64 bytes from openwrt.org (78.24.191.177): icmp_req=1 ttl=55 time=67.0 ms
64 bytes from openwrt.org (78.24.191.177): icmp_req=2 ttl=55 time=66.4 ms
^C
--- openwrt.org ping statistics ---
3 packets transmitted, 2 received, 33% packet loss, time 2002ms
rtt min/avg/max/mdev = 66.479/66.783/67.088/0.399 ms
USERNAME@HOSTNAME ~ $ ping http://www.google.de
ping: unknown host http://www.google.de
USERNAME@HOSTNAME ~ $ ping www.google.de
PING www.google.de (173.194.69.94) 56(84) bytes of data.
64 bytes from www.google.de (173.194.69.94): icmp_req=1 ttl=49 time=48.8 ms
64 bytes from www.google.de (173.194.69.94): icmp_req=2 ttl=49 time=49.4 ms
^C
--- www.google.de ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 48.832/49.157/49.483/0.393 ms

my mirrorlist is quite short since it is edited via reflector:

$ cat /etc/pacman.d/mirrorlist
# Arch Linux mirrorlist generated by Reflector
# With:       /usr/bin/reflector -l 5 --sort rate --save /etc/pacman.d/mirrorlist
# When:       2012-09-28 12:09:22 UTC
# From:       https://www.archlinux.org/mirrors/status/json/
# Retrieved:  2012-09-28 12:09:15 UTC
# Last Check: 2012-09-28T11:26:43.075Z UTC

Server = http://mirror.rit.edu/archlinux/$repo/os/$arch
Server = http://www.laqee.unal.edu.co/archlinux/$repo/os/$arch
Server = ftp://mirror.rit.edu/archlinux/$repo/os/$arch
Server = ftp://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
Server = rsync://mirror.rit.edu/archlinux/$repo/os/$arch

Is it normal, that ping without http:// works, but within not?

Thank you for helping.

eins

#6 2012-10-05 14:08:06

einsiedlerkrebs
Member
Registered: 2012-10-04
Posts: 5

Re: [solved] yaourt: Curl 404

Hey,

somehow  i fixed it.

while i couldn’t finde the problem in .bashrc i just used an older one, which helped. So thanks for you help….

me wondering.

eins

#7 2012-10-06 12:32:21

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 10,652

Re: [solved] yaourt: Curl 404

einsiedlerkrebs wrote:

Is it normal, that ping without http:// works, but within not?

Thank you for helping.

eins

Yes.

NAME
       ping, ping6 — send ICMP ECHO_REQUEST to network hosts

http, https, ftp, irc etc are protocols that run on a network host, not hosts .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

#8 2012-10-06 12:36:47

einsiedlerkrebs
Member
Registered: 2012-10-04
Posts: 5

Re: [solved] yaourt: Curl 404

okay. Sounds like it makes sence to me. So far. Thanks for replying to this detail as well.

eins

Table of Contents

  • Issue
  • Overview
  • Known Issues and Resolution
  • Verify if correct subscription-manager release is set on clients.
  • Check if /var utilization is full on Satellite/Capsule.
  • If a «%24releasever» character is observed in repomd.xml URL when performing `yum repolist` then set the correct release version in yum.
  • For clients associated with Default Organization View.
  • For clients associated with Content View.
  • Facing 404 error even if the package is in the metadata
  • While using Load Balancing Capsule setup:
  • The baseurl value in RHSM configuration is altered and not correct

Issue

When trying to install/update packages using yum getting below error on Client registered to Red Hat Satellite 6 server:

https://satellite.example.com/pulp/repos/test/Library/content/dist/rhel/server/6/6Server/x86_64/os/repodata /repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"

Overview

Generally, the [Errno 14] HTTPS Error 404 - Not Found error is observed due to inconsistent metadata of the repositories or if the client could not find or access the requested package on the server. The troubleshooting steps which need to be followed to resolve this issue vary in different scenarios and also there are multiple resolutions available for it. This article lists different Solutions describing when this issue occurs and how to get it resolved.

There are multiple parameters that you need to check before following any Knowledge Solution like whether there is a Content View associated with the client or Default Organization View, whether the client is registered through Capsule or directly to Satellite, release version set on the client and many more.

Known Issues and Resolution

Verify if correct subscription-manager release is set on clients.

  • If the client has been limited to a specific major or minor release, verify that it is using the correct one.

    • What release is the client using?

      # cat /etc/redhat-release
      
    • What release is the client subscribed/limited to?

      # subscription-manager release --show 
      
  • If these do not match, you will need to correct the mismatch using the subscription-manager release command and passing it the appropriate release identifier. This process is described in article.

Check if /var utilization is full on Satellite/Capsule.

  • In some situations the /var utilization gets full on the Satellite server as per the below output due to which the repository synchronization doesn’t get completed resulting in 404 not found errors on clients.

    [root@satellite ~]# df -h /var/lib/pulp
    Filesystem                   Size  Used Avail Use% Mounted on
    /dev/mapper/vg00-pulp        1.1T  1.1T   22K  100% /var/lib/pulp
    
  • To extend a logical volume and its filesystem in Red Hat Enterprise Linux refer to article : /var utilization is full on Satellite/Capsule 6.

If a «%24releasever» character is observed in repomd.xml URL when performing `yum repolist` then set the correct release version in yum.

  • Check if you see «%24releasever» character in the error observed as per the following example:

    https://satellite.example.com/pulp/repos/XYZ/Library/rhel-cv/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14]   HTTPS Error 404 - Not Found Trying other mirror.
    
    • If yes, check if there is any pre-defined variable set in /etc/yum/vars/releasever file:

      # cat /etc/yum/vars/releasever
      7.5
      
  • The unwanted «%24releasever» character set in URL can be removed by configuring the correct release in yum as mentioned in the article.

For clients associated with Default Organization View.

  • Verify if the client is associated with a Default Organization View be executing below command:

    # subscription-manager identity
    environment name: Library               <--- here no CV name is reflected with the Library environment which means this host is associated with Default Organization View
    
  • This issue may occur due to corrupt metadata and can be resolved by following the steps mentioned in article.

For clients associated with Content View.

  • Verify if the client is associated with a Content View be executing below command:

    # subscription-manager identity
    environment name: Prod/RHEL7-CV                                 <---     here CV name will be reflected after the Environment name 
    
  • To resolve this issue, it is required to publish/promote the Content View with a new version. Please refer to the article for detailed steps.

Facing 404 error even if the package is in the metadata

  • In some scenarios you may see that the Metadata contains proper information about the package however the filename is a broken symlink:

    # file gofer-2.7.6-1.el7sat.noarch.rpm 
    gofer-2.7.6-1.el7sat.noarch.rpm: broken symbolic link to `/var/lib/pulp/content/units/rpm/01        /d91ab1958314d44ce81038015cb83909aa7d968eb26e82c2791da9e21e5d7c/gofer-2.7.6-1.el7sat.noarch.rpm
    
  • To fix the broken symlinks issue or re-generate the repository metadata on Satellite/Capsule please refer to the article

While using Load Balancing Capsule setup:

  • Run below command on the client to check the stickiness is configured on port 443 or not.

    # while true ; do echo "$(date) $(curl -vv https://loadbalancer.example.com  2>&1 | grep "subject:")" ; sleep 5 ; done
    
  • Sticky session has to be configured on TCP port 443 to request yum metadata for RPM repositories from different Capsule Servers that are configured for Load Balancing. Please check article for more details.

The baseurl value in RHSM configuration is altered and not correct

  • Ensure the baseurl value in /etc/rhsm/rhsm.conf on content host registered with Red Hat Satellite is correctly set.

    # grep -e baseurl /etc/rhsm/rhsm.conf
    baseurl = https://satellite.example.com/pulp/repos
    

    Note: The satellite.example.com above should be the FQDN of Satellite or Capsule server to which the content host is registered.



  • Product(s)

  • Red Hat Satellite


  • Category

  • Troubleshoot


  • Component

  • katello
  • pulp
  • yum


  • Tags

  • satellite_6
  • yum


  • Article Type

  • General

Infopackets Reader Steve T. writes:

» Dear Dennis,

I am running Centos 6 32-bit (i386) on a virtual machine and recently I started having ‘PYCURL ERROR 22’ every time I use ‘yum list updates’ or ‘yum -y update’ to list and download updates. The error message says ‘[Errno 14] PYCURL ERROR 22 — The requested URL returned error: 404 Not Found‘. I have gone to the wiki.centos.org/yum-errors as the error message suggests, but have not been able to find a solution to this problem. Can you help? «

My response:

I asked Steve if he would like me to connect to his virtual machine using
my remote desktop support service in order to have a closer look at the problem, and he agreed. Below I will discuss my findings.

How to Fix: Yum [Errno 14] PYCURL ERROR 22 — 404 Not Found

As the centos.org wiki suggests, the first thing to do is to clear the yum cache as it may be corrupt, which will result in the PYCURL ERROR 22. To do so, open a terminal window / SSH and enter in the following:

yum clean all
rm -rf /var/cache/yum/*

If that does resolve your problem, please have a closer look at the error message. In Steve’s case it was the repo.ius.io mirror which was failing, as noted in the sample output below. In order to fix it, I went to the /etc/yum.repos.d directory and modified the ius.repo file in order to disable it.

Here is the sample output:

yum list updates

Loaded plugins: fastestmirror
Repository remi-safe is listed more than once in the configuration
Repository remi-php70 is listed more than once in the configuration
Loading mirror speeds from cached hostfile

* base: mirror.layeronline.com
* extras: mirror.layeronline.com
* remi: rpms.remirepo.net
* remi-php71: rpms.remirepo.net
* remi-safe: rpms.remirepo.net
* rpmforge: mirror.bacloud.com
* updates: mirror.layeronline.com

base | 3.7 kB 00:00
extras | 3.3 kB 00:00

https ://repo.ius.io/6/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 — «The requested URL returned error: 404 Not Found»

Trying other mirror.

To address this issue please refer to the below wiki article

https://wiki.centos.org/yum-errors

Disable Repository to Fix ‘PYCURL ERROR 22’

If you note the above output (red bold text), it lists the URL that is causing the error (repo.ius.io). To fix the error you need to disable the repository
via its configuration file, but this is really only a temporary fix to the issue
as it does not replace the broken repository.

For the record, I attempted to open https: //repo.ius.io/6/i386/repodata/repomd.xml via
the browser and it results in a 404 (file not found). After a bit more research,
it appears that repo.ius.io has removed all i386 (Centos 6 32 bit) data from their server and currently only supports x64. This may be because Centos 6 is reaching its end of life (as of November 30 2020).

I am not familiar enough on how to replace this repository as it seems
they have switched from using mirrors to a content distribution network
(CDN) as of April 30, 2019. I also tried ‘yum update ius-release’ as the
page suggests, but it made no difference.

To disable the repo.ius.io repository, do the following:

cd /etc/yum.repos.d

####show all files with ius in it:
ls -al |grep ius

-rw-r — r— 1 root root 669 May 1 12:00 ius-archive.repo
-rw-r — r— 1 root root 591 May 1 12:00 ius.repo                   
<=== this file

-rw-r — r— 1 root root 669 May 1 12:00 ius-testing.repo

####modify the repo file:
nano -w ius.repo

[ius]
name = IUS for Enterprise Linux 6 — $basearch
baseurl = https://repo.ius.io/6/$basearch/
####was enabled = 1, set to 0
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-6

That’s it! I hope that helps.

If anyone has any suggestions on getting the ius.repo to work again, please leave a comment below. For now, it appears to be taken offline — perhaps permanently.

Got a Computer Question or Problem? Ask Dennis!

I need more questions. If you have a computer question — or even a computer
problem that needs fixing — please
email me with your question so that I can write more articles like this one.
I can’t promise I’ll respond to all the messages I receive (depending on the
volume), but I’ll do my best.

About the author: Dennis Faas is the owner and operator of
Infopackets.com. With over 30 years of computing experience, Dennis’ areas of
expertise are a broad range and include PC hardware, Microsoft Windows, Linux,
network administration, and virtualization. Dennis holds a Bachelors degree in
Computer Science (1999) and has authored 6 books on the topics of MS Windows and
PC Security. If you like the advice you received on this page, please up-vote /
Like this page and share it with friends. For technical support inquiries,
Dennis can be reached via Live chat online this site using the Zopim Chat
service (currently located at the bottom left of the screen); optionally, you
can contact Dennis through the website
contact form.

Понравилась статья? Поделить с друзьями:
  • Ctfmon exe что это ошибка
  • Ctfmon exe что это unknown hard error
  • Ctfmon exe успешное выполнение unknown hard error
  • Ctfmon exe системная ошибка win 10
  • Cups server error client error not possible