kubernetes/kops · error

creating file %q: %w

Error message

creating file %q: %w

What it means

os.Create of the container-log output file under the artifacts dir failed; a local filesystem error (permissions, invalid path, or disk full) on the dump machine.

Source

Thrown at pkg/dump/podlogs.go:145

					err := writeContainerLogs(resPath+".log", resp)
					if err != nil {
						podErr = errors.Join(podErr, err)
					}
				}
			}
		}

		results <- podLogDumpResult{err: podErr}
	}
}

func writeContainerLogs(filePath string, contents []byte) error {
	resFile, err := os.Create(filePath)
	defer func(resFile *os.File) {
		_ = resFile.Close()
	}(resFile)
	if err != nil {
		return fmt.Errorf("creating file %q: %w", filePath, err)
	}
	_, err = resFile.Write(contents)
	if err != nil {
		return fmt.Errorf("writing file %q: %w", filePath, err)
	}
	return nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check permissions and space in the artifacts directory
  2. Ensure the path components are valid for the local filesystem
  3. Retry after fixing the local filesystem
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/dump/podlogs.go:145 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/102592525ddfd199. Report an issue: GitHub.