Yum : JSON parsing error: No JSON object could be decoded

Publié le 29 février 2024

Récemment, plusieurs serveurs Red Hat 7 se sont mis à ne plus pouvoir accéder aux dépôts officiels :

yum update
Modules complémentaires chargés : product-id, search-disabled-repos, subscription-manager

This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.


*** WARNING ***
The subscription for following product(s) has expired:
  - Cinderlib
  - JBoss Enterprise Application Platform
  - OpenJDK Java (for Middleware)
  - OpenShift Developer Tools and Services
  - Oracle Java (for RHEL Compute Node)
  - Oracle Java (for RHEL Server)
  - Oracle Java (for RHEL Server) - Extended Update Support
  - Red Hat 3scale API Management Platform
  - Red Hat Ansible Automation Platform
  - Red Hat Ansible Engine
  - Red Hat Beta
  - Red Hat Ceph Storage
  - Red Hat Ceph Storage - Extended Life Cycle Support
  - Red Hat Ceph Storage Calamari
  - Red Hat Ceph Storage MON
  - Red Hat Ceph Storage MON - Extended Life Cycle Support
  - Red Hat Ceph Storage OSD
  - Red Hat Ceph Storage OSD - Extended Life Cycle Support
  - Red Hat Certification (for RHEL Server)
  - Red Hat CloudForms
  - Red Hat CloudForms Beta
  - Red Hat CodeReady Linux Builder for ARM 64
  - Red Hat CodeReady Linux Builder for ARM 64 Beta
  - Red Hat CodeReady Linux Builder for ARM 64 High Touch Beta
  - Red Hat CodeReady Linux Builder for IBM z Systems
  - Red Hat CodeReady Linux Builder for IBM z Systems - Extended Update Support
  - Red Hat CodeReady Linux Builder for Power, little endian
  - Red Hat CodeReady Linux Builder for Power, little endian - Extended Update Support
  - Red Hat CodeReady Linux Builder for x86_64
  - Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support
  - Red Hat CodeReady Workspaces for OpenShift
  - Red Hat Container Images
  - Red Hat Container Images Beta
  - Red Hat Developer Tools (for RHEL Server for ARM 64)
  - Red Hat Developer Tools (for RHEL Server for ARM)
  - Red Hat Developer Tools (for RHEL Server for IBM Power LE)
  - Red Hat Developer Tools (for RHEL Server for IBM Power)
  - Red Hat Developer Tools (for RHEL Server for System Z)
  - Red Hat Developer Tools (for RHEL Server)
  - Red Hat Developer Tools (for RHEL Workstation)
  - Red Hat Developer Tools Beta (for RHEL Server for ARM 64)
  - Red Hat Developer Tools Beta (for RHEL Server for ARM)
  - Red Hat Developer Tools Beta (for RHEL Server for IBM Power LE)
  - Red Hat Developer Tools Beta (for RHEL Server for IBM Power)
  - Red Hat Developer Tools Beta (for RHEL Server for System Z)
  - Red Hat Developer Tools Beta (for RHEL Server)
  - Red Hat Developer Tools Beta (for RHEL Workstation)
  - Red Hat Developer Toolset (for RHEL Server)
  - Red Hat Directory Server
  - Red Hat EUCJP Support (for RHEL Server) - Extended Update Support
  - Red Hat Enterprise Linux Advanced Virtualization
  - Red Hat Enterprise Linux Advanced Virtualization (for RHEL Server for IBM System Z)
  - Red Hat Enterprise Linux Advanced Virtualization (for RHEL Server for IBM System Z) EUS
  - Red Hat Enterprise Linux Advanced Virtualization Beta
  - Red Hat Enterprise Linux Atomic Host
  - Red Hat Enterprise Linux Atomic Host Beta
  - Red Hat Enterprise Linux Fast Datapath
  - Red Hat Enterprise Linux Fast Datapath (for RHEL Server for IBM Power LE)
  - Red Hat Enterprise Linux Fast Datapath Beta for Power, little endian
  - Red Hat Enterprise Linux High Availability (for IBM Power LE) - Extended Update Support
  - Red Hat Enterprise Linux High Availability (for IBM z Systems) - Extended Update Support
  - Red Hat Enterprise Linux High Availability for Power LE - Update Services for SAP Solutions
  - Red Hat Enterprise Linux High Availability for Power, little endian
  - Red Hat Enterprise Linux High Availability for x86_64
  - Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support
  - Red Hat Enterprise Linux High Availability for x86_64 - Update Services for SAP Solutions
  - Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support
  - Red Hat Enterprise Linux Load Balancer (for RHEL Server)
  - Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support
  - Red Hat Enterprise Linux Resilient Storage for IBM z Systems - Extended Update Support
  - Red Hat Enterprise Linux Resilient Storage for x86_64
  - Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support
  - Red Hat Enterprise Linux Scalable File System (for RHEL Server)
  - Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support
  - Red Hat Enterprise Linux Server
  - Red Hat Enterprise Linux Server - Extended Life Cycle Support
  - Red Hat Enterprise Linux Server - Extended Life Cycle Support (for IBM z Systems)
  - Red Hat Enterprise Linux Server for ARM
  - Red Hat Enterprise Linux Server for ARM Beta
  - Red Hat Enterprise Linux Server for Power LE - Update Services for SAP Solutions
  - Red Hat Enterprise Linux for ARM 64
  - Red Hat Enterprise Linux for ARM 64 Beta
  - Red Hat Enterprise Linux for ARM 64 High Touch Beta
  - Red Hat Enterprise Linux for IBM z Systems
  - Red Hat Enterprise Linux for IBM z Systems - Extended Update Support
  - Red Hat Enterprise Linux for Power 9
  - Red Hat Enterprise Linux for Power, big endian
  - Red Hat Enterprise Linux for Power, big endian - Extended Update Support
  - Red Hat Enterprise Linux for Power, little endian
  - Red Hat Enterprise Linux for Power, little endian - Extended Update Support
  - Red Hat Enterprise Linux for Power, little endian Beta
  - Red Hat Enterprise Linux for Real Time
  - Red Hat Enterprise Linux for SAP Applications for IBM z Systems Beta
  - Red Hat Enterprise Linux for SAP Applications for IBM z Systems High Touch Beta
  - Red Hat Enterprise Linux for SAP Applications for Power BE
  - Red Hat Enterprise Linux for SAP Applications for Power BE - Extended Update Support
  - Red Hat Enterprise Linux for SAP Applications for Power LE
  - Red Hat Enterprise Linux for SAP Applications for Power LE - Extended Update Support
  - Red Hat Enterprise Linux for SAP Applications for Power LE - Update Services for SAP Solutions
  - Red Hat Enterprise Linux for SAP Applications for Power, little endian High Touch Beta
  - Red Hat Enterprise Linux for SAP Applications for System Z
  - Red Hat Enterprise Linux for SAP Applications for System Z - Extended Life Cycle Support
  - Red Hat Enterprise Linux for SAP Applications for System Z - Extended Update Support
  - Red Hat Enterprise Linux for SAP Applications for x86_64
  - Red Hat Enterprise Linux for SAP Applications for x86_64 - Extended Update Support
  - Red Hat Enterprise Linux for SAP Applications for x86_64 - Update Services for SAP Solutions
  - Red Hat Enterprise Linux for SAP Applications for x86_64 Beta
  - Red Hat Enterprise Linux for SAP Applications for x86_64 High Touch Beta
  - Red Hat Enterprise Linux for SAP Solutions for Power LE
  - Red Hat Enterprise Linux for SAP Solutions for Power LE - Extended Update Support
  - Red Hat Enterprise Linux for SAP Solutions for Power LE - Update Services for SAP Solutions
  - Red Hat Enterprise Linux for SAP Solutions for x86_64
  - Red Hat Enterprise Linux for SAP Solutions for x86_64 - Extended Update Support
  - Red Hat Enterprise Linux for SAP Solutions for x86_64 - Update Services for SAP Solutions
  - Red Hat Enterprise Linux for Scientific Computing
  - Red Hat Enterprise Linux for x86_64
  - Red Hat Enterprise Linux for x86_64 - Extended Update Support
  - Red Hat Enterprise Linux for x86_64 - Update Services for SAP Solutions
  - Red Hat Enterprise MRG Messaging
  - Red Hat Enterprise Virtualization for Power, little endian
  - Red Hat Gluster Storage Management Console (for RHEL Server)
  - Red Hat Gluster Storage Nagios Server
  - Red Hat Gluster Storage Server for On-premise
  - Red Hat Gluster Storage Web Administration (for RHEL Server)
  - Red Hat JBoss Core Services
  - Red Hat OpenShift Container Platform
  - Red Hat OpenShift Data Foundation
  - Red Hat OpenShift GitOps
  - Red Hat OpenShift Pipelines
  - Red Hat OpenShift Service Mesh
  - Red Hat OpenShift distributed tracing
  - Red Hat OpenStack
  - Red Hat OpenStack - Extended Life Cycle Support
  - Red Hat OpenStack Beta
  - Red Hat OpenStack Director Deployment Tools
  - Red Hat OpenStack Director Deployment Tools Beta
  - Red Hat OpenStack Director Deployment Tools Beta for IBM Power LE
  - Red Hat OpenStack Director Deployment Tools for IBM Power LE
  - Red Hat Openshift Application Runtimes for IBM Power LE
  - Red Hat Openshift Serverless
  - Red Hat Quay Enterprise
  - Red Hat S-JIS Support (for RHEL Server) - Extended Update Support
  - Red Hat Satellite Proxy
  - Red Hat Single Sign-On
  - Red Hat Software Collections (for RHEL Client)
  - Red Hat Software Collections (for RHEL Server for ARM 64)
  - Red Hat Software Collections (for RHEL Server for ARM)
  - Red Hat Software Collections (for RHEL Server for IBM Power LE)
  - Red Hat Software Collections (for RHEL Server)
  - Red Hat Software Collections (for RHEL Workstation)
  - Red Hat Software Collections Beta (for RHEL Client)
  - Red Hat Software Collections Beta (for RHEL Server for ARM 64)
  - Red Hat Software Collections Beta (for RHEL Server for ARM)
  - Red Hat Software Collections Beta (for RHEL Server for IBM Power LE)
  - Red Hat Software Collections Beta (for RHEL Server)
  - Red Hat Software Collections Beta (for RHEL Workstation)
  - Red Hat Software Test Suite 5 (for RHEL Server)
  - Red Hat Storage Console
  - Red Hat Storage Console Node
  - Red Hat Storage for Public Cloud (via RHUI)
  - Red Hat Virtualization
  - Red Hat Virtualization - ELS
  - Red Hat Virtualization - Extended Update Support
  - Red Hat Virtualization Host
  - Red Hat Virtualization Host - Extended Update Support
  - Red Hat Virtualization Manager
  - Red Hat Virtualization for IBM Power LE
  - Red Hat Virtualization for IBM Power LE - Extended Update Support
  - dotNET on RHEL (for RHEL Compute Node)
  - dotNET on RHEL (for RHEL Server)
  - dotNET on RHEL Beta (for RHEL Compute Node)
  - dotNET on RHEL Beta (for RHEL Server)
You no longer have access to the repositories that provide these products.  It is important that you apply an active subscription in order to resume access to security and other critical updates. If you don't have other active subscriptions, you can renew the expired subscription.

La réinscription aux dépôts ne fonctionnait pas non plus :

subscription-manager register --force
Annulation de l’inscription de : subscription.rhsm.redhat.com:443/subscription
Erreur réseau. Veuillez vérifier les détails de la connexion, ou voir /var/log/rhsm/rhsm.log pour plus d'informations.

Le fichier de log /var/log/rhsm/rhsm.log indiquait :

2024-02-29 10:24:48,995 [INFO] subscription-manager:16580:MainThread @connection.py:915 - Connection built: http_proxy=172.16.45.134:3128 host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2024-02-29 10:24:49,003 [INFO] subscription-manager:16580:MainThread @connection.py:915 - Connection built: http_proxy=172.16.45.134:3128 host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=identity_cert ca_dir=/etc/rhsm/ca/ insecure=False
2024-02-29 10:24:49,003 [INFO] subscription-manager:16580:MainThread @connection.py:915 - Connection built: http_proxy=172.16.45.134:3128 host=subscription.rhsm.redhat.com port=443 handler=/subscription auth=none
2024-02-29 10:24:49,354 [ERROR] subscription-manager:16580:MainThread @connection.py:647 - Response: 400
2024-02-29 10:24:49,354 [ERROR] subscription-manager:16580:MainThread @connection.py:648 - JSON parsing error: No JSON object could be decoded
2024-02-29 10:24:49,354 [ERROR] subscription-manager:16580:MainThread @managercli.py:217 - Unregister failed
2024-02-29 10:24:49,354 [ERROR] subscription-manager:16580:MainThread @managercli.py:218 - HTTP error (400 - Bad Request)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/subscription_manager/managercli.py", line 1340, in _do_command
    unregister.UnregisterService(self.cp).unregister()
  File "/usr/lib64/python2.7/site-packages/rhsmlib/services/unregister.py", line 54, in unregister
    self.uep.unregisterConsumer(self.identity.uuid)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 1325, in unregisterConsumer
    return self.conn.request_delete(method)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 742, in request_delete
    return self._request("DELETE", method, params, headers=headers)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 756, in _request
    info=info, headers=headers)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 631, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.7/site-packages/rhsm/connection.py", line 717, in validateResponse
    raise NetworkException(response['status'])
NetworkException: HTTP error (400 - Bad Request)

La solution tient en trois commandes :

rm -rf /etc/pki/consumer
rm -rf /etc/pki/entitlement
subscription-manager clean 

Ensuite, il faut recommencer l’enregistrement avec subscription-manager register --force et subscription-manager attach --auto.