StackStorm / StackStorm/st2

Proposal: Change st2client defaults to bypass proxy for localhost

Open
#3,890 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement proposal
Dominant language
Python
Stars
6.5k
Forks
787
PR merge metrics
No merged PRs in 30d

Description

When executing st2 <x> commands, st2client will inherit the environment's proxy settings. This is a good thing if you happen to be running those commands from a separate system, and you need to go via a proxy to reach the ST2 server.

But if you are running those commands on the ST2 server itself, then st2client is connecting to URLs like http://127.0.0.1:9100/tokens. If you have a proxy configured, you will get an error message like:

Failed to log in as USERID: 403 Client Error: Forbidden
Unable to retrieve detailed message from the HTTP response. Expecting value: line 1 column 1 (char 0)
 for url: http://127.0.0.1:9100/tokens

This is very confusing for users. The problem is that st2client is making a request to the proxy server for 127.0.0.1. This is never going to work. There is no way a proxy can ever work for connections to loopback.

Our current advice to users is to tell them to configure export no_proxy=localhost,127.0.0.1. That works, but it is annoying.

Proposal: Change the defaults so we always bypass the proxy when connecting to localhost or 127.0.0.1. This will reduce confusion, and reduce support issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the st2client code used by st2 <x> commands to construct HTTP requests and apply proxy settings. Check how connections to localhost and 127.0.0.1 are handled, then identify or add relevant tests showing that proxy use is bypassed for loopback URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.