Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the proxy command not detecting that the stream had closed remotely #799

Conversation

JoshuaWilkes
Copy link
Contributor

What changed?

This PR fixes an issue where a database client would hang despite the stream connection being closed.

Why?

This can happen when for example the proxy server has an error connecting to the target database. The proxy will log an error and close the stream, however Granted was not able to detect that the stream was closed and so it did not close its own connection to the database client.

How did you test it?

Tested locally by simulating database connection errors , the mysql client now reports a failure to connect instead of just hanging.

mysql> select * from users;
No connection. Trying to reconnect...
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 2
ERROR: 
Can't connect to the server

Potential risks

Is patch release candidate?

yes

Link to relevant docs PRs

@JoshuaWilkes JoshuaWilkes merged commit eeec10e into main Nov 12, 2024
3 checks passed
@JoshuaWilkes JoshuaWilkes deleted the josh/cf-3675-any-rds-connection-error-should-be-returned-to-the-user branch November 12, 2024 01:46
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 18, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [common-fate/granted](https://github.com/common-fate/granted) | minor | `v0.35.1` -> `v0.36.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>common-fate/granted (common-fate/granted)</summary>

### [`v0.36.3`](https://github.com/common-fate/granted/releases/tag/v0.36.3)

[Compare Source](common-fate/granted@v0.36.2...v0.36.3)

#### Changelog

-   [`8785167`](common-fate/granted@8785167) Revert additional stream closed polling on proxy command ([#&#8203;802](common-fate/granted#802))
-   [`8547465`](common-fate/granted@8547465) use sso role name from grant output for eks and rds access ([#&#8203;803](common-fate/granted#803))

Download this release by following our [getting started guide](https://docs.commonfate.io/granted/getting-started).

### [`v0.36.2`](https://github.com/common-fate/granted/releases/tag/v0.36.2)

[Compare Source](common-fate/granted@v0.36.1...v0.36.2)

#### Changelog

-   [`eeccfba`](common-fate/granted@eeccfba) Add Vivaldi browser support ([#&#8203;797](common-fate/granted#797))
-   [`eeec10e`](common-fate/granted@eeec10e) Fix the proxy command not detecting that the stream had closed remotely ([#&#8203;799](common-fate/granted#799))
-   [`062ec34`](common-fate/granted@062ec34) Re authenticate with common fate during registry sync if token is expired ([#&#8203;798](common-fate/granted#798))
-   [`b165600`](common-fate/granted@b165600) Service flag support for AWS Organizations ([#&#8203;800](common-fate/granted#800))
-   [`cc23acc`](common-fate/granted@cc23acc) fix: pass external_id for credential process and IAM ([#&#8203;790](common-fate/granted#790))

Download this release by following our [getting started guide](https://docs.commonfate.io/granted/getting-started).

### [`v0.36.1`](https://github.com/common-fate/granted/releases/tag/v0.36.1)

[Compare Source](common-fate/granted@v0.36.0...v0.36.1)

#### Changelog

-   [`fd86607`](common-fate/granted@fd86607) Switch out huh for survey with a custom renderer template ([#&#8203;794](common-fate/granted#794))

Download this release by following our [getting started guide](https://docs.commonfate.io/granted/getting-started).

### [`v0.36.0`](https://github.com/common-fate/granted/releases/tag/v0.36.0)

[Compare Source](common-fate/granted@v0.35.2...v0.36.0)

#### What's Changed

-   RDS Plugin: Allow server specified default port by [@&#8203;VigneshSelvaraj96](https://github.com/VigneshSelvaraj96) in common-fate/granted#788
-   Add Granted EKS Proxy command by [@&#8203;JoshuaWilkes](https://github.com/JoshuaWilkes) in common-fate/granted#787
-   update handling for ports in proxy commands by [@&#8203;JoshuaWilkes](https://github.com/JoshuaWilkes) in common-fate/granted#789

**Full Changelog**: common-fate/granted@v0.35.2...v0.36.0

### [`v0.35.2`](https://github.com/common-fate/granted/releases/tag/v0.35.2)

[Compare Source](common-fate/granted@v0.35.1...v0.35.2)

#### What's Changed

-   Changes waf shortcut to use v2 home page, rather than WAF classic home. by [@&#8203;CodyDunlap](https://github.com/CodyDunlap) in common-fate/granted#775
-   Fix service map comma and formatting by [@&#8203;chrnorm](https://github.com/chrnorm) in common-fate/granted#776
-   update asdf tool-versions golang to 1.22 by [@&#8203;chrnorm](https://github.com/chrnorm) in common-fate/granted#774
-   tidy unused packages and variables by [@&#8203;chrnorm](https://github.com/chrnorm) in common-fate/granted#773
-   RDS proxy command should be filterable by [@&#8203;JoshuaWilkes](https://github.com/JoshuaWilkes) in common-fate/granted#777
-   feat: sort service map and add aws bedrock as a recognized service. by [@&#8203;felipewnp](https://github.com/felipewnp) in common-fate/granted#784

#### New Contributors

-   [@&#8203;felipewnp](https://github.com/felipewnp) made their first contribution in common-fate/granted#784

**Full Changelog**: common-fate/granted@v0.35.1...v0.35.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants