Skip to content

Conversation

@sachinbehera-punt
Copy link

@sachinbehera-punt sachinbehera-punt commented Sep 29, 2025

Fix ctx.time() ValueError by wrapping time.time in a lambda

  • Replaced direct call to built-in time.time with a lambda in server_context.py
  • Prevents inspect.signature error for built-in functions when using ctx.run_typed

@github-actions
Copy link

github-actions bot commented Sep 29, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@sachinbehera-punt sachinbehera-punt changed the title Fix ctx.time() ValueError for built-in time.time. Wrap time.time() in… Fix ctx.time() ValueError for built-in time.time Sep 29, 2025
@sachinbehera-punt
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@sachinbehera-punt
Copy link
Author

sachinbehera-punt commented Sep 29, 2025

Error Message

`A retry-able error was received from the service while processing the invocation.

[500 Internal] ValueError('no signature found for builtin ')
Traceback (most recent call last):

File "/data/backend/.venv/lib/python3.12/site-packages/restate/server_context.py", line 304, in enter
out_buffer = await invoke_handler(handler=self.handler, ctx=self, in_buffer=in_buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/data/backend/.venv/lib/python3.12/site-packages/restate/handler.py", line 241, in invoke_handler
out_arg = await handler.fn(ctx) # type: ignore [call-arg]
^^^^^^^^^^^^^^^^^^^^^

File "/data/backend/api/restate_workflows/daily_crawl_workflow.py", line 39, in run
start_time = await ctx.time()
^^^^^^^^^^

File "/data/backend/.venv/lib/python3.12/site-packages/restate/server_context.py", line 504, in time
return self.run_typed("timestamp", time.time)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/data/backend/.venv/lib/python3.12/site-packages/restate/server_context.py", line 584, in run_typed
signature = inspect.signature(action, eval_str=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/ubuntu/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/inspect.py", line 3348, in signature
return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/ubuntu/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/inspect.py", line 3085, in from_callable
return _signature_from_callable(obj, sigcls=cls,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/ubuntu/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/inspect.py", line 2602, in _signature_from_callable
return _signature_from_builtin(sigcls, obj,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/ubuntu/.local/share/uv/python/cpython-3.12.11-linux-x86_64-gnu/lib/python3.12/inspect.py", line 2392, in _signature_from_builtin
raise ValueError("no signature found for builtin {!r}".format(func))

ValueError: no signature found for builtin `

@slinkydeveloper
Copy link
Contributor

Thanks for the contribution, I'm finishing this here #138

@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants