zachleat / speedlify

Benchmark the web performance and accessibility of sites over time.
https://www.speedlify.dev/
MIT License
924 stars 167 forks source link

Connection refused on localhost (when selfhosting) #71

Open tarasis opened 8 months ago

tarasis commented 8 months ago

I was trying to self host speedlify on a VPS I have rather than netlify.

When I run it on the VPS (x86_64), and also on my Rapsberry PI running Raspbian Bookworm I get the following error

VPS Results

rob@kvm-ams:~/speedlify$ npm run test-pages

> speedlify@1.0.0 test-pages
> node run-tests

There are no known last run timestamps
First tests for galshaw.
Testing 1 site:
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: connect ECONNREFUSED 127.0.0.1:39819
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 39819
}

Node.js v18.17.1
rob@kvm-ams:~/speedlify$ 

----

PI Results

tarasis@rp4b:~/git-repos/speedlify $ npm run test-pages

> speedlify@1.0.0 test-pages
> node run-tests

There are no known last run timestamps
First tests for galshaw.
Testing 1 site:
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: connect ECONNREFUSED 127.0.0.1:40835
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1602:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 40835
}

Node.js v21.6.1

However on my Mac* & Netlify it runs perfectly.

Last runs at start:  {}
First tests for galshaw.
Testing 1 site:
(Site 1 of 1, run 1 of 3): https://galshaw.it
(Site 1 of 1, run 2 of 3): https://galshaw.it
(Site 1 of 1, run 3 of 3): https://galshaw.it
Axe scan (1 of 1) for https://galshaw.it
Writing ./_data/results/e8b5024f/date-1706963769478.json.
Finished testing "galshaw".
Last runs after "galshaw": {"galshaw":{"timestamp":1706963790553}}
Akashic101 commented 5 months ago

I am running into the same problem on my Pi3, the issue seems to be the same as #65. I am unsure how to fix this, the comments in that issue didn't really help as setting the path of chrome (or Firefox) using executablePath: '/usr/bin/chrome-browser', did not work. Whats also weird is that the port printed out from the error is always different. Did you found a solution to this problem in the end?

Note: Speedlify runs perfectly fine on my Win10-PC and my Ubuntu-server with no chances needed. Perhaps an issue with the Pi being ARM64 and not AMD64?