backup-utils icon indicating copy to clipboard operation
backup-utils copied to clipboard

ghe-restore fails when GREP_OPTIONS sets colorized output

Open russell-auld-prattwhitney opened this issue 3 years ago • 1 comments

Setting the following shell variable breaks ghe-restore v3.3.1 and v3.4.1 GREP_OPTIONS=-E --color=always

Restoring Git repositories ...
* Adding network_path 1/nw/16/79/09/6 to the list of networks to send
* Adding network_path 1/nw/1f/0e/3d/19 to the list of networks to send
* Adding network_path 1/nw/1f/f1/de/24 to the list of networks to send
* Adding network_path 3/nw/37/69/3c/23 to the list of networks to send
* Adding network_path 3/nw/3c/59/dc/21 to the list of networks to send
* Adding network_path 4/nw/4e/73/2c/26 to the list of networks to send
* Adding network_path 6/nw/6f/49/22/18 to the list of networks to send
...
* Transferring repository networks to 10.20.30.40 (/tmp/backup-utils-restore-foTpqv/git-server-3977faf6-a79b-11e6-8f8b-005056b12fb1.rsync) ...
sending incremental file list
rsync: link_stat "/tmp/ghe-backups/20220408T060001/repositories/1/\#033[01;31m\#033[Knw\#033[m\#033[K/16/79/09/6" failed: No such file or directory (2)
rsync: link_stat "/tmp/ghe-backups/20220408T060001/repositories/1/\#033[01;31m\#033[Knw\#033[m\#033[K/1f/0e/3d/19" failed: No such file or directory (2)
rsync: link_stat "/tmp/ghe-backups/20220408T060001/repositories/1/\#033[01;31m\#033[Knw\#033[m\#033[K/1f/f1/de/24" failed: No such file or directory (2)
rsync: link_stat "/tmp/ghe-backups/20220408T060001/repositories/3/\#033[01;31m\#033[Knw\#033[m\#033[K/37/69/3c/23" failed: No such file or directory (2)
rsync: link_stat "/tmp/ghe-backups/20220408T060001/repositories/3/\#033[01;31m\#033[Knw\#033[m\#033[K/3c/59/dc/21" failed: No such file or directory (2)
rsync: link_stat "/tmp/ghe-backups/20220408T060001/repositories/4/\#033[01;31m\#033[Knw\#033[m\#033[K/4e/73/2c/26" failed: No such file or directory (2)

The ghe-restore script must be using grep to create those "network_path" elements and subsequent rsync lists. When I ranghe-restore -v in my shell, the nw in Adding network_path 6/nw/6f/49/22/18 to the list of networks to send is colorized in my terminal. We can see the color codes in the rsync errors.

Hi @russell-auld-prattwhitney - Thank you for filing this bug. We will triage and work on a fix within the team. 🙏

whitneyimura avatar May 10 '22 20:05 whitneyimura