{"record":{"id":"a7ab0b4fddca003d","repo":"wavetermdev/waveterm","slug":"error-creating-block-term-file-w","errorCode":null,"errorMessage":"error creating block term file: %w","messagePattern":"error creating block term file: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/blockcontroller/durableshellcontroller.go","lineNumber":170,"sourceCode":"\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error getting job manager status: %w\", err)\n\t\t}\n\t\tif status == jobcontroller.JobManagerStatus_Running {\n\t\t\tjobId = blockData.JobId\n\t\t} else if !force {\n\t\t\tlog.Printf(\"block %q has jobId %s but manager is not running (status: %s), not starting (force=false)\\n\", dsc.BlockId, blockData.JobId, status)\n\t\t\treturn nil\n\t\t} else {\n\t\t\tlog.Printf(\"block %q has jobId %s but manager is not running (status: %s), starting new job (force=true)\\n\", dsc.BlockId, blockData.JobId, status)\n\t\t\t// intentionally leave jobId empty to trigger starting a new job below\n\t\t}\n\t}\n\n\tif jobId == \"\" {\n\t\tlog.Printf(\"block %q starting new durable shell\\n\", dsc.BlockId)\n\t\tfsErr := filestore.WFS.MakeFile(ctx, dsc.BlockId, wavebase.BlockFile_Term, nil, wshrpc.FileOpts{MaxSize: DefaultTermMaxFileSize, Circular: true})\n\t\tif fsErr != nil && fsErr != fs.ErrExist {\n\t\t\treturn fmt.Errorf(\"error creating block term file: %w\", fsErr)\n\t\t}\n\t\tnewJobId, err := dsc.startNewJob(ctx, blockMeta, dsc.ConnName, rtOpts)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to start new job: %w\", err)\n\t\t}\n\t\tjobId = newJobId\n\t}\n\n\tdsc.WithLock(func() {\n\t\tdsc.JobId = jobId\n\t\tdsc.sendUpdate_withlock()\n\t})\n\n\terr = jobcontroller.ReconnectJob(ctx, jobId, rtOpts)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to reconnect to job: %w\", err)\n\t}\n","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/blockcontroller/durableshellcontroller.go#L152-L188","documentation":"When starting a fresh durable shell (no existing jobId), Start creates the block's circular term output file via filestore.WFS.MakeFile. This error wraps any filestore failure other than fs.ErrExist (which is tolerated since the file may already exist).","triggerScenarios":"WFS.MakeFile fails with a real error — disk full, filestore backend (local or remote) unavailable, permission problem, or the block's file area can't be provisioned.","commonSituations":"Remote connection with a broken filestore; disk quota exceeded on the machine holding the term file; permission issues in the wave data directory; remote filestore call failing over SSH.","solutions":["Check free disk space and permissions on the wave data directory","Verify the remote connection/filestore is healthy (reconnect if needed)","Delete the stale term file for the block so MakeFile can recreate it","Inspect the wrapped fsErr for the concrete filesystem cause"],"exampleFix":"// before\nfsErr := filestore.WFS.MakeFile(ctx, blockId, wavebase.BlockFile_Term, nil, opts)\n// after (caller-side)\n_ = filestore.WFS.DeleteFile(ctx, blockId, wavebase.BlockFile_Term) // clear stale file\ndsc.Start(ctx, meta, rtOpts, true)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := dsc.Start(ctx, meta, rtOpts, true); err != nil && strings.Contains(err.Error(), \"error creating block term file\") {\n    // check disk space / delete stale term file, then retry\n}","preventionTips":["Monitor disk space where wavedb/filestore lives","Clean up term files for closed blocks","Ensure filestore backend (local/remote) is reachable before starting shells"],"tags":["filesystem","filestore","durable-shell","disk"],"backgroundTag":"term-file-create-failed","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}