goharbor/harbor · error

invalid length of log identify

Error message

invalid length of log identify

What it means

Error "invalid length of log identify" thrown in goharbor/harbor.

Source

Thrown at src/jobservice/logger/getter/file_getter.go:69

	fPath := path.Join(fg.baseDir, fmt.Sprintf("%s.log", logID))

	if !utils.FileExists(fPath) {
		return nil, errs.NoObjectFoundError(logID)
	}

	return tailLogFile(fPath, logSizeLimit())
}

func isValidLogID(id string) error {
	lid := id
	segment := strings.LastIndex(lid, "@")
	if segment != -1 {
		lid = lid[:segment]
	}

	if len(lid) != 24 {
		return errors.New("invalid length of log identify")
	}

	if _, err := hex.DecodeString(lid); err != nil {
		return errors.New("invalid log identify")
	}

	return nil
}

func tailLogFile(filename string, limit int64) ([]byte, error) {
	fInfo, err := os.Stat(filename)
	if err != nil {
		return nil, err
	}
	size := fInfo.Size()

	var sizeToRead int64
	if limit <= 0 {

View on GitHub (pinned to 7b2fd08cc5)

When it happens

Trigger: Thrown at src/jobservice/logger/getter/file_getter.go:69 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of goharbor/harbor@7b2fd08cc5 (2026-08-16). Data as JSON: /api/errors/ea177dbad72e73d5. Report an issue: GitHub.