When you try to deploy code, it fails with a Garbage collection failed
exception.
Error messages and logs
When deploying code:
"puppet-code": {
"cause": "org.eclipse.jgit.api.errors.JGitInternalException: Garbage collection failed.",
"kind": ":puppetlabs.enterprise.file-sync-errors/sync-error",
"live-dir": "/etc/puppetlabs/code",
"live-dir-diff": null,
"msg": "Error while sync'ing live code directory",
"repo-name": "puppet-code",
"repo-path": "/opt/puppetlabs/server/data/puppetserver/filesync/client/puppet-code.git"
}
In the puppetserver log (/var/log/puppetlabs/puppetserver/puppetserver.log
):
2018-10-18T16:47:52.273-04:00 ERROR [clojure-agent-send-off-pool-35920] [p.e.file-sync-errors] Failed to sync repo :puppet-code: Error while sync'ing live code directory org.eclipse.jgit.api.errors.JGitInternalException: Garbage collection failed.
Version and installation information
PE version: All supported versions
Installation type: Any
Solution
The file sync cache might be corrupted if the disk that it is on fills up or permissions are modified on /opt/puppetlabs/server/data/puppetserver/filesync/client
.
To fix the issue, use the following steps to clear the file sync cache on your primary server (called the master in older versions of PE), replica, and any compilers that are in your deployment.
Note: You might not have a replica or compilers in your deployment.
-
Ensure that the code you want to deploy is in your control repo.
-
In case you need further help from Support, dump a list of directories and files (and their permissions) from
/opt/puppetlabs/server/data
by running:find /opt/puppetlabs/server/data -ls > /tmp/file_list.txt
-
On the primary server, replica, and all compilers, stop pe-puppetserver service by running:
puppet resource service pe-puppetserver ensure=stopped
-
On the primary server, replica, and all compilers, move the file sync cache directory by running:
mv /opt/puppetlabs/server/data/puppetserver/filesync/client /tmp
-
On the primary server, replica, and all compilers, start pe-puppetserver service by running:
puppet resource service pe-puppetserver ensure=running
Troubleshooting
If you’re unable to resolve the issue, attach the following to a support ticket so that Support can provide troubleshooting help:
-
The list of directories and files (and their permissions) from the above steps
-
A recent copy of the puppetserver log from the primary server (
/var/log/puppetlabs/puppetserver/puppetserver.log
)
Comments
2 comments
Used this as a useful reference to reset the file-sync service when it failed for other reasons (disk space errors). Couldn't easily find any docs that talked about how to restart the file-sync service otherwise, or even anything that mentioned it was part of pe-puppetserver and not its own thing.
Anyway, these instructions work well for restarting it.
That's wonderful to hear! Thanks for the feedback.
Please sign in to leave a comment.