connection error ECONNREFUSED when target is set to NGINX reverse proxy
See original GitHub issueVersion info:
Artillery Core: 2.0.0-27
Artillery Pro: not installed (https://artillery.io/product)
Node.js: v18.12.1
OS: win32
Running this command:
<command>
I expected to see this happen:
Metrics for period to: 23:05:50(-0500) (width: 2.253s)
http.codes.302: … 15 http.codes.404: … 15 http.request_rate: … 15/sec http.requests: … 30 http.response_time: min: … 0 max: … 13 median: … 1 p95: … 2 p99: … 3 http.responses: … 30 vusers.completed: … 15 vusers.created: … 15 vusers.created_by_name.add new notes: … 15 vusers.failed: … 0 vusers.session_length: min: … 6.6 max: … 30.2 median: … 14.2 p95: … 26.3 p99: … 26.3
Instead, this happened:
Phase started: Warm up (index: 0, duration: 60s) 22:29:32(-0500)
Metrics for period to: 22:29:40(-0500) (width: 6.268s)
errors.ECONNREFUSED: … 25 http.request_rate: … 5/sec http.requests: … 35 vusers.created: … 35 vusers.created_by_name.add new notes: … 35 vusers.failed: … 25
Warning: multiple batches of metrics for period 1668569370000 2022-11-16T03:29:30.000Z
Metrics for period to: 22:29:50(-0500) (width: 9.267s)
errors.ECONNREFUSED: … 50 http.request_rate: … 5/sec http.requests: … 50 vusers.created: … 50 vusers.created_by_name.add new notes: … 50 vusers.failed: … 50
Warning: multiple batches of metrics for period 1668569380000 2022-11-16T03:29:40.000Z
Metrics for period to: 22:30:00(-0500) (width: 9.259s)
errors.ECONNREFUSED: … 50 http.request_rate: … 5/sec http.requests: … 50 vusers.created: … 50 vusers.created_by_name.add new notes: … 50 vusers.failed: … 50
Files being used:
config:
target: "http://mycomputer"
phases:
- duration: 60
arrivalRate: 5
name: Warm up
payload:
path: "notes.csv"
fields:
- "note"
scenarios:
- name: "add new notes"
flow:
- post:
url: "/new_note"
form:
note: "{{ note }}"
When set DEBUG=http, I got the output with errors.ECONNREFUSED:
I am running an Express app listening at localhost on port 5001. I also set up an NGINX server as a reverse proxy pointing to the Express app on the same host. Artillery seems not able to connect to NGINX. However, if the target is set to ‘127.0.0.1:5001’, i.e., the backend, the test went through ok.
I should mention the NGINX proxy has no problem as both chrome and curl can access the Express app.
Does Artillery not support testing via proxy? Or I missed something. Sorry first time user of Artillery here.
Thank you.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
After switching to IP address, Artillery works fine. So it is a Node problem. Thanks for the efforts. Appreciated. Cheers,
This looks like the issue we’re seeing here: https://github.com/node-fetch/node-fetch/issues/1624