connectors icon indicating copy to clipboard operation
connectors copied to clipboard

MISP error handling causes malformed state

Open mahmut-the-guy opened this issue 1 year ago • 2 comments

  1. Start MISP connector with blank state.
  2. Once connector starts, expect it to set state with page_number (and increment it).
  3. After some time, during restSearch queries, client fails to fetch data due to server responding with "429 rate limit exceeded" (or any other server error)
  4. State is set to current date and all the data between MISP_IMPORT_FROM_DATE and current data ignored in the next run, since state now contains the current date.

Expected behavior

State of timestamp (import from date) should only be updated if all the data is successfully fetched. Otherwise it should remain at the last data checkpoint with relevant page number.

mahmut-the-guy avatar Apr 25 '24 10:04 mahmut-the-guy

@helene-nguyen or @Megafredo could you please help assess (and fixing this bug, if it's an actual one)? Thanks a lot!

nino-filigran avatar Apr 29 '24 07:04 nino-filigran

@nino-filigran @mahmut-the-guy I'm on it :)

helene-nguyen avatar May 31 '24 06:05 helene-nguyen

@mahmut-the-guy sorry the late answer, receiving a status 429 is not an error, it is the other server "kindly" asking you to please stop spamming requests. Obviously, your rate of requests has been too high and the server is not willing to accept this.

You might want to check if the rate limit is set on MISP:

image

Concerning the state, only the connector last run is taking into account and if you have the error raised, the last_event_timestamp will not change because no event is detected.

I will close this issue but it can be re-opened if needed :)

helene-nguyen avatar Jul 09 '24 15:07 helene-nguyen