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(ui): Show error message when max pods to view logs are reached #21725

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pjiang-dev
Copy link

@pjiang-dev pjiang-dev commented Jan 31, 2025

Fixes #21706
Displays an error message in the logs when error message on "max pods to view logs are reached" when there are more than 10 pods for a deployment/replica set for better user experience.

Before:
407818866-f04a7e8a-ba2a-41d9-a84c-d4a8898e8c5a

After:
Screenshot 2025-01-30 at 3 50 39 PM

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@pjiang-dev pjiang-dev requested a review from a team as a code owner January 31, 2025 00:25
Copy link

bunnyshell bot commented Jan 31, 2025

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-g3umf3.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-g3umf3.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

@pjiang-dev pjiang-dev changed the title Pjiang dev/fix logs maxpod fix(ui) Show error message when max pods to view logs are reached Jan 31, 2025
@pjiang-dev pjiang-dev changed the title fix(ui) Show error message when max pods to view logs are reached fix(ui): Show error message when max pods to view logs are reached Jan 31, 2025
@pjiang-dev pjiang-dev marked this pull request as draft January 31, 2025 06:32
@pjiang-dev pjiang-dev force-pushed the pjiang-dev/fix-logs-maxpod branch 2 times, most recently from 17ee38e to 1f0dd19 Compare February 1, 2025 01:02
@pjiang-dev pjiang-dev marked this pull request as ready for review February 1, 2025 01:23
@pjiang-dev pjiang-dev force-pushed the pjiang-dev/fix-logs-maxpod branch from 1f0dd19 to d7272b6 Compare February 3, 2025 17:31
Comment on lines +73 to +80
// If there is an error, show it beforehand
fetch(fullUrl).then(response => {
if (!response.ok) {
return response.text().then(text => {
observer.error({status: response.status, statusText: response.statusText, body: text});
});
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the preflight request necessary? Wouldn't the onerror handler take care of this anyway?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crenshaw-dev The preflight request is needed because the onerror handler does not handle the HTTP request error (400 Bad Request) and swallows the error message.
Instead EventSource considers it a connection problem and throws the generic error('connection got closed unexpectedly')

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.

"max pods to view logs are reached" error is silent in the UI
2 participants