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

ROX-19281: Fix nil pointer dereference in E2E tests when Central is not ready #1216

Merged
merged 2 commits into from
Sep 22, 2023

Conversation

kovayur
Copy link
Contributor

@kovayur kovayur commented Aug 24, 2023

Description

When central state transition to ready and the test fails with timeout, central reference remains nil.
This change makes nil pointer dereference not possible and adds some information to the error message to make it more clear that Central is in a PENDING state.

Checklist (Definition of Done)

  • Unit and integration tests added
  • Added test description under Test manual
  • Documentation added if necessary (i.e. changes to dev setup, test execution, ...)
  • CI and all relevant tests are passing
  • Add the ticket number to the PR title if available, i.e. ROX-12345: ...
  • Discussed security and business related topics privately. Will move any security and business related topics that arise to private communication channel.
  • Add secret to app-interface Vault or Secrets Manager if necessary
  • RDS changes were e2e tested manually
  • Check AWS limits are reasonable for changes provisioning new resources

Test manual

CI

# To run tests locally run:
make db/teardown db/setup db/migrate
make ocm/setup OCM_OFFLINE_TOKEN=<ocm-offline-token> OCM_ENV=development
make verify lint binary test test/integration

@kovayur kovayur requested a review from porridge August 24, 2023 14:43
@kovayur kovayur temporarily deployed to development August 24, 2023 14:44 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development August 24, 2023 14:44 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development August 24, 2023 14:44 — with GitHub Actions Inactive
@kovayur kovayur force-pushed the yury/ROX-19281-panic-in-getHostedZone branch from a84cab4 to b090373 Compare August 24, 2023 14:47
@kovayur kovayur temporarily deployed to development August 24, 2023 14:47 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development August 24, 2023 14:47 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development August 24, 2023 14:47 — with GitHub Actions Inactive
@kovayur kovayur force-pushed the yury/ROX-19281-panic-in-getHostedZone branch from b090373 to b61cf27 Compare August 24, 2023 14:58
@kovayur kovayur temporarily deployed to development August 24, 2023 14:58 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development August 24, 2023 14:58 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development August 24, 2023 14:58 — with GitHub Actions Inactive
@porridge
Copy link
Collaborator

Failed to wait for container fleetshard-sync in pod application=fleetshard-sync in namespace acsms to become ready

Apparently stuck in ContainerCreating
🤷

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kovayur, porridge

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@porridge
Copy link
Collaborator

Same result... something fishy is going on...

== BEGIN LOG pod-logs_fleetshard-sync_fleetshard-sync.txt ==
I0829 05:34:28.428215       1 main.go:33] Starting application
I0829 05:34:28.428248       1 main.go:34] FleetManagerEndpoint: http://fleet-manager:8000/
I0829 05:34:28.428253       1 main.go:35] ClusterID: 1234567890abcdef1234567890abcdef
I0829 05:34:28.428257       1 main.go:36] RuntimePollPeriod: 10s
I0829 05:34:28.428261       1 main.go:37] AuthType: RHSSO
I0829 05:34:28.[428](https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/stackrox_acs-fleet-manager/1216/pull-ci-stackrox-acs-fleet-manager-main-e2e/1696393837515116544#1:build-log.txt%3A428)264       1 main.go:39] ManagedDB.Enabled: false
I0829 05:34:28.428267       1 main.go:40] ManagedDB.SecurityGroup: 
I0829 05:34:28.428271       1 main.go:41] ManagedDB.SubnetGroup: 
== END LOG pod-logs_fleetshard-sync_fleetshard-sync.txt ==
** END LOGS **
** BEGIN ACSMS PODS **
NAME                               READY   STATUS              RESTARTS   AGE
db-77b7bb5b4d-8djxm                1/1     Running             0          55s
fleet-manager-6fdb765956-pfrjg     1/1     Running             0          13s
fleetshard-sync-85c7b97ff5-sgh94   0/1     ContainerCreating   0          0s

@porridge
Copy link
Collaborator

porridge commented Sep 4, 2023

/retest
FTR fix for the flake this PR was experiencing is in ROX-19494

@porridge
Copy link
Collaborator

porridge commented Sep 4, 2023

Something is wrong here...

------------------------------
Central should be deployed and can be force-deleted should delete external DNS entries
/src/e2e/e2e_test.go:589
  Current time: 2023-09-04 09:41:23.398196828 +0000 UTC m=+911.236455325
  Central name: e2e-bde4d7b2b7789dc3
  Central ID: cjqqb1i0mpgvp49o2sq0
  [FAILED] in [It] - /src/e2e/e2e_test.go:610 @ 09/04/23 09:41:23.456
• [FAILED] [0.059 seconds]
Central should be deployed and can be force-deleted [It] should delete external DNS entries
/src/e2e/e2e_test.go:589
  [FAILED] Unexpected error:
      <public.GenericOpenAPIError>: 
      404 Not Found
      {
          body: [123, 34, 105, 100, 34, 58, 34, 55, 34, 44, 34, 107, 105, 110, 100, 34, 58, 34, 69, 114, 114, 111, 114, 34, 44, 34, 104, 114, 101, 102, 34, 58, 34, 47, 97, 112, 105, 47, 114, 104, 97, 99, 115, 47, 118, 49, 47, 101, 114, 114, 111, 114, 115, 47, 55, 34, 44, 34, 99, 111, 100, 101, 34, 58, 34, 82, 72, 65, 67, 83, 45, 77, 71, 77, 84, 45, 55, 34, 44, 34, 114, 101, 97, 115, 111, 110, 34, 58, 34, 67, 101, 110, 116, 114, 97, 108, 82, 101, 115, 111, 117, 114, 99, 101, 32, 102, 111, 114, 32, 117, 115, 101, 114, 32, 114, 104, 97, 99, 115, 45, 109, 115, 45, 116, 101, 115, 116, 64, 114, 101, 100, 104, 97, 116, 46, 99, 111, 109, 32, 119, 105, 116, 104, 32, 105, 100, 61, 39, 99, 106, 113, 113, 98, 49, 105, 48, 109, 112, 103, 118, 112, 52, 57, 111, 50, 115, 113, 48, 39, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 34, 44, 34, 111, 112, 101, 114, 97, 116, 105, 111, 110, 95, 105, 100, 34, 58, 34, 99, 106, 113, 113, 99, 103, 113, 48, 109, 112, 103, 118, 112, 52, 57, 111, 51, 48, 56, 48, 34, 125, 10],
          error: "404 Not Found",
          model: <public.Error>{
              Id: "7",
              Kind: "Error",
              Href: "/api/rhacs/v1/errors/7",
              Code: "RHACS-MGMT-7",
              Reason: "CentralResource for user [email protected] with id='cjqqb1i0mpgvp49o2sq0' not found",
              OperationId: "cjqqcgq0mpgvp49o3080",
          },
      }
  occurred
  In [It] at: /src/e2e/e2e_test.go:610 @ 09/04/23 09:41:23.456
  Full Stack Trace
    github.com/stackrox/acs-fleet-manager/e2e.getCentral({_, _}, _)
    	/src/e2e/e2e_test.go:610 +0x235
    github.com/stackrox/acs-fleet-manager/e2e.glob..func4.4.5()
    	/src/e2e/e2e_test.go:596 +0x125
------------------------------

@kovayur kovayur force-pushed the yury/ROX-19281-panic-in-getHostedZone branch from b61cf27 to 47b51b9 Compare September 22, 2023 16:04
@openshift-ci openshift-ci bot removed the lgtm label Sep 22, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 22, 2023

New changes are detected. LGTM label has been removed.

@kovayur kovayur temporarily deployed to development September 22, 2023 16:04 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development September 22, 2023 16:04 — with GitHub Actions Inactive
@kovayur kovayur temporarily deployed to development September 22, 2023 16:04 — with GitHub Actions Inactive
@kovayur kovayur merged commit edc992c into main Sep 22, 2023
@kovayur kovayur deleted the yury/ROX-19281-panic-in-getHostedZone branch September 22, 2023 18:05
kovayur added a commit that referenced this pull request Sep 26, 2023
* Use Openshift golang-1.20 builder image (#1275)

* Add kind cluster type (#1256)

* Refactor operator config to use field.Error (#1276)

* fix typo causing skip of DNS creation on restore (#1277)

* ROX-19718: Add flag for fleetmanager gitops (#1283)

* Specify reconcile interval in workers (#1265)

* Add request body to rotate-secrets endpoint (#1272)

* Disable automounting for egress proxy (#1286)

* ROX-19808: Remove GitOps admin handler (#1290)

Remove GitOps admin handler

* ROX-19692: Add a release preparation workflow. (#1284)

Prepare release workflow.

* ROX-19735 - add operator configs to gitops (#1278)

* ROX-19692: New workflow to auto-create production merge PRs. (#1291)

New workflow to auto-create production merge PRs.

* ROX-19810: Bump controller-runtime and stackrox deps (#1292)

* Bump controller-runtime and stackrox deps

* Bump openshift/api

* Call /current_account before reserving quota (#1289)

* Remove multi target build (#1259)

* fixed restore endpoint (#1298)

* ROX-19281: Fix nil pointer dereference in E2E tests when Central is not ready (#1216)

* Rename ACSMS -> ACSCS in dev scripts (#1252)

* Log result of current_account call execution (#1297)

* Cleanup errors.go (#1299)

---------

Co-authored-by: Vlad Bologa <[email protected]>
Co-authored-by: Simon Bäumer <[email protected]>
Co-authored-by: Johannes Malsam <[email protected]>
Co-authored-by: Ludovic Cleroux <[email protected]>
Co-authored-by: Ivan Degtiarenko <[email protected]>
Co-authored-by: Alex Rukletsov <[email protected]>
Co-authored-by: Marcin Owsiany <[email protected]>
Co-authored-by: Aleksandr Kurlov <[email protected]>
Co-authored-by: Yury Kovalev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants