Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not run Tesseract ... Cannot access a disposed object Image`1 #594

Open
rkm opened this issue Nov 27, 2024 · 2 comments
Open

Could not run Tesseract ... Cannot access a disposed object Image`1 #594

rkm opened this issue Nov 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rkm
Copy link
Member

rkm commented Nov 27, 2024

IsIdentifiable service produced this error during the extraction pipeline, and sent the message to the dead-letter queue:

Exception while classifying ExtractedFileStatusMessage:
System.ApplicationException: Could not run Tesseract on 'foo.dcm'
 ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Image`1'.
   at SixLabors.ImageSharp.Image.ThrowObjectDisposedException(Type type)
   at IsIdentifiable.Runners.DicomFileRunner.ValidateDicomPixelData(IFileInfo fi, DicomFile dicomFile, DicomDataset ds, String modality, String[] imageTypeArr) in /home/runner/work/IsIdentifiable/IsIdentifiable/IsIdentifiable/Runners/DicomFileRunner.cs:line 334
   --- End of inner exception stack trace ---
   at IsIdentifiable.Runners.DicomFileRunner.ValidateDicomPixelData(IFileInfo fi, DicomFile dicomFile, DicomDataset ds, String modality, String[] imageTypeArr) in /home/runner/work/IsIdentifiable/IsIdentifiable/IsIdentifiable/Runners/Dicom
FileRunner.cs:line 429
   at IsIdentifiable.Runners.DicomFileRunner.ValidateDicomFile(IFileInfo fi) in /home/runner/work/IsIdentifiable/IsIdentifiable/IsIdentifiable/Runners/DicomFileRunner.cs:line 208
   at SmiServices.Microservices.IsIdentifiable.IsIdentifiableQueueConsumer.ProcessMessageImpl(IMessageHeader header, ExtractedFileStatusMessage statusMessage, UInt64 tag) in /home/runner/work/SmiServices/SmiServices/src/SmiServices/Microse
rvices/IsIdentifiable/IsIdentifiableQueueConsumer.cs:line 64. File could not be scanned.
@rkm rkm added the bug Something isn't working label Nov 27, 2024
@rkm
Copy link
Member Author

rkm commented Nov 27, 2024

A second similar error was also produced by a different service instance on a different file:

 ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'MemoryGroup'.
   at SixLabors.ImageSharp.Memory.MemoryGroup`1.Owned.ThrowObjectDisposedException()
   at SixLabors.ImageSharp.Memory.MemoryGroup`1.Owned.get_Item(Int32 index)
   at SixLabors.ImageSharp.Formats.Bmp.BmpEncoderCore.Write24BitPixelData[TPixel](Configuration configuration, Stream stream, Buffer2D`1 pixels)
   at SixLabors.ImageSharp.Formats.Bmp.BmpEncoderCore.WriteImage[TPixel](Configuration configuration, Stream stream, Image`1 image)
   at SixLabors.ImageSharp.Formats.Bmp.BmpEncoderCore.Encode[TPixel](Image`1 image, Stream stream, CancellationToken cancellationToken)
   at SixLabors.ImageSharp.Formats.ImageEncoder.Encode[TPixel](Image`1 image, Stream stream)
   at IsIdentifiable.Runners.DicomFileRunner.ValidateDicomPixelData(IFileInfo fi, DicomFile dicomFile, DicomDataset ds, String modality, String[] imageTypeArr) in /home/runner/work/IsIdentifiable/IsIdentifiable/IsIdentifiable/Runners/Dicom
FileRunner.cs:line 334
   --- End of inner exception stack trace ---
   at IsIdentifiable.Runners.DicomFileRunner.ValidateDicomPixelData(IFileInfo fi, DicomFile dicomFile, DicomDataset ds, String modality, String[] imageTypeArr) in /home/runner/work/IsIdentifiable/IsIdentifiable/IsIdentifiable/Runners/Dicom
FileRunner.cs:line 429
   at IsIdentifiable.Runners.DicomFileRunner.ValidateDicomFile(IFileInfo fi) in /home/runner/work/IsIdentifiable/IsIdentifiable/IsIdentifiable/Runners/DicomFileRunner.cs:line 208
   at SmiServices.Microservices.IsIdentifiable.IsIdentifiableQueueConsumer.ProcessMessageImpl(IMessageHeader header, ExtractedFileStatusMessage statusMessage, UInt64 tag) in /home/runner/work/SmiServices/SmiServices/src/SmiServices/Microse
rvices/IsIdentifiable/IsIdentifiableQueueConsumer.cs:line 64. File could not be scanned.

@jas88
Copy link
Member

jas88 commented Nov 27, 2024

Interesting - I saw this crop up once in CI, but it didn't recur - I'd made a note at the time to go back and investigate in case it did come up a second time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants