Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No connection could be made #149

Open
Unknow0059 opened this issue Jan 22, 2025 · 4 comments
Open

No connection could be made #149

Unknow0059 opened this issue Jan 22, 2025 · 4 comments

Comments

@Unknow0059
Copy link

I'm using the latest version of SFC and providing the two positional arguments fails to save a page, with an error.

I don't know what this error message means, but here:

error sending request for url (http://localhost:9369/json/new?about:blank): client error (Connect): tcp connect error: No connection could be made because the target machine actively refused it. (os error 10061): No connection could be made because the target machine actively refused it. (os error 10061) [2025-01-22T09:19:12.938Z] URL: myurlgoeshere

Child process has already terminated
error: Uncaught (in promise) TypeError: Child process has already terminated
    at ChildProcess.kill (ext:runtime/40_process.js:355:13)
    at closeBrowser (file:///C:/Users/myuserhere/AppData/Local/Temp/deno-compile-single-file.exe/single-file-cli/lib/browser.js:116:9)
    at closeBrowserAndExit (file:///C:/Users/myuserhere/AppData/Local/Temp/deno-compile-single-file.exe/single-file-cli/single-file-launcher.js:137:8)
    at run (file:///C:/Users/myuserhere/AppData/Local/Temp/deno-compile-single-file.exe/single-file-cli/single-file-launcher.js:107:9)
    at eventLoopTick (ext:core/01_core.js:175:7)
    at async file:///C:/Users/myuserhere/AppData/Local/Temp/deno-compile-single-file.exe/single-file-cli/single-file:5:1

I've tried various URLs, doesn't matter.
I've tried different using different chromes in --browser-executable-path, doesn't matter.

@gildas-lormeau
Copy link
Owner

It looks like the browser crashed, what do you see if you use the --browser-debug option? (you need to press the play button in the DevTools after the browser is opened)

@mrfuggy
Copy link

mrfuggy commented Jan 30, 2025

I encountered the same problem when I upgraded from version v2.0.38. I checked the latest version v2.0.73 and the same error.
I don't use an external browser. With the debug option --browser-debug I don't see any additional information or window.
I checked the bisect of previous versions and found out that version v2.0.41 works, but version v2.0.43 doesn't work anymore. I hope this helps to clarify the error.
Logs from v2.0.43:

error sending request for url (http://localhost:9433/json/new?about:blank): error trying to connect: tcp connect error: No connection could be made because the target machine activ
ely refused it. (os error 10061) URL: https://url
Stack: TypeError: error sending request for url (http://localhost:9433/json/new?about:blank): error trying to connect: tcp connect error: No connection could be made because the ta
rget machine actively refused it. (os error 10061)
    at async mainFetch (ext:deno_fetch/26_fetch.js:170:12)
    at async fetch (ext:deno_fetch/26_fetch.js:391:7)
    at async https://jsr.io/@simple-cdp/simple-cdp/1.8.5/mod.js:214:24
    at async retryConnection (https://jsr.io/@simple-cdp/simple-cdp/1.8.5/mod.js:237:16)
    at async Module.getPageData (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/lib/cdp-client.js:52:16)
    at async capturePage (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-cli-api.js:246:20)
    at async runNextTask (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-cli-api.js:159:20)
    at async Promise.all (index 0)
    at async capture (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-cli-api.js:110:2)
    at async run (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-launcher.js:88:3)

Child process has already terminated.
error: Uncaught (in promise) TypeError: Child process has already terminated.
    at ChildProcess.kill (ext:runtime/40_process.js:349:13)
    at closeBrowser (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/lib/browser.js:116:9)
    at closeBrowserAndExit (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-launcher.js:122:8)
    at run (file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file-launcher.js:92:9)
    at eventLoopTick (ext:core/01_core.js:168:7)
    at async file:///Users/gildas/Desktop/Dev/project-single-file/single-file-cli/single-file:5:1

@gildas-lormeau
Copy link
Owner

gildas-lormeau commented Jan 30, 2025

@mrfuggy Are you using a firewall? The error message ("the target machine actively refused it. (os error 10061)") suggests a firewall is blocking the connection.

@Unknow0059
Copy link
Author

Unknow0059 commented Feb 2, 2025

It looks like the browser crashed, what do you see if you use the --browser-debug option? (you need to press the play button in the DevTools after the browser is opened)

with the command

"E:\Portable\SingleFile CLI webpage downloader\single-file.exe" ^
www.foofoo.com ^
--output-directory "bar\bar\bar\webpages\" ^
--browser-executable-path "foo\foo\foo\chrome.exe" ^
--browser-debug ^
--console-messages-file SingleFileConsoleLog.txt ^
--debug-messages-file SingleFileDebugLog.txt ^
--errors-file SingleFileErrorsLog.txt

I'm not shown any additional information;
None of those three declared files are written to anywhere;
and the browser doesn't open.

Yes, I have tried from an admin command prompt.

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

No branches or pull requests

3 participants