HP printer / scanner error, "Failed to open a connection to the device (-21345)

This particular issue has been discussed a lot, but the discussions are 5 to 6 years old and are not accepting replies or new questions. The solutions I have found on these discussions have not worked for me. They're solutions for OS 12.5 or something close. I'm on 26.5.1 and am hoping someone has an up to date solution.

iMac (2017 – 2020)

Posted on Jun 4, 2026 12:34 PM

Reply
Question marked as Top-ranking reply

Posted on Jun 5, 2026 10:31 AM

I found the solution. It started with a Google search that took me to the instructions below to allow applications to find and communicate with devices on my local network. I'd done this before without success, but when I went back now to double check it, I found that there were multiple HP scanner applications listed.


I saw HP Easy Scan at the top of the list and it was set to allow, so I thought all was as it should be. When I went back just now, I found HP Device Monitor and at the very bottom of the list, HP Scanner 3 which was disabled. I'd never heard of HP Scanner 3, and considering my scanner was working fine until two days ago, I can only deduce that HP Scanner 3 was either new to the list as of two days ago, or since I last scanned something, or that it was disallowed somehow (not by me). But when I allowed it access, my scanner started working again.


1. Check Your Mac's Local Network Settings

If you are using macOS, a security setting might be blocking the scanner from communicating with your Mac. [1, 2]


  • Go to Apple Menu > System Settings (or System Preferences).
  • Click on Privacy & Security.
  • Select Local Network.
  • Ensure the toggle next to your printer/scanner or the HP app is turned ON. [1]


Thanks everyone for your input.

10 replies
Question marked as Top-ranking reply

Jun 5, 2026 10:31 AM in response to yawdis

I found the solution. It started with a Google search that took me to the instructions below to allow applications to find and communicate with devices on my local network. I'd done this before without success, but when I went back now to double check it, I found that there were multiple HP scanner applications listed.


I saw HP Easy Scan at the top of the list and it was set to allow, so I thought all was as it should be. When I went back just now, I found HP Device Monitor and at the very bottom of the list, HP Scanner 3 which was disabled. I'd never heard of HP Scanner 3, and considering my scanner was working fine until two days ago, I can only deduce that HP Scanner 3 was either new to the list as of two days ago, or since I last scanned something, or that it was disallowed somehow (not by me). But when I allowed it access, my scanner started working again.


1. Check Your Mac's Local Network Settings

If you are using macOS, a security setting might be blocking the scanner from communicating with your Mac. [1, 2]


  • Go to Apple Menu > System Settings (or System Preferences).
  • Click on Privacy & Security.
  • Select Local Network.
  • Ensure the toggle next to your printer/scanner or the HP app is turned ON. [1]


Thanks everyone for your input.

Jun 4, 2026 2:38 PM in response to yawdis

yawdis wrote:
ENVY Photo 7800 series


HP ENVY Photo 7800 All-in-One Printer series printers support AirPrint.


The following assumes the printer is correctly connected to the local Ethernet, or the local Wi-Fi. Not USB.


Confirm the printer firmware is current, and this check probably most easily through the embedded web server.


Enter the printer’s IP address in your web browser to access the embedded web server within the printer.


Then the third section, below:




Once the printer networking and firmware are correct and current, then check for the printer using AirPrint:


If that fails, reset the printing system:


AirPrint allows printer access without needing or using the HP app, and without the HP drivers.


If the printer fails to work, the next step is a printer reset:


Then set up the printer again, and try AirPrint again.

Jun 5, 2026 8:50 AM in response to yawdis

yawdis wrote:
These procedures are for resetting the printer which is working fine. I only receive the error message when I attempt to scan which I do through system settings, printers & scanners, select my printer, open scanner. Its the way I've always used the scanner.
I've also made sure the printer is up to date and on the same wifi.

Sorry if this is obvious, but... did you try turning the printer/scanner off and then on?

I find that often my HP printer fails to scan or print, and every time this happens, turning off and on fixes it.

Jun 5, 2026 8:01 AM in response to MrHoffman

These procedures are for resetting the printer which is working fine. I only receive the error message when I attempt to scan which I do through system settings, printers & scanners, select my printer, open scanner. Its the way I've always used the scanner.


I've also made sure the printer is up to date and on the same wifi.

Jun 5, 2026 9:33 AM in response to yawdis

yawdis wrote:
These procedures are for resetting the printer which is working fine. I only receive the error message when I attempt to scan which I do through system settings, printers & scanners, select my printer, open scanner. Its the way I've always used the scanner.
I've also made sure the printer is up to date and on the same wifi.


The reset can re-generate certificates, and can resolve and re-establish the network, and the device firmware underlies it all.


Your report also listed printer / scanner. Not specifically scanner.


AirPrint supports many scanners.


And AirPrint gets the vendor-provided and variously sometimes problematic drivers out of the way.

HP printer / scanner error, "Failed to open a connection to the device (-21345)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.