Skip to content

get logs started failing on GKE v1.32: PodLogOptions XXX is invalid: stream: Forbidden: may not be specified #133005

@Ark-kun

Description

@Ark-kun

What happened?

Our log fetching code started failing after the GKE cluster upgraded from 1.31.9-gke.1044001 to v1.32.4-gke.1698000.

kubernetes.client.exceptions.ApiException: (422)
Reason: Unprocessable Entity
HTTP response headers: HTTPHeaderDict({'Audit-Id': '91d413c9-f4d7-4af5-9935-2ac55a84c23d', 'Cache-Control': 'no-cache, private', 'Content-Type': 'application/json', 'Date': 'Wed, 16 Jul 2025 19:27:14 GMT', 'Content-Length': '360'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"PodLogOptions \"task-pod-xpdkk\" is invalid: stream: Forbidden: may not be specified","reason":"Invalid","details":{"name":"task-pod-xpdkk","kind":"PodLogOptions","causes":[{"reason":"FieldValueForbidden","message":"Forbidden: may not be specified","field":"stream"}]},"code":422}

I see no such checks in ValidatePodLogOptions and I see no recent changes there.
https://github.com/kubernetes/kubernetes/blame/master/pkg/apis/core/v1/validation/validation.go#L136

I see no mention of log API changes in the GKE release notes.

What did you expect to happen?

I expected the get_logs API to continue working as before.

How can we reproduce it (as minimally and precisely as possible)?

core_api_client.read_namespaced_pod_log(
            name=self._pod_name,
            namespace=self._namespace,
            container="main",
            timestamps=True,
            stream="All",
)

Anything else we need to know?

No response

Kubernetes version

% kubectl version
Client Version: v1.32.2
Kustomize Version: v5.5.0
Server Version: v1.32.4-gke.1698000

Cloud provider

GKE:

  • Works on: 1.31.9-gke.1044001
  • Fails on: v1.32.4-gke.1698000

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.sig/architectureCategorizes an issue or PR as relevant to SIG Architecture.triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    Status

    Needs Information

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions