RamenDR / ramen

Apache License 2.0
70 stars 51 forks source link

Test docs updates #1466

Closed nirs closed 2 weeks ago

nirs commented 2 weeks ago
par97 commented 2 weeks ago

The docs seem good.

But the e2e run failed. It reports:

      drenv.commands.Error: Command failed:
         command: ('argocd', 'app', 'create', 'guestbook-rdr-dr1', '--repo=https://github.com/argoproj/argocd-example-apps.git', '--path=guestbook', '--dest-name=rdr-dr1', '--dest-namespace=argocd-test', '--sync-option=CreateNamespace=true', '--sync-policy=automated')
         exitcode: 20
         error:
            time="2024-06-21T01:52:50+05:30" level=fatal msg="rpc error: code = InvalidArgument desc = existing application spec is different, use upsert flag to force update"

The error message seems to tell that there is already an application with name guestbook-rdr-dr1 in the rdr-dr1 cluster, but with different spec. Please check if it is true.

ShyamsundarR commented 2 weeks ago

The error message seems to tell that there is already an application with name guestbook-rdr-dr1 in the rdr-dr1 cluster, but with different spec. Please check if it is true.

Merged the argocd cleanup PR (which may correct this?), as this is docs related merging this as well.

nirs commented 2 weeks ago

The docs seem good.

But the e2e run failed. It reports:

      drenv.commands.Error: Command failed:
         command: ('argocd', 'app', 'create', 'guestbook-rdr-dr1', '--repo=https://github.com/argoproj/argocd-example-apps.git', '--path=guestbook', '--dest-name=rdr-dr1', '--dest-namespace=argocd-test', '--sync-option=CreateNamespace=true', '--sync-policy=automated')
         exitcode: 20
         error:
            time="2024-06-21T01:52:50+05:30" level=fatal msg="rpc error: code = InvalidArgument desc = existing application spec is different, use upsert flag to force update"

The error message seems to tell that there is already an application with name guestbook-rdr-dr1 in the rdr-dr1 cluster, but with different spec. Please check if it is true.

@par97, The issue is that the current argocd command is not idempotent as it should be.

The first try failed with a timeout (60 seconds) waiting for the app to become healthy. The entire test finish in 20 seconds locally, but in the lab we have unreliable network, and the entire env is very busy with up to 6 concurrent installs running. We may need to increase the timeout but for now it served us well, showing the issue with the argocd command.

Looking at the error message from the second and third attempts, we are missing the --upsert flag which will make the command idempotent. https://github.com/argoproj/argo-cd/issues/238

It can be easily reproduced locally by causing the the test script to fail after creating the app and running it again.

I don't know why the spec is different, we install the same application so the spec should be the same, maybe it is another argocd bug. For our purpose, we don't care if the spec changed, we want to install the app using the current spec.

nirs commented 2 weeks ago

Fixed in #1468

par97 commented 2 weeks ago

tested too, yes, this seems a bug in argocd command. after create it again using --upsert, it says "application 'guestbook-rdr-dr1' unchanged" and the spec is the same after the 2nd create.

nirs commented 2 weeks ago

Do you want to open an argocd issue?

par97 commented 1 week ago

opened issue: https://github.com/argoproj/argo-cd/issues/18794