jamesmortensen / archiver-for-google-keep

Scrapes notes and checklists from Google Keep™ and writes them out as JSON and markdown archive/backup files. This tool is not affiliated or endorsed by Google™. Google Keep™ is a trademark of Google.
MIT License
8 stars 0 forks source link

Error: 'ECONNREFUSED' #1

Open binaryn3xus opened 1 year ago

binaryn3xus commented 1 year ago

The logs:

2022-10-13T01:43:01.712Z INFO devtools:puppeteer: Initiate new session using the DevTools protocol
2022-10-13T01:43:01.713Z INFO devtools: Launch Google Chrome with flags: --disable-popup-blocking --disable-extensions --disable-background-networking --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-sync --metrics-recording-only --disable-default-apps --mute-audio --no-first-run --no-default-browser-check --disable-hang-monitor --disable-prompt-on-repost --disable-client-side-phishing-detection --password-store=basic --use-mock-keychain --disable-component-extensions-with-background-pages --disable-breakpad --disable-dev-shm-usage --disable-ipc-flooding-protection --disable-renderer-backgrounding --force-fieldtrials=*BackgroundTracing/default/ --enable-features=NetworkService,NetworkServiceInProcess --disable-features=site-per-process,TranslateUI,BlinkGenPropertyTrees --window-position=0,0 --window-size=1200,900
2022-10-13T01:43:02.245Z INFO devtools: Connect Puppeteer with browser on port 32054
FetchError: Failed to fetch browser webSocket URL from http://localhost:32054/json/version: request to http://localhost:32054/json/version failed, reason: connect ECONNREFUSED ::1:32054
    at ClientRequest.<anonymous> (C:\Users\joshu\AppData\Roaming\npm\node_modules\archiver-for-google-keep\node_modules\node-fetch\lib\index.js:1491:11)
    at ClientRequest.emit (node:events:513:28)
    at ClientRequest.emit (node:domain:489:12)
    at Socket.socketErrorListener (node:_http_client:494:9)
    at Socket.emit (node:events:513:28)
    at Socket.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}

Screenshot:

image

jamesmortensen commented 1 year ago

Hi @JoshuaGarrison27 I do recall that on occasion I would start this up and it would fail to connect to the browser. Simply CTRL-Cing out of it and restarting generally worked. If It's persistent, then I'll need to dig in and see if I can replicate.

In the meantime, you might try using Chromedriver. WebdriverIO can use two different protocols to connect to Chrome, devtools is one, and WebDriver (via Chromedriver) is the other. Do you want to try with WebDriver protocol instead, in the meantime?

I also see you're on Windows. I haven't tried on this OS yet. Maybe there's some Windows firewall thing getting in the way?

Here's the instructions for using Chromedriver instead: See Other Protocols and Options:

Install Chromedriver's latest version:

$ npm install chromedriver@latest

Then start chromedriver listening on port 4444:

$ node_modules/chromedriver/bin/chromedriver --port=4444

In another terminal, you should then be able to start the archiver tool:

$ KEEP_DATA_DIR=./webdriver-data-dir npm start

Regarding the bug, my options are either find a way to bundle in chromedriver to avoid needing to manually start it, or report the devtools protocol issue to WebdriverIO and see if they can fix the problem.

If this doesn't work, another idea is you can try running it in a Linux Docker container, such as https://hub.docker.com/r/selenium/standalone-chrome. You can interact with the Linux desktop via port 5900 via a VNC client, or http://localhost:7900 via noVNC in your browser.

Thanks for trying it out!

binaryn3xus commented 1 year ago

I forgot to come back to this. I got it to finally run. I made a mistake when I got the windows firewall popup or something. After tinkering with several settings I finally got it to go through. I didn't make good notes so I cant give any input in that regard. I'll leave it up to you if you want to close this or not. In the end, issue was windows firewall.

jamesmortensen commented 1 year ago

I thought it might have something to do with the firewall. Glad you got it working. I'll leave this open because I think it would be helpful to detect firewall problems and then do extra logging like Did you check your firewall? . It would help point others in the right direction.