Skip to content

Conversation

@phrogwrld
Copy link
Contributor

When running the command bun db:push or bun db:push:local:

PS C:\Users\phrog\Code\_\web> bun db:push:local
$ bun ./prisma/push.mjs --local
No changes
83 |    unlinkSync(tempDb);
84 |    process.exit(0);
85 | }
86 | if (migration.stdout.includes('-- This is an empty migration.')) {
87 |    console.log('No changes');
88 |    unlinkSync(tempDb);
      ^
EBUSY: resource busy or locked, unlink 'C:\Users\phrog\Code\alignofficesystems\web\prisma\temp.db'
    path: "C:\\Users\\phrog\\Code\\alignofficesystems\\web\\prisma\\temp.db",
 syscall: "unlink",
   errno: -16,
    code: "EBUSY"

      at C:\Users\phrog\Code\alignofficesystems\web\prisma\push.mjs:88:2
      at loadAndEvaluateModule (2:1)

Bun v1.2.20 (Windows x64)
error: script "db:push:local" exited with code 1

At first, I thought it was corrupted windows OS, but testing with a fresh install also gave me the same issue.

This happens because Windows will lock in-use files, which prevents unlinkSync from removing temp.db.

This appears to be Windows-specific because I didn't experience this issue on Linux.

Screenshot 2025-09-13 144108

@ottomated
Copy link
Owner

Thanks!

@ottomated ottomated changed the base branch from main to updates September 16, 2025 08:18
@ottomated ottomated merged commit c910321 into ottomated:updates Sep 16, 2025
1 of 7 checks passed
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