wavetermdev/waveterm · error
error making blockfile %q: %w
Error message
error making blockfile %q: %w
What it means
After the block object is created, CreateBlockWithTelemetry creates any files declared in blockDef.Files via filestore.WFS.MakeFile. If the virtual filesystem refuses to create the named file (invalid name, opts, or zone failure), block creation is rolled back and this error wraps the cause.
Source
Thrown at pkg/wcore/block.go:95
}()
if blockDef == nil {
return nil, fmt.Errorf("blockDef is nil")
}
if blockDef.Meta == nil || blockDef.Meta.GetString(waveobj.MetaKey_View, "") == "" {
return nil, fmt.Errorf("no view provided for new block")
}
blockData, err := createBlockObj(ctx, tabId, blockDef, rtOpts)
if err != nil {
return nil, fmt.Errorf("error creating block: %w", err)
}
blockCreated = true
newBlockOID = blockData.OID
// upload the files if present
if len(blockDef.Files) > 0 {
for fileName, fileDef := range blockDef.Files {
err := filestore.WFS.MakeFile(ctx, newBlockOID, fileName, fileDef.Meta, wshrpc.FileOpts{})
if err != nil {
return nil, fmt.Errorf("error making blockfile %q: %w", fileName, err)
}
err = filestore.WFS.WriteFile(ctx, newBlockOID, fileName, []byte(fileDef.Content))
if err != nil {
return nil, fmt.Errorf("error writing blockfile %q: %w", fileName, err)
}
}
}
if recordTelemetry {
blockView := blockDef.Meta.GetString(waveobj.MetaKey_View, "")
blockController := blockDef.Meta.GetString(waveobj.MetaKey_Controller, "")
go recordBlockCreationTelemetry(blockView, blockController, false)
}
return blockData, nil
}
func recordBlockCreationTelemetry(blockView string, blockController string, subBlock bool) {
defer func() {
panichandler.PanicHandler("CreateBlock:telemetry", recover())View on GitHub (pinned to a4447c1563)
Solutions
- Inspect the wrapped inner error from WFS.MakeFile
- Use simple, legal file names (no path separators or reserved characters) in blockDef.Files
- Verify disk space and filestore zone health, then retry block creation
Example fix
// before
Files: map[string]*waveobj.BlockFile{"a/b.txt": {Content: "x"}}
// after
Files: map[string]*waveobj.BlockFile{"a-b.txt": {Content: "x"}} Defensive patterns
Strategy: try-catch
Validate before calling
for name := range blockDef.Files {
if strings.ContainsAny(name, "/\\") {
return fmt.Errorf("illegal blockfile name: %q", name)
}
} Try / catch
block, err := wcore.CreateBlock(ctx, tabId, blockDef, rtOpts)
if err != nil && strings.Contains(err.Error(), "error making blockfile") {
// fix filename/meta or storage, then retry
} Prevention
- Use flat, legal file names in blockDef.Files
- Keep file meta compatible with wshrpc.FileOpts
- Ensure adequate disk space for the filestore
When it happens
Trigger: BlockDef.Files contains an entry whose MakeFile call fails: illegal filename, invalid file meta, or an underlying WFS/storage error for the new block's zone.
Common situations: Block definitions with path-like or reserved filenames; unsupported meta for the file type; storage backend unavailable (disk full, permission issues).
Related errors
- error creating block term file: %w
- error creating blockfile: %w
- error writing blockfile %q: %w
- accessing file %s: %w
- getting absolute path for %s: %w
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/6d66ff221e09a267.
Report an issue: GitHub.