cloudreve/cloudreve · error

Entity data does not exist.

Error message

Entity data does not exist.

What it means

Error "Entity data does not exist." thrown in cloudreve/cloudreve.

Source

Thrown at pkg/filemanager/manager/entitysource/entitysource.go:283

func (f *entitySource) LocalPath(ctx context.Context) string {
	return f.handler.LocalPath(ctx, f.e.Source())
}

func (f *entitySource) Serve(w http.ResponseWriter, r *http.Request, opts ...EntitySourceOption) {
	if len(opts) > 0 {
		// Clear cache when options are applied as they might affect URL generation
		f.clearUrlCache()
	}
	for _, opt := range opts {
		opt.Apply(f.o)
	}

	if f.IsLocal() {
		// For local files, validate file existence by resetting rsc
		if err := f.resetRequest(); err != nil {
			f.l.Warning("Failed to serve local entity %q: %s", err, f.e.Source())
			http.Error(w, "Entity data does not exist.", http.StatusNotFound)
			return
		}
	}

	etag := "\"" + hashid.EncodeEntityID(f.hasher, f.e.ID()) + "\""
	w.Header().Set("Etag", "\""+hashid.EncodeEntityID(f.hasher, f.e.ID())+"\"")

	if f.o.IsDownload {
		// Properly handle non-ASCII characters in filename according to RFC 6266
		displayName := f.o.DisplayName
		asciiFilename := toASCIISafeFilename(displayName)

		// RFC 6266 compliant filename* encoding
		encodedFilename := url.QueryEscape(displayName)

		if displayName == asciiFilename {
			// Filename contains only ASCII characters, use simple form
			w.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", displayName))

View on GitHub (pinned to 20c95ad73f)

When it happens

Trigger: Thrown at pkg/filemanager/manager/entitysource/entitysource.go:283 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of cloudreve/cloudreve@20c95ad73f (2026-08-16). Data as JSON: /api/errors/5d19aef4569a9f6b. Report an issue: GitHub.