Skip to content

[data] Skip unsupported file types with warning#337

Open
kkozoriz wants to merge 4 commits intomainfrom
fix/data-export-skip-unsupported-file-types
Open

[data] Skip unsupported file types with warning#337
kkozoriz wants to merge 4 commits intomainfrom
fix/data-export-skip-unsupported-file-types

Conversation

@kkozoriz
Copy link
Copy Markdown
Contributor

Problem

d8 data export download fails with ERROR and leaves an empty stale directory
on disk when a Filesystem volume contains Unix sockets, FIFOs, or other special
files.

Server side: data-exporter reported sockets/FIFOs as "type":"dir" - fixed
in a companion MR in storage-volume-data-manager.

Client side: the download loop had no handling for unknown item types, so a
socket arriving as "dir" caused os.MkdirAll, a recursive GET that returned
400 not a regular file, and the entire download aborting with ERROR.

Fix

Replace if item.Type == "dir" with an explicit switch:

  • "dir" → mkdir + recurse
  • "file", "link" → download
  • anything else → WARN Skipping non-downloadable entry + skip

Type strings extracted into named constants.

Tests

  • TestDownloadFilesystem_SocketInDirIsSkipped - client skips "other" entry,
    downloads regular files, makes no HTTP request for the socket.
  • TestDownloadFilesystem_RecursiveWithSocketsCompletes - deep tree with sockets
    completes successfully, no socket artefacts on disk.

Before

Снимок экрана 2026-04-21 в 15 23 41

After

image

Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
@kkozoriz kkozoriz requested a review from kneumoin April 21, 2026 12:57
@kkozoriz kkozoriz self-assigned this Apr 21, 2026
kneumoin
kneumoin previously approved these changes Apr 21, 2026
case itemTypeFile, itemTypeLink:
// downloadable, proceed below
default:
log.Warn("Skipping non-downloadable entry", slog.String("name", item.Name), slog.String("type", item.Type))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log.Warn("Skipping unsupported entry during filesystem download", slog.String("path", item.Name), slog.String("type", item.Type)) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@kkozoriz kkozoriz marked this pull request as ready for review April 21, 2026 16:01
@kkozoriz kkozoriz requested a review from ldmonster as a code owner April 21, 2026 16:01
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants