Search code examples
rubygemsfluentdtd-agent

td-agent not starting after copying gems to a new server with identical versions


I'm facing a puzzling issue with td-agent 4 (Fluentd) on a new server. I had successfully installed a few gems on my old server using td-agent-gem install "gem-name", with td-agent. These gems worked perfectly on the old server. Now, I've set up a new server with the same td-agent version, and I copied the gem folders (including the .gemspec file) from the old server to the new one. However, when I try to start td-agent on the new server, it fails to start, and there are no meaningful error messages in the logs. It shows failed to start with exit-code... like that.

I've confirmed that:

  1. Permissions for the copied gem folders and their contents are set correctly.
  2. I've uninstalled any existing conflicting gem versions on the new server.
  3. Still the td-agent doesn't seem to recognize or load the copied gem. It's as if the gem isn't there, even though it's in the gem library folder.
  4. If I use td-agent-gem list those copied gems will not show up there.

Note: I have a network issue on that new server, so can't download or use the command td-agent-gem install "gem_name". This is the reason I am trying this approach.

I'm unsure what else to check or what might be causing this issue. Any suggestions on how to troubleshoot this and get the gem working on the new server would be greatly appreciated.


Solution

  • Even though you copied those gems to the gems directory, there are still a few steps left.

    1. td-agent-gem list you said this won't show up, this is because .gemspec files are not in the /specification directory. Add the missing .gemspec files.

    2. Check the necessary dependencies are already there, for example, let's say you copied a gem named xyz, but that xyz depends on other gems, so make sure all the dependency gems are installed and make sure the exact version is copied. Sometimes old gems are not compatible with newer dependencies, so make sure the gems you copied have the necessary dependency gems with the right version.

    3. When you are copying check necessary permissions are permitted to those folders.

    Hope this helps you.