question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

connection error ECONNREFUSED when target is set to NGINX reverse proxy

See original GitHub issue

Version 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:open
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bssrdfcommented, Nov 16, 2022

Interesting, thanks for the extra details @bssrdf. How is that merlin hostname set up, is that an entry in the hosts file on the machine? I would guess this has to do with differences in DNS resolution between Node.js and curl/Chrome. Could you check if Artillery works as expected if you use the IP address instead of the hostname?

After switching to IP address, Artillery works fine. So it is a Node problem. Thanks for the efforts. Appreciated. Cheers,

0reactions
hassycommented, Nov 16, 2022

This looks like the issue we’re seeing here: https://github.com/node-fetch/node-fetch/issues/1624

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connection refused) while connecting to upstream
Hi all,. Followed this tutorial to get Let's Encrypt working on my Nest.js/Node server. Everything works - running sudo nginx -t returns:.
Read more >
[SOLVED] Nginx Error Log: Connection refused
Hello everyone,. my Mattermost Instances are working well, but I found out that they produce a lot of erros in my nginx error...
Read more >
Connection refused on Nginx Reverse Proxy
When I checked the nginx error logs, it was saying it could not connect to the upstream (which is the CDN). I want...
Read more >
WebSocket connection failed errors after upgrade to Next. ...
I am using a custom server (only in local development) to proxy the socket requests. I am not using Nginx. I am getting...
Read more >
Avoiding the Top 10 NGINX Configuration Mistakes
Not enough file descriptors per worker · The error_log off directive · Not enabling keepalive connections to upstream servers · Forgetting how ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found