Open schnabel45 opened 1 year ago
(transferred incorrectly previously - issue author doesn't seem to be using the standalone PoweShell SDK)
(transferred incorrectly previously - issue author doesn't seem to be using the standalone PoweShell SDK)
Hi @lilyjma, just an FYI that I replicated this issue both with the standalone SDK and without. I opened this issue with the standalone SDK since that appears to be where development is progressing for PowerShell Functions now.
Hi @schnabel45: From what I gather, the issue seems to be that you're trying to instantiate a durable timer in an Activity function, but they should only be instantiated inside orchestrators: if you're inside an activity, you can just make your activity "sleep" for a given amount of time.
I believe that's the cause of your null pointer exception (the orchestrator internals are not initialized). We should have a better error message though. Please let me know if this answers your question. Also, the DF SDK for PowerShell is open source so if you'd like to contribute a helpful error message for this scenario.
It should be as simple as adding a null-check here and throw an informative error if OrchestrationContext
is null.
Hi @davidmrdavid, I was able to test based on your feedback today and you are 100% correct. I successfully got Durable Timers working within PowerShell inside of the orchestrator itself. I'll see if I can get a PR submitted for the recommended error later this week. Thank you!
Description
If attempting to start a durable timer using boilerplate orchestration, PowerShell throws a
System.NullReferenceException
for theDuration
, even if it's known to be valid.Expected behavior
A durable timer should be started for the duration of the timespan passed into the call.
Actual behavior
ERROR: Object reference not set to an instance of an object.
is thrown with the following stack trace.Relevant source code snippets
Hello1 Function
run.ps1
function.json
DurableFunctionsOrchestrator1
run.ps1
function.json
DurableFunctionsHttpStart1
run.ps1
function.json
Known workarounds
I've been unable to find a way around this. I've stepped through the execution during runtime and verified the
$duration
variable was not null, and was a valid TimeSpan object.App Details
[3.3.*, 4.0.0)
)Screenshots
N/A
If deployed to Azure
While this has been observed in Azure as well, currently only in my local environment.