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

e2e test case "TestAntctl/testAntctlProxy/AgentIPv4" always fails on branch feature/externalnode #3856

Closed
wenyingd opened this issue Jun 2, 2022 · 3 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@wenyingd
Copy link
Contributor

wenyingd commented Jun 2, 2022

Describe the bug
On feature branch feature/externalnode, e2e test case "TestAntctl/testAntctlProxy/AgentIPv4" always fails in kind test and CI e2e-test job after rebasing on the main branch.

Having added some log info with the failed case, I got this output:

    antctl_test.go:273: 'antctl proxy' command stdout: <>, stderr:<Error: error when creating Agent client config: no Antrea Agent found for Node name jenkins-antrea-e2e-for-pull-request-961-lw9m7

Looking into the code, the error log is output when antctl fails to read AntreaAgentInfo with the target Node name. It is possible to be related with the changes move the workflow of AntreaAgentInfo creation from Agent to Controller.

Following is samples of failed logs:
http://10.176.27.169:8080/job/antrea-e2e-for-pull-request/961/console
https://github.com/wenyingd/antrea/runs/6702775343?check_suite_focus=true

To Reproduce

  1. Rebase branch feature/externalnode on main
  2. Create a PR on the changes
  3. Run kind test or test-e2e

Expected
All tests are expected to pass

Actual behavior
Case "TestAntctl/testAntctlProxy/AgentIPv4" is failed.

Versions:
feature branch: feature/externalnode

@wenyingd wenyingd added the kind/bug Categorizes issue or PR as related to a bug. label Jun 2, 2022
@wenyingd
Copy link
Contributor Author

wenyingd commented Jun 6, 2022

Having added some debug info in antctl code where returns error, and got the followsing output:

antctl_test.go:273: 'antctl proxy' command stdout: <>, stderr:<Error: error when creating Agent client config: no Antrea Agent found for Node name kind-control-plane, exsiting agentInfo count 3, values kind-control-plane,kind-worker,kind-worker2

The changed code in path pkg/antctl/raw/helper.go is like this,

@@ -96,7 +98,12 @@ func CreateAgentClientCfg(k8sClientset kubernetes.Interface, antreaClientset ant
                }
        }
        if agentInfo == nil {
-               return nil, fmt.Errorf("no Antrea Agent found for Node name %s", nodeName)
+               existingAgentInfos := sets.String{}
+               for i := range agentInfoList.Items {
+                       ai := agentInfoList.Items[i]
+                       existingAgentInfos.Insert(ai.Name)
+               }
+               return nil, fmt.Errorf("no Antrea Agent found for Node name %s, exsiting agentInfo count %d, values %s", nodeName, len(existingAgentInfos), strings.Join(existingAgentInfos.List(), ","))
        }

@mengdie-song
Copy link
Contributor

I am looking into it and will make a fix.

XinShuYang pushed a commit to mengdie-song/antrea that referenced this issue Jun 7, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit that referenced this issue Jun 9, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:#3856

Signed-off-by: Mengdie Song <[email protected]>
@mengdie-song
Copy link
Contributor

Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller for branch feature/externalnode, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

I have merged a change which adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

I haven't seen the failure with the change in the latest several runs, mark it fixed.

wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jun 9, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jun 27, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jun 27, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jun 28, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jun 28, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jul 12, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Jul 27, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 3, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 3, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 3, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 8, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 8, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 8, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
mengdie-song added a commit to mengdie-song/antrea that referenced this issue Aug 8, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Aug 10, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
wenyingd pushed a commit to wenyingd/antrea that referenced this issue Aug 11, 2022
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
heanlan pushed a commit to heanlan/antrea that referenced this issue Mar 29, 2023
Command "antctl proxy --agent-node" requires the information from AntreaAgentInfo.
As a result, we need to make sure the content of AntreaAgentInfo is populated before
we run the command.

Since we recently move AntreaAgentInfo creation from agent to controller, agent may
not set the content for AntreaAgentInfo when it starts if controller has not created the AntreaAgentInfo.
In this case, it will take a minute for agent to update the content in its next try.

This change adds retry logics in the antctl proxy e2e test and it will only invoke the command
after AntreaAgentInfo is ready.

Fixes:antrea-io#3856

Signed-off-by: Mengdie Song <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants