Skip to content

How to Fix GitHub Enterprise Backup Failure

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix GitHub Enterprise Backup Failure. We cover key concepts, practical examples, and best practices.

GitHub Enterprise backup fails with Connection refused or Snapshot verification failed — the ghe-backup command cannot connect to the primary instance or the snapshot is corrupt.

The Problem

Error: Failed to connect to the GitHub Enterprise instance at backup-01.example.com
Check that the SSH key is authorized and the instance is reachable.

Step-by-Step Fix

Step 1: Verify SSH connectivity

ssh -p 122 admin@YOUR-INSTANCE "ghe-version"

If this fails, check the SSH key:

cat ~/.ssh/id_rsa.pub | ssh -p 122 admin@YOUR-INSTANCE \
  "cat >> ~/.ssh/authorized_keys"

Step 2: Test the backup command

ghe-backup -v

Expected output:

Starting backup of YOUR-INSTANCE
Backup of settings: OK
Backup of repositories: OK
Backup of MySQL databases: OK
Snapshot complete.

Step 3: Check disk space on backup host

df -h /data/backups

Ensure at least 2x the instance data size is free.

Step 4: Restore from a snapshot

ghe-restore BACKUP-SNAPSHOT

Prevention Tips

  • Run ghe-backup daily via cron
  • Monitor backup logs with ghe-backup -l
  • Keep the backup host on a separate network for redundancy
  • Test restore procedure quarterly
  • Store at least 7 daily snapshots

Common Mistakes with enterprise backup

  1. Mixing let bindings with <- bindings in do notation, producing type errors
  2. Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors
  3. Non-exhaustive pattern matches that compile with warnings then crash at runtime

These mistakes appear frequently in real-world GITHUB code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why does ghe-backup fail with "Permission denied"?

The backup host SSH key is not authorized on the GitHub Enterprise instance. Add the public key to /home/admin/.ssh/authorized_keys on the appliance using the management console or SSH.

How long does a full backup take?

For a 500 GB instance, the initial full backup can take 4-8 hours. Incremental backups that follow are much faster, typically 15-30 minutes.

Can I back up to cloud storage instead of local disk?

Yes, you can use ghe-backup with network-mounted storage like NFS or S3 via s3fs. Configure the mount point as the backup destination in /data/backups.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro