[GH-ISSUE #1950] Undefined array key in DeduplicationHandler #839

Closed
opened 2026-03-04 03:01:17 +03:00 by kerem · 1 comment
Owner

Originally created by @markomilivojevic on GitHub (Mar 3, 2025).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/1950

Monolog version 3.6.0

Getting:
Undefined array key 1 on line 117 in file /src/Monolog/Handler/DeduplicationHandler.php
Undefined array key 2 on line 117 in file /src/Monolog/Handler/DeduplicationHandler.php

It happens when there are too many errors in the deduplication file (about 1000) and possibly many requests trying to write to the same file.

Originally created by @markomilivojevic on GitHub (Mar 3, 2025). Original GitHub issue: https://github.com/Seldaek/monolog/issues/1950 Monolog version 3.6.0 Getting: Undefined array key 1 on line 117 in file /src/Monolog/Handler/DeduplicationHandler.php Undefined array key 2 on line 117 in file /src/Monolog/Handler/DeduplicationHandler.php It happens when there are too many errors in the deduplication file (about 1000) and possibly many requests trying to write to the same file.
kerem 2026-03-04 03:01:17 +03:00
  • closed this issue
  • added the
    Bug
    label
Author
Owner

@Seldaek commented on GitHub (Mar 15, 2025):

Ok I can see how with concurrent requests it could be that one reads a partially written line perhaps for a new error.. We probably just need to skip invalid lines if it's the last one, and then worst case we'll get duplicate writes. But then we also most likely need to lock the file while writing.

<!-- gh-comment-id:2726549911 --> @Seldaek commented on GitHub (Mar 15, 2025): Ok I can see how with concurrent requests it could be that one reads a partially written line perhaps for a new error.. We probably just need to skip invalid lines if it's the last one, and then worst case we'll get duplicate writes. But then we also most likely need to lock the file while writing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#839
No description provided.