Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Index conflicts generated by logs #810

Closed
pierluigilenoci opened this issue Aug 2, 2021 · 15 comments
Closed

Index conflicts generated by logs #810

pierluigilenoci opened this issue Aug 2, 2021 · 15 comments
Labels

Comments

@pierluigilenoci
Copy link
Contributor

The pod produces the payload.code field with two different types of data:

String:

"payload": {
      "message": "Secrets Manager can't find the specified secret value for staging label: AWSCURRENT",
      "code": "ResourceNotFoundException",
      "time": "2021-07-31T21:59:32.112Z",
      "requestId": "3bb8bc86-709e-444d-a723-40e4efd25af8",
      "statusCode": 400,
      "retryable": false,
      "retryDelay": 6.982864466638317
    },

Long:

"payload": {
      "code": 422,
      "statusCode": 422
    },

If this log is sent to an ES cluster it creates an index conflict.

Screenshot 2021-08-02 at 17 13 56

Can you fix this behavior?

@pierluigilenoci
Copy link
Contributor Author

@Flydiverny could you please take a look?

@pierluigilenoci
Copy link
Contributor Author

@stephenthedev @Flydiverny could you please take a look?

@Flydiverny
Copy link
Member

Do you have any related error message for when the two occur and/or log level for them? Not sure where the second variant originates from:

"payload": {
      "code": 422,
      "statusCode": 422
    },

Are both with the message failure while polling the secret <namesapce>/<es-name>?

@pierluigilenoci
Copy link
Contributor Author

At this moment I have no 422 errors present but 500 errors, I hope it goes well anyway.

{"level":"error","message_time":"2021-07-23T23:00:06.151Z","pid":18,"hostname":"kubernetes-external-secrets-5b5667b5c4-m2xdp","payload":{"code":500,"statusCode":500},"msg":"failure while polling the secret [REDACTED]/[REDACTED]"}

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Dec 2, 2021
@pierluigilenoci
Copy link
Contributor Author

@vladlosev @adutchak-x @davesteinberg @Flydiverny could you please take a look?

@github-actions github-actions bot removed the Stale label Dec 4, 2021
@vladlosev
Copy link
Contributor

I am not a project maintainer so take my words with a grain of salt but it looks like it will be possible to do what you need. There are six occurrences of error logging in the code:

MacBook-Pro-4:kubernetes-external-secrets vlad$ grep -rnI --exclude='*/node_modules/*' '[.]error(' .
./bin/daemon.js:46:    logger.error('CRD installation check failed, statusCode: %s', err.statusCode)
./lib/backends/secrets-manager-backend.js:70:    this._logger.error(`Unexpected data from Secrets Manager secret ${key}`)
./lib/poller.js:138:      this._logger.error(err, `failure while polling the secret ${this._namespace}/${this._name}`)
./lib/poller.js:237:        this._logger.error(err, `failure while updating status for externalsecret ${this._namespace}/${this._name}`)
./lib/poller.js:388:      this._logger.error(err, `status check went boom for ${this._namespace}/${this._name}`)
./lib/external-secret.js:88:    logger.error(err, 'Watcher for namespace %s crashed', loggedNamespaceName)
MacBook-Pro-4:kubernetes-external-secrets vlad$

I should be possible to amend them all to stringify err.code if it's present. Do you want to submit a PR?

Of course, it's also possible to work around the issue by modifying your Logstash filters to do the same for pasyload.code, with the filter looking something like this:

    filter {
      mutate {
        convert => {
          "[response][code]" => "string"
        }
      }
    }

@pierluigilenoci
Copy link
Contributor Author

@vladlosev before investing time in a PR i would like to know from @Flydiverny if it makes sense to do it for this.

@Flydiverny
Copy link
Member

I'll happily review a PR when time permits but I don't think I'll have time to dig into this myself.
Please also see #864

@pierluigilenoci
Copy link
Contributor Author

@Flydiverny I tagged you for exactly this reason.
Does it make sense to make these changes when the software has been "deprecated" anyway?

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Mar 8, 2022
@pierluigilenoci
Copy link
Contributor Author

@Flydiverny could you please take a look?

@github-actions github-actions bot removed the Stale label Mar 10, 2022
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@pierluigilenoci
Copy link
Contributor Author

@Flydiverny obviously this is deprecated and therefore it makes no sense to make changes.
But how is the new software from this point of view?

@Flydiverny
Copy link
Member

@Flydiverny obviously this is deprecated and therefore it makes no sense to make changes. But how is the new software from this point of view?

I actually don't know, in the end I haven't been much involved in ESO after the initial CRD discussions :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants