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

[Fleet] Unable to return to "Add Agent" flow in flyout when a Fleet Server policy is selected from the dropdown #130892

Closed
kpollich opened this issue Apr 25, 2022 · 7 comments · Fixed by #135747
Assignees
Labels
bug Fixes for quality problems that affect the customer experience QA:Validated Issue has been validated by QA Team:Fleet Team label for Observability Data Collection Fleet team v8.4.0

Comments

@kpollich
Copy link
Member

When selecting a policy in the "Add Agent" flyout, Fleet will detect when a policy including the Fleet Server integration is selected. When a Fleet Server policy is selected from this dropdown, we display a set of instructions specific to setting up an instance of Fleet Server, rather than the "plain" agent instructions.

As of #127786, we display the new Fleet Server flyout's "Advanced" tab contents in this UI. This affords us some clean re-use of the existing interface and implementation around setting up a Fleet Server that appears elsewhere in the app.

However, the "Advanced" tab's policy selection dropdown includes logic such that it only includes policies with the Fleet Server integration. The thinking here is that when you are setting up a Fleet Server, we should only show you eligible policies against which that Fleet Server can run.

This logic introduces a "stuck" state wherein the user can perform the following

  1. Click "Add Agent" button to open the enrollment flyout
  2. Select a policy that includes the Fleet Server integration from the policy dropdown
  3. Observe the instructions switching to the Fleet Server instructions
  4. Attempt to select a policy from the dropdown
  5. User is unable to return to the "plain agent" flow within the flyout
Screen.Recording.2022-04-20.at.10.53.46.AM.mov

The workaround to this "stuck" state is to simply close the flyout and restart the enrollment process.

In a conversation offline with @dborodyansky, he mentioned potentially creating a dedicated "Add Fleet Server" button in addition to our "Add Agent" button that would potentially alleviate these issues. If we excluded Fleet Server policies from the "Add Agent" flyout and only included Fleet Server policies in the "Add Fleet Server" flyout without any kind of intelligent/dynamic swap-out of the instructions for each workflow we could likely avoid this issue.

@kpollich kpollich added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 25, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kpollich
Copy link
Member Author

After reviewing various offline conversations and some mockups, I believe the root fix for this issue is to more cleanly separate the "Add Agent" and "Add Fleet Server" workflows. Our existing logic to dynamically "swap out" the instruction set in the "Add Agent" flyout based on whether an agent policy containing the fleet_server integration is buggy as evidenced by this issue, and also adds confusion when the entire contents of the flyout are dynamically altered during onboarding.

As part of the design discussion for #80841, @dborodyansky proposed adding a separate "Add Fleet Server" button on the /agents listing page. e.g.

image

Having this separate CTA specifically for adding a Fleet Server will help us avoid issues like the one reported here that come about because we're being "predictive" in our approach to onboarding with these flyouts.

Proposed implementation to fix this issue:

  • Add a dedicated "Add Fleet Server" button to the /agents page, as pictured above
  • Clicking "Add Fleet Server" should open the fleet server flyout
  • Remove the logic in the "Add Agent" flyout to detect whether a policy containing the fleet_server integration has been selected
  • Do not include policies that contain the fleet_server integration in the "Add Agent" flyout's policy dropdown*

On the last point, I'm not completely sure if this is required or desirable. Do we (or should we) support enrolling a "plain agent" in a policy that includes the fleet_server integration? @joshdover @nchaulet maybe you have an answer here?

@jen-huang
Copy link
Contributor

@kpollich This proposal looks good for me, I just tested the setup/enrollment flow on main and ran into the same issue so separating the two enrollment types makes sense to me. As discussed, let's keep this enhancement within 8.3 but treat it as lower priority (like a stretch goal).

On the last point, I'm not completely sure if this is required or desirable. Do we (or should we) support enrolling a "plain agent" in a policy that includes the fleet_server integration?

Today, a regular agent enrolled into a policy that contains fleet_server seems to ignore that integration. If there are other integrations in that policy, it will execute those just fine. The product question of delineating Fleet Server policies vs regular ones is valid. An argument could be made that a user might fine-tune a Fleet Server policy differently than they would a "regular" policy so maybe we should treat them differently. For now, since the behavior is not breaking, I recommend to show users all policies when enrolling regular agents.

@juliaElastic
Copy link
Contributor

@kpollich I noticed another potential bug when enrolling Fleet Server for the first time with docker:
Steps:

  1. Follow Quick start to add Fleet Server host, generate a policy.
  2. Copy the service token to the fleet server docker enroll command and run the command.
  3. Wait until Fleet UI notices that Fleet Server is connected.
  4. When clicking on "Continue enrolling Elastic Agent, the Add agent flyout opens with Run standalone tab by default. The Enroll in Fleet tab shows the text to add a Fleet Server. There is no way to get past that to enroll an actual Agent for Fleet unless doing the Fleet Server steps again.
  5. After closing the flyout and trying to navigate back and forth from Agents tab, the Agent list is still not showing up.
  6. Only after reloading the page, the Agent list shows up.

image
image

@kpollich
Copy link
Member Author

kpollich commented May 2, 2022

Thanks for the detailed bug report, @juliaElastic - I think this is the same bug that we have in #131030.

cc @criamico - I think you're eventually taking a look at the issue above, and the root fix may also address this issue with the Fleet Server flyout.

@nchaulet
Copy link
Member

nchaulet commented May 9, 2022

On the last point, I'm not completely sure if this is required or desirable. Do we (or should we) support enrolling a "plain agent" in a policy that includes the fleet_server integration? @joshdover @nchaulet maybe you have an answer here?

We should probably not allow a user to enroll an agent in a policy with the Fleet server integration without the fleet server extra cli arguments as this will result in an unhealthy agent.

@amolnater-qasource
Copy link

Hi @kpollich
We have revalidated this issue on latest 8.4 Snapshot and found it fixed.

  • We have two separate buttons- Add Agent and Add Fleet Server available under Agents tab.

Build details:
8.4 Snapshot
BUILD: 54378
COMMIT: 17a2bcc

Screenshot:
16

Hence marking this QA:Validated.
Thanks

@amolnater-qasource amolnater-qasource added the QA:Validated Issue has been validated by QA label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience QA:Validated Issue has been validated by QA Team:Fleet Team label for Observability Data Collection Fleet team v8.4.0
Projects
None yet
6 participants