The 'oc logs' command failed to provide the log in a cluster using a proxy

Solution Verified - Updated -

Issue

  • The oc logs command failed with a net/http: TLS handshake timeout error

    Error from server: Get "https://<node-IP>:10250/containerLogs/<namespace>/<pod-name>/<container>": net/http: TLS 
    handshake timeout
    
  • The oc logs command failed with a tls: failed to verify certificate: x509: certificate signed by unknown authority error

    Error from server: Get "https://<node-IP>:10250/containerLogs/<namespace>/<pod-name>/<container>":  tls: failed to verify certificate: x509: certificate signed by unknown authority
    
  • The oc logs command failed with a Forbidden error

    Error from server: Get "https://<node-IP>:10250/containerLogs/<namespace>/<pod-name>/<container>":  Forbidden
    

Where the node-IP is the node hosting the container requested the logs from, the namespace is the namespace the pod is present, the pod-name is the name of the pod the container is present and the container is the actual container.

Environment

  • Red Hat Openshift Container Platform (RHOCP)
    • 4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content