gildas-lormeau / single-file-cli

CLI tool for saving a faithful copy of a complete web page in a single HTML file (based on SingleFile)
GNU Affero General Public License v3.0
539 stars 57 forks source link

error: Uncaught (in promise) Error: The process cannot access the file because it is being used by another process. (os error 32) #92

Closed ashiflett0 closed 4 weeks ago

ashiflett0 commented 1 month ago

The single-file-cli hangs after converting several links to html. I CTRL+C to stop the process and see the following error message:

error: Uncaught (in promise) Error: The process cannot access the file because it is being used by another process. (os error 32): remove 'C:\Users\FORENS~1\AppData\Local\Temp\56d1091bd37c4771' at async Object.remove (ext:deno_fs/30_fs.js:260:3) at async closeBrowser (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/lib/browser.js:120:3) at async closeBrowserAndExit (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-launcher.js:122:2)

Any ideas what's causing this?

gildas-lormeau commented 1 month ago

For the moment, it's not clear to me why this error is occurring. When the problem occurs, do you notice that there are still Chrome-related processes in the task manager?

ashiflett0 commented 1 month ago

Yes, MS Edge processes are still running in the task manager. I have tried using different browsers such as Chrome and Chromium, and am still having the same issue.

gildas-lormeau commented 1 month ago

Thank you, this means that the program can't stop the browser for some reason. Do you run multiple single-file commands in parallel?

ashiflett0 commented 1 month ago

No, I am running just one instance of single-file-cli in Powershell 7 (admin). My commands are:

.\single-file.exe --urls-file C:\Users\xx\Desktop\URLs.txt --output-directory C:\Users\xx\Desktop\temp --save-original-URLs --browser-executable-path "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"

gildas-lormeau commented 1 month ago

I did a test with a list of 50 URLs with Edge on Windows but I wasn't able to reproduce the issue. When this bug occurs, are all the URLs in the list correctly saved?

ashiflett0 commented 1 month ago

Yes, they all appear to be properly formatted URLs. Here is the list of URLs I was using.

URLs.txt

gildas-lormeau commented 4 weeks ago

Thank you for your help, I was able to find the cause of the problem. The fix is available in the new version I've just published.