Blender - Development Server tails to start due to helper being 'EBUSY: resource busy or locked'

Working with the sandbox demo sample, I have opened and closed the file a few times between development runs and now even after a restart of my pc, I get the below error when trying to start the development server. I have tried stopping the server and killing all related processes on windows but I think this is a locked file issue?

npm error syscall rename
npm error path C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\helper
npm error dest C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\.helper-aycGCRWS
npm error errno -4082
npm error EBUSY: resource busy or locked, rename 'C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\helper' -> 'C:\Git_General\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\.helper-aycGCRWS'
npm error A complete log of this run can be found in: C:\Users\Robert.Farthing\AppData\Local\npm-cache\_logs\2024-12-02T13_08_34_329Z-debug-0.log

The EBUSY: resource busy or locked error indicates that a file or resource is being accessed simultaneously by another process or is locked. Here are some steps to resolve this issue:

  1. Ensure No Other Processes are Running:

    • Open the Task Manager on Windows and make sure that no other instances of npm, Node.js, or any related applications are still running that could hold the lock on the resource.
  2. Delete node_modules and Reinstall:

    • Sometimes temporary issues with specific modules can cause locks. Deleting the node_modules folder and reinstalling dependencies might help. Use the following commands in your projectā€™s root directory:
      rm -rf node_modules
      npm install
      
  3. Use processExplorer:

    • Download and use Process Explorer from Sysinternals (available on Microsoftā€™s website) to identify lock-holding processes and kill them if safe to do so.
  4. Restart Your System:

    • Restarting your system can often solve transient file lock issues.
  5. Check for System Updates:

    • Ensure your system, Node.js, and npm are updated to the latest stable versions. Conflicting environments or outdated versions might contribute to such problems.
  6. Use a Different Directory:

    • Try executing the project from a different root directory to determine if the locking issue is path-specific.

If none of the above methods work, you can try resetting your npm cache with npm cache clean --force.

Lastly, ensure that your projectā€™s setup aligns with Needle Engineā€™s documentation precisely. Refer to the Needle Engine documentation for any specific setup instructions.

24 replies left
thread_a3jc1KE4mn1RFUw2ItLj92s9
Reply to this message to continue the conversation

Pretty much what the bot says ā€“ unfortunately this is an issue in Node.js itself that weā€™ve also seen a couple times, where an installation is only partially completed and Node canā€™t recover on its own. Manually deleting node_modules should fix the issue.

Just tried that and clicked install development server again in Blender after reopening the file with all processes ended and after install I get the same error. Wondering what is causing the file to be locked suddenly after it successfully installs.

Do you maybe have some overly aggressive antivir software running? Iā€™ve seen cases where these tend to grab ā€œnewā€ files and then may go rogue with anything that changes many files at once (like, installing packages)

I do have some company managed antivirus installed. It never impacted package installs before luckily, I just deleted the node_modules folder again and this time instead of clicking ā€˜Install Preview Serverā€™ before clicking ā€˜Start Preview Serverā€™, I just clicked ā€˜Start Preview Serverā€™ which seems to run the npm install then keeps the terminal open after and starts Vite and it runs fine now. Iā€™ll keep an eye on the issue as it has happened a few times on different blend files to see if this process is the fix.

1 Like

OK thanks ā€“ yeah if you find consistent repro steps that would be good of course!

@marcel @Felix_Herbst I have reproduced this on 2 personal windows 11 devices that simply have Windows Defender running and no managed antivirus, the same error happens there about the @needle-tools/helper folder being marked as busy after running local server then stopping it and trying to start it again:

npm error errno -4082
npm error EBUSY: resource busy or locked, rename'C:\Users\Downloads\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\helper' -> 'C:\Users\Downloads\Needle_Blender\blender samples\Sandbox\node_modules\@needle-tools\.helper-aycGCRWS'
npm error A complete log of this run can be found in: C:\Users\robye\AppData\Local\npm-cache\_logs\2024-12-02T13_08_34_329Z-debug-0.log

This is fully blocking me from using the Blender plugin currently. Blender version 4.3.0 on both machines and Needle Engine Exporter for Blender is 0.52.0 on both machines

I checked with Resource Monitor and couldnā€™t see anything locking the folder either

I have recorded what happens here, in one video I clear node modules then just try installing the Local Server and then try starting it. Same issue as before so then I delete node modules folder again and instead click ā€˜Start Local Serverā€™ which allows it to install then run once. Once it is running if I click stop server then try running start server again, the same issue as before with the busy/locked Needle Helper folder.

In the other video I try opening a sample scene from scratch, making it generate a web project then install and run the local server. When I stop running the local server and start it again, I also get the error about the locked Needle Helper folder.

  1. On my main work laptop where that file locked happesn everytime, I can only get the Needle Blender server to start by doing this:
  2. Delete the Node Modules folder
  3. Click Start Preview Server which installs it then runs it - (using the Install Preview server button then trying to Start the server after results in helper folder busy/locked).
  4. If you stop the server then try to start it again, the folder is locked

It makes Needle Blender plugin a real pain to use on my work laptop lately

My workaround now is to rename the helper folder manually to the folder name in the error busy log e.g. .helper-SRr2S37w then the server can start again on the next time I start it

Could you try updating to 0.52.1? I hope this fixes the issue for you

Actually ignore that - the issue wasnā€™t fixed until I manually installed the new addon version via the zip file in Blender addons rather than using the update dialogue on Blender start. Now the issue seems to be resolved in 0.52.1. Thanks for fixing as this was almost blocking me from using the Blender plugin for a while!

Thanks for the update and good to hear itā€™s resolved

When using the update dialogue: did you restart Blender after the update or did you see any error message regarding the automatic update?

I didnā€™t notice any upgrade warning message and the addons menu said it was the correct version. Iā€™ll test it on a spare laptop to see if the same happens there.

This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.