Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Permission Issue with Prepackaged Gems #213

Open
blc16 opened this issue Sep 6, 2019 · 2 comments
Open

Permission Issue with Prepackaged Gems #213

blc16 opened this issue Sep 6, 2019 · 2 comments

Comments

@blc16
Copy link

blc16 commented Sep 6, 2019

I am attempting to install td-agent onto a Packer VM and install a prepackaged output plugin as well. Td-agent install fine using the script I


set -e

echo "=============================="
echo " td-agent Installation Script "
echo "=============================="

sudo curl https://packages.treasuredata.com/GPG-KEY-td-agent | sudo apt-key add -
sudo echo "deb http://packages.treasuredata.com/3/ubuntu/xenial/ xenial contrib" | sudo tee -a /etc/apt/sources.list.d/treasure-data.list
sudo apt-get update
sudo apt-get install -y td-agent

if [ $? -eq 0 ]
then
  echo "Successfully installed td-agent"
else
  echo "Could not install td-agent" 
fi.

After td-agent is installed I install the prepackaged gem using "sudo td-agent-gem install ". If I attempt to start td-agent after installing the gem the startup fails with this error:

"fluentd[65736]: /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/stub_specification.rb:116:in `initialize': Permission denied @ rb_sysopen - /opt/td-agent/embedded/lib/ruby/gems/2.4.0/specifications/fluentd-0.12.43.gemspec (Errno::EACCES)
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/stub_specification.rb:116:in `open'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/stub_specification.rb:116:in `data'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/stub_specification.rb:207:in `valid?'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:751:in `select'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:751:in `gemspec_stubs_in'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:776:in `block in map_stubs'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:773:in `each'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:773:in `flat_map'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:773:in `map_stubs'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:765:in `installed_stubs'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/specification.rb:852:in `stubs_for'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/dependency.rb:279:in `matching_specs'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems.rb:269:in `find_spec_for_exe'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems.rb:299:in `activate_bin_path'
Sep  6 04:15:03 PkrVMacwarbgnv0 fluentd[65736]: #011from /opt/td-agent/embedded/bin/fluentd:23:in `<main>'"

I noticed that the file mentioned in the error message had permissions 640, which does not grant read access to anyone but the file owner. In this case the file owner was root. I granted read permissions to "other" users for all files in /opt/td-agent/embedded/. After I granted permissions I tried to start up td-agent and it failed with an "unknown plugin" error while parsing the config file. The unknown plugin was the one from the prepackaged gem that had successfully installed before. I successfully reinstalled the prepackaged gem; however, the permissions issue comes back after that. Is there a known issue with prepackaged gem installation in td-agent 3.5.0?

@repeatedly
Copy link
Contributor

Is there a known issue with prepackaged gem installation in td-agent 3.5.0?

Not known issue and no report from other users. I'm not sure why this happens.

fluentd-0.12.43.gemspec

One weird point is here. td-agent 3.5.0 uses fluentd v1.x, so v0.12 should not be used.

@pandeyrahulgwl
Copy link

I am also facing this issue, even after giving permission to /opt/td-agent/embedded/lib/ruby/site_ruby/2.4.0/rubygems/*
i am still getting initialize': Permission denied @ rb_sysopen error.

Can anyone help ?
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants