Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install fluent-plugin-grafana-loki #719

Closed
srstsavage opened this issue Jul 5, 2019 · 14 comments · Fixed by #757
Closed

Can't install fluent-plugin-grafana-loki #719

srstsavage opened this issue Jul 5, 2019 · 14 comments · Fixed by #757
Assignees
Labels
type/bug Somehing is not working as expected

Comments

@srstsavage
Copy link
Contributor

gem install fluent-plugin-grafana-loki, as described in the fluent plugin README, errors, as illustrated by this docker build:

$ docker build . <<EOF
FROM fluent/fluentd:v1.4-debian-2

USER root

RUN gem install fluent-plugin-grafana-loki

USER fluent
EOF
Sending build context to Docker daemon  13.31kB
Step 1/4 : FROM fluent/fluentd:v1.4-debian-2
 ---> 48ed3b8e9450
Step 2/4 : USER root
 ---> Running in 28b51bb6a786
Removing intermediate container 28b51bb6a786
 ---> 2c778bec3cbc
Step 3/4 : RUN gem install fluent-plugin-grafana-loki
 ---> Running in 852d185ecfe0
ERROR:  While executing gem ... (Gem::Package::PathError)
    installing into parent path /usr/local/bundle/LICENSE of /usr/local/bundle/gems/fluent-plugin-grafana-loki-1.0.0 is not allowed
The command '/bin/sh -c gem install fluent-plugin-grafana-loki' returned a non-zero code: 1
@srstsavage
Copy link
Contributor Author

Dockerfile illustrating temporary workaround (install from source):

FROM fluent/fluentd:v1.4-debian-2

USER root

RUN apt-get update \
    && apt-get install -y --no-install-recommends git \
    && rm -rf /var/lib/apt/lists/*

#Install fluent-plugin-grafana-loki from source
#https://github.com/grafana/loki/issues/719
RUN rm -rf /tmp/loki \
    && git clone --depth 1 https://github.com/grafana/loki.git /tmp/loki \
    && cd /tmp/loki/fluentd/fluent-plugin-grafana-loki \
    && sed -i "s|^  spec.files.*|  spec.files = Dir.glob('{bin,lib}/**/*')|" fluent-plugin-grafana-loki.gemspec \
    && gem build fluent-plugin-grafana-loki.gemspec \
    && gem install fluent-plugin-grafana-loki-*.gem \
    && cd /tmp \
    && rm -rf /tmp/loki

USER fluent

@dawidmalina
Copy link
Contributor

I think this is related to this: #682

@srstsavage
Copy link
Contributor Author

Ah, yes, didn’t see that PR before opening. I can close as a duplicate, but it might be useful to have the workaround code available until #682 is merged.

@cyriltovena
Copy link
Contributor

how about now ?

@dawidmalina
Copy link
Contributor

I still see this issue:

ERROR:  While executing gem ... (Gem::Package::PathError)
    installing into parent path /opt/td-agent/embedded/lib/ruby/gems/2.4.0/LICENSE of /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-grafana-loki-1.0.0 is not allowed

I think that version bump will be needed as here: https://rubygems.org/gems/fluent-plugin-grafana-loki/ we still have old 1.0.0 version which is same as here: https://github.com/grafana/loki/blob/master/fluentd/fluent-plugin-grafana-loki/fluent-plugin-grafana-loki.gemspec#L5

@cyriltovena
Copy link
Contributor

/cc @briangann Can you help me out here ? How do we handle gems ?

@briangann
Copy link
Contributor

let me bump the version number and publish the new gem

@candlerb
Copy link
Contributor

I tried it just now and see the same problem:

root@fluentd:~# gem install fluent-plugin-grafana-loki
Fetching: fluent-plugin-grafana-loki-1.0.0.gem (100%)
ERROR:  While executing gem ... (Gem::Package::PathError)
    installing into parent path /var/lib/gems/2.3.0/LICENSE of /var/lib/gems/2.3.0/gems/fluent-plugin-grafana-loki-1.0.0 is not allowed

This is under Ubuntu 16.04.5.

root@fluentd:~# ruby --version
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]

@candlerb
Copy link
Contributor

Probably not worth bumping the version number until #749 is fixed anyway

@cyriltovena
Copy link
Contributor

do we need to bump it again ?

@candlerb
Copy link
Contributor

Yes. #750 / #751 did not change any gem packaging.

@iamparamvs
Copy link

Can someone tell me which image of Fluentd do I have to use finally which includes the loki-gem to deploy flunetd as a daemonset?

@loganrobertclemons
Copy link

Can someone tell me which image of Fluentd do I have to use finally which includes the loki-gem to deploy flunetd as a daemonset?

I don't know, but if you ended up finding one, please link it in here.

@iamparamvs
Copy link

Hey @loganrobertclemons

I don't know, but if you ended up finding one, please link it in here.

I have created my own image and it works totally fine. I have used it in several deployments as a daemonSet as well as a single DeploymentSet. It is using the Loki plugin 1.2.16 and Fluentd 1.11.4. You can use it if you feel like: attaching the command below:

docker pull iamparam/loki-fluentd-kubernetes-daemonset:v1.11.4-debian-forward-1.2.16.gem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Somehing is not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants