Custom Code Monitor is executing multiple times in parallel (duplicate runs per single trigger) #61

Closed
opened 2026-04-05 16:18:47 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jeffdrumgod on 2/25/2026

Describe the bug

Custom Code Monitors are being executed multiple times for a single trigger (both on scheduled execution and when using “Test Monitor”).

This results in parallel executions of the same monitor, which is a critical issue in my scenario because my test logic cannot run concurrently under any circumstance.

I had previously reported this behavior in the support channel. It was mitigated at some point, but after recent security-related fixes, the issue returned — now occurring much more frequently.

Due to this behavior, I have been forced to disable my monitors for several days, which is causing operational impact.


To Reproduce

  1. Create a monitor using Custom Code Monitor
  2. Add a unique identifier inside the script (e.g., crypto.randomUUID()) and send it to an external webhook endpoint
  3. Save the monitor
  4. Click on Test Monitor (or wait for normal scheduled execution)
  5. Observe the webhook logs

Observed behavior:

  • The monitor executes multiple times for a single trigger
  • Each execution generates a different UUID
  • All executions originate from the same IP
  • All executions happen at nearly the exact same timestamp
  • The webhook confirms these are separate executions (not retries of the same request)

This confirms that the script itself is being executed multiple times in parallel.


Expected behavior

The Custom Code Monitor should execute exactly once per trigger:

  • One execution when clicking “Test Monitor”
  • One execution per scheduled interval

There should be no parallel or duplicate runs unless explicitly configured.


Screenshots

I am attaching:

  • A video demonstrating the issue here
  • Webhook logs showing multiple executions with different UUIDs (here)
  • Evidence that the requests originated from the same source and timestamp (image bellow)
Image

Deployment Type

SaaS (https://oneuptime.com/)


Additional context

This issue makes it impossible to use Custom Code Monitors in scenarios where:

  • The monitored logic performs mutations
  • The monitored flow interacts with transactional systems
  • The execution must be strictly sequential

The current behavior causes:

  • Race conditions
  • Parallel side effects
  • Inconsistent monitoring results

Given that this was previously reported and appears to have resurfaced after security-related updates, it may indicate a regression in the monitor execution engine.

Please let me know if additional logs or environment details are needed.

*Originally created by @jeffdrumgod on 2/25/2026* ## **Describe the bug** Custom Code Monitors are being executed multiple times for a single trigger (both on scheduled execution and when using “Test Monitor”). This results in parallel executions of the same monitor, which is a critical issue in my scenario because my test logic cannot run concurrently under any circumstance. I had previously reported this behavior in the support channel. It was mitigated at some point, but after recent security-related fixes, the issue returned — now occurring much more frequently. Due to this behavior, I have been forced to disable my monitors for several days, which is causing operational impact. --- ## **To Reproduce** 1. Create a monitor using **Custom Code Monitor** 2. Add a unique identifier inside the script (e.g., `crypto.randomUUID()`) and send it to an external webhook endpoint 3. Save the monitor 4. Click on **Test Monitor** (or wait for normal scheduled execution) 5. Observe the webhook logs ### Observed behavior: * The monitor executes multiple times for a single trigger * Each execution generates a different UUID * All executions originate from the same IP * All executions happen at nearly the exact same timestamp * The webhook confirms these are separate executions (not retries of the same request) This confirms that the script itself is being executed multiple times in parallel. --- ## **Expected behavior** The Custom Code Monitor should execute exactly **once per trigger**: * One execution when clicking “Test Monitor” * One execution per scheduled interval There should be no parallel or duplicate runs unless explicitly configured. --- ## **Screenshots** I am attaching: * A video demonstrating the issue [here](https://github.com/user-attachments/assets/94402b45-4124-41c5-bdb0-3d2a70278b83) * Webhook logs showing multiple executions with different UUIDs ([here](https://webhook.site/#!/view/bf872c17-fd79-4ab8-97cb-6e671c0fc375/b351b658-04cf-45b5-a7be-aad4edb6179d/1)) * Evidence that the requests originated from the same source and timestamp (image bellow) <img width="1982" height="1003" alt="Image" src="https://github.com/user-attachments/assets/33219e9f-4bb7-4812-9c72-ccf080390169" /> --- ## **Deployment Type** SaaS ([https://oneuptime.com/](https://oneuptime.com)) --- ## **Additional context** This issue makes it impossible to use Custom Code Monitors in scenarios where: * The monitored logic performs mutations * The monitored flow interacts with transactional systems * The execution must be strictly sequential The current behavior causes: * Race conditions * Parallel side effects * Inconsistent monitoring results Given that this was previously reported and appears to have resurfaced after security-related updates, it may indicate a regression in the monitor execution engine. Please let me know if additional logs or environment details are needed.
MrUnknownDE added the bugbugbugbugbugbugbugbugbugbugbug labels 2026-04-05 16:18:47 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#61