Skip to main content

Who is this article for?

Incydr risk agent
Backup and legacy agents

Not sure which agent type you have? See the Organizations screen in the Code42 console.

Instructor, no.

Incydr Professional, Enterprise, Horizon, and Gov F2, no.

Incydr Basic, Advanced, and Gov F1, yes.

HOME
GETTING STARTED
RELEASE NOTES
FAQs
APIs
SYSTEM STATUS
Code42 Support

Unable to connect to backup engine on devices with a custom localhost address

Overview

This article describes an issue in which the Code42 agent displays the message "Cannot connect to the backup engine" if the localhost entries in your computer's hosts file do not point to the default loopback IP addresses. The Code42 agent cannot connect to the Code42 service if the localhost entries in your hosts file have changed.

To troubleshoot other causes of the "Cannot connect to the backup engine" message, see Cannot connect to background service

Diagnosing

A changed localhost entry is likely causing this issue if all of these conditions exist:

  • The Code42 agent displays the message "Cannot connect to the backup engine."
  • The Code42 agent service.log contains the message:
CPService is already running on localhost:4243

This message indicates the Code42 agent cannot connect to the Code42 service.

  • Your hosts file has been modified, either manually or by another application.

Recommended solution

Use caution when following the steps below. Editing the hosts file should only be performed by advanced users. If you have any concerns about this process, contact our Technical Support Engineers​. Some versions of Windows also provide automated tools to restore the default values to your hosts file. See External resources below for more details.

Back up the hosts file before making changes
Before following the steps below to edit your hosts file, make a backup copy of the file so that you can easily revert your changes in case they cause unintended consequences.

In addition, adding a # to the beginning of any line instructs the operating system to ignore that line, but still preserves the content as a "comment" you can reference later. Saving the original content as comments is helpful if you need to revert your changes later.

Windows

  1. Open the Windows Start menu and locate Notepad.
  2. Right-click Notepad and select Launch as Administrator.
  3. Select File > Open and navigate to C:\Windows\System32\drivers\etc\host
    The hosts file opens.
  4. Edit or remove any localhost entries so that only the following localhost addresses remain. DO NOT edit any other entries in the file.
    127.0.0.1    localhost
    ::1          localhost
    
  5. Save the file.
  6. Start the Code42 service.

Mac

  1. Open the Finder.
  2. Go to Applications > Utilities and open Terminal.
  3. Enter the following command: sudo nano /private/etc/hosts
    If prompted, enter the administrator password.
  4. Edit or remove any localhost entries so that only the following localhost addresses remain. DO NOT edit any other entries in the file.
    127.0.0.1    localhost
    ::1          localhost
    fe80::1%lo0  localhost
    
  5. Press Control+X to exit.
  6. Press Y to confirm the changes.
  7. Press Enter to save to the existing location.
  8. Start the Code42 service.

Linux

  1. Open Terminal.
  2. Enter the following command: sudo nano /etc/hosts
    If prompted, enter the administrator password.
  3. Edit or remove any localhost entries so that only the following localhost addresses remain. DO NOT edit any other entries in the file.
    127.0.0.1    localhost
    ::1          localhost
    
  4. Press Control+X to exit.
  5. Press Y to confirm the changes.
  6. Press Enter to save to the existing location.
  7. Start the Code42 service.

External resources

  • Was this article helpful?