Worker throwing Recursion error when calling a Durable Object, even though there is

I just added a location hint, and now im getting this error:

Error: Subrequest depth limit exceeded. This request recursed through Workers too many times. This can happen e.g. if you have a Worker or Durable Object that calls other Workers or objects recursively.

The only worker call in this is the initial call to the DO. Any idea what might be causing this?

After adding some console.logs, it appears that the DO doesnt even get to initialising. The error is just thrown as soon as fetch is called on the DO stub. The handler that im using to test that calls it is super simple, so no chance of the recursing there (its basically just from the DO template): https://pastebin.com/raw/EyKbvuY2
And the tail output:

GET https://xxxxxxxxxxxxxxxxxxxx.xxxxxxx.workers.dev/ - Exception Thrown @ 4/9/2024, 10:44:25 AM
  (log) Forwarder request
  (log) Stub gotten
X [ERROR]   Error: Subrequest depth limit exceeded. This request recursed through Workers too many times. This can happen e.g. if you have a Worker or Durable Object that calls other Workers or objects recursively.    

I even rolled back to the version of the worker from before the change, and the error is still happening, so some weirdness is going on.

I originally posted in the #durable-objects channel in the discord, but I have not gotten a response for several days, so I am posting here instead. This error is preventing this object from being used at all, as even rollbacks to previous versions that were working still yields the same error message (and the “worker threw an exception” page)

I just realized the title got cut off, and there doesn’t appear to be a way to edit it. The full title should be “Worker throwing Recursion error when calling a Durable Object, even though there is no recursion.”

After lots of experimenting, I eventually figured out that it was due to my enabling smart-placement in my wrangler.toml file:

[placement]
mode = "smart"

Removing this and re-deploying made the error go away. Would be nice if this error message was replaced with a “durable objects do not support smart placement” instead of an error that is completely unrelated

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.