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

Error 0x80070005 with PDF #123

Open
Marving1023 opened this issue Mar 18, 2024 · 7 comments
Open

Error 0x80070005 with PDF #123

Marving1023 opened this issue Mar 18, 2024 · 7 comments
Assignees
Labels
being worked on Somebody is looking into this bug Something isn't working

Comments

@Marving1023
Copy link

Marving1023 commented Mar 18, 2024

Hello,

I'm encountering error 0x80070005 when scanning a document in PDF format.
If I choose another format like JPG, PNG, TIFF, BMP, everything works fine.

An issue occurred:
    Scanning failed due to an unknown error.
    Access denied. (Exception from HRESULT: 0x80070005)

I want to point out that I've never had any issues with the application before.

I uninstalled and reinstalled the application, but the issue persists.

@Marving1023 Marving1023 added the bug Something isn't working label Mar 18, 2024
@simon-knuth
Copy link
Owner

Hi, thanks for bringing this to my attention! Just out of curiosity, did you change anything about your setup recently?
I've got a suspicion as to what might be causing this, but I am surprised that this is only impacting less than 1% of all users and that the issue would just suddenly start out of nowhere.

You should be able to find your PDF file in this folder: %LOCALAPPDATA%\Packages\9390SimonKnuth.ScannerforWindows10_69n05hp4v3s90\TempState
If that's the case, I'd be super interested to hear whether the PDF file is flagged as "in use", you should be able to test that by attempting to rename or change it.

@simon-knuth simon-knuth added the being worked on Somebody is looking into this label Mar 27, 2024
@Marving1023
Copy link
Author

Marving1023 commented Mar 27, 2024

Yes, I do have the PDF document:

Directory: %LOCALAPPDATA%\Packages\9390SimonKnuth.ScannerforWindows10_69n05hp4v3s90\TempState
File: SCN_20240327_134143.pdf
Size: 0 KB ( blank page )

In the following folder, I have the scanned document image:

%LOCALAPPDATA%\Packages\9390SimonKnuth.ScannerforWindows10_69n05hp4v3s90\TempState\Conversion
File: 0.jpg
Size: 898 KB ( Matches with scanned document)

I have tried on 3 printers, but I still get the error 0x80070005

  • Brother DCP L3560CDW
  • Epson SX415
  • Canon MG5700

simon-knuth added a commit that referenced this issue Apr 11, 2024
Makes sure that all objects and streams are properly disposed before ImageToPDF is terminated.
This is a potential fix for #123.
@simon-knuth
Copy link
Owner

Thank you very much for the detailed description. I am not able to reproduce the issue on my end, but based on your info and the analytics I have, I suspect that the PDF file is not always finalized correctly before it is moved to its target location, causing an "Access denied" error. My best guess is that this is related to your PC's system/storage performance and certain timings occurring, which is why this is happening regardless of the used scanner and can start out of the blue.

I have made several improvements to the code, which I hope will fix the issue. I don't have a precise projection as to when I'll be able to package and publish this update, but I'll post an update here when I do.

@Marving1023
Copy link
Author

Marving1023 commented Apr 11, 2024

If it can help you, here is my configuration:

  • Asus B650E-E
  • AMD Ryzen 7 7700X
  • 32Go DDR5 Corsair
  • AMD RX6950XT
  • Samsung NVME 980 (Windows) / 990 (Storage)
  • Windows 11
    To check the data transfer speeds, please refer to the attached pic.

Drive C
Drive A

@NilsRo
Copy link

NilsRo commented Oct 20, 2024

@simon-knuth : Have the same error round about on every forth scan. The PDF and also the images are processed correctly but not shown in scanned pages in the App. I saw in the code linked that your optimization should included in 3.2.7.0 that I actually using. Attached a log.
log20241020.txt
ApplicationFrameHost_2024-10-20 213653

@simon-knuth
Copy link
Owner

simon-knuth commented Oct 28, 2024

I suspect that this is a timing issue. As a workaround, I've introduced a delayed second attempt in the PDF generation. It's shipping now in v3.2.8.

@NilsRo
Copy link

NilsRo commented Dec 23, 2024

Hi Simon,

I still get this error after the scan completes. So seems that there is still an issue if a PDF adds new pages.

Unbekannter Fehler (Exception from HRESULT: 0x80004005)
log20241223.txt

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

No branches or pull requests

3 participants