Summary
This article describes the cause and solution of the dremio-admin "Failed to attach: couldn't find Dremio process to attach" error.
Reported Issue
When running a dremio-admin backup using the local-attach option (-l), a "Failed to attach: couldn't find Dremio process to attach" error can occur.
Relevant Versions
All releases
Cause
Java creates a directory in the /tmp directory called hsperfdata_<username> where <username> is the owner of the dremio process. If the permissions of this directory are incorrect, dremio-admin is unable to attach to the JVM in order to run the backup.
NOTE: Local attach backups require access to the hsperf_data directory. If you disable the creation of the hsperfdata_<username> file via JVM options such as `-XX:-UsePerfData` local attach backups will also not run.
Steps to Resolve
Set the owner:group of the directory to the dremio process owner and group and set permissions to 755.
For example, if the dremio process owner is "dremio" the /tmp/hsperfdata_<username> and permissions needs to look like so:
$ ls -l /tmp
drwxr-xr-x. 2 dremio dremio 19 Jul 11 08:45 hsperfdata_dremio
If permissions are set to 777 or the owner:group is incorrect then a local attach backup will fail with the same error.