Azure / Azure/azure-functions-host

Intermittent `Cannot access a disposed object` when processing blob output binding

Open
#2,779 0 comments 0 reactions 1 assignee Claimed by @pragnagopa View on GitHub
bug
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

Caught by azure-functions-python-worker tests

`function.json`:

```json
{
"scriptFile": "main.py",
"disabled": false,
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req"
},
{
"type": "blob",
"direction": "out",
"name": "file",
"connection": "AzureWebJobsStorage",
"path": "python-worker-tests/test-bytes.txt"
},
{
"type": "http",
"direction": "out",
"name": "$return",
}
]
}
```

`main.py`:

```python
import azure.functions as azf

def main(req: azf.HttpRequest, file: azf.Out[str]) -> str:
file.set(req.get_body())
return 'OK'
```

Traceback:

```
Function.put_blob_bytes[0]
=> System.Collections.Generic.Dictionary`2[System.String,System.Object] =>
System.Collections.Generic.Dictionary`2[System.String,System.Object]
System.Private.CoreLib: Exception while executing function: Functions.put_blob_bytes.
Microsoft.Azure.WebJobs.Host: Error while handling parameter _binder after function returned:.
Microsoft.Azure.WebJobs.Host: Cannot access a disposed object.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.