graphql-platform icon indicating copy to clipboard operation
graphql-platform copied to clipboard

FileSystemOperationDocumentStorage fails at SaveInternalAsync when persisting query

Open sciocoder opened this issue 1 year ago • 0 comments

the issue was already reported #4139 and has not been resolved, it is also present in the current version 14.

{
    "errors": [
        {
            "message": "Unexpected Execution Error",
            "extensions": {
                "message": "Cannot access a closed file.",
                "stackTrace": "   at System.IO.FileStream.FlushAsync(CancellationToken cancellationToken)\n   at HotChocolate.PersistedOperations.FileSystem.FileSystemOperationDocumentStorage.SaveInternalAsync(String filePath, IOperationDocument document, CancellationToken cancellationToken)\n   at HotChocolate.PersistedOperations.FileSystem.FileSystemOperationDocumentStorage.SaveInternalAsync(String filePath, IOperationDocument document, CancellationToken cancellationToken)\n   at HotChocolate.Execution.Pipeline.WritePersistedOperationMiddleware.InvokeAsync(IRequestContext context)\n   at HotChocolate.Execution.Pipeline.ReadPersistedOperationMiddleware.InvokeAsync(IRequestContext context)\n   at HotChocolate.Execution.Pipeline.DocumentCacheMiddleware.InvokeAsync(IRequestContext context)\n   at HotChocolate.Execution.Pipeline.TimeoutMiddleware.InvokeAsync(IRequestContext context)\n   at HotChocolate.Execution.Pipeline.ExceptionMiddleware.InvokeAsync(IRequestContext context)"
            }
        }
    ]
}

when IOperationDocument is of type OperationDocument the stream after document.WriteToAsync is disposed here

sciocoder avatar Oct 20 '24 14:10 sciocoder