Git Product home page Git Product logo

Comments (7)

aWeinzierl avatar aWeinzierl commented on June 16, 2024 1

ansible-galaxy collection install grafana.grafana:2.0.0 --force

Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/grafana-grafana-2.0.0.tar.gz to /home/user/.ansible/tmp/ansible-local-14391lsp98y6s/tmpqnsaipml/grafana-grafana-2.0.0-cvfsnfq5
Installing 'grafana.grafana:2.0.0' to '/home/user/.ansible/collections/ansible_collections/grafana/grafana'
grafana.grafana:2.0.0 was installed successfully

sudo rm /usr/local/bin/grafana-agent
sudo rm /etc/systemd/system/multi-user.target.wants/grafana-agent.service
sudo rm -r /etc/grafana/
sudo rm -r /etc/grafana-agent/

Interestingly, the config file /etc/grafana/agent-config.yaml (as it is referenced in the service, still) isn't recreated (I am using the grafana_agent_provisioned_config_file variable as documented now) unlike the service and binary files.

Also, TASK [grafana.grafana.grafana_agent : Ensure Grafana Agent is started and enabled on boot] doesn't fail despite systemctl status grafana-agent.service clearly shows the service failed to start.

If its still an issue after this, Feel free to reopen the issue, Happy to debug further

I think I lack the permission to do this

from grafana-ansible-collection.

mattburchett avatar mattburchett commented on June 16, 2024 1

I encountered an issue while using the latest version of the grafana.grafana collection (2.0.0). In my playbook, I have a mix of amd64 and arm64 hosts. The problem arises when running the playbook, as it fails and displays the following error message:

TASK [grafana.grafana.grafana_agent : Propagate downloaded binary] *************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: If you are using a module and expect the file to exist on the remote, see the remote_src option
fatal: [pi01]: FAILED! => {"changed": false, "msg": "Could not find or access '/tmp/grafana-agent/grafana-agent-linux-arm64' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"}

Upon investigation, I discovered that the grafana-agent.zip file contains the amd64 binary instead of the expected arm64 binary on the executing host, so the binary the error is reporting doesn't exist. I also noticed that the file's timestamp predates the playbook failure, indicating that the role only downloads the file once and does not attempt any further downloads for the different architectures.

Thoughts?

from grafana-ansible-collection.

AndrewPaglusch avatar AndrewPaglusch commented on June 16, 2024 1

I was experiencing this issue as well. I just submitted PR #80, which should fix the issue.

from grafana-ansible-collection.

ishanjainn avatar ishanjainn commented on June 16, 2024

Thanks @aWeinzierl for capturing this. With the new Grafana Agent Role updates, The binary URL has also been fixed as part of the new release 2.0.0

I have added a example doc which you can refer for getting started with the updated Agent role

from grafana-ansible-collection.

aWeinzierl avatar aWeinzierl commented on June 16, 2024

Hi, thank you for your reply & update!

While the compatible binary is downloaded now, the grafana-agent.service still refers to agent-linux-amd64 (even after deleting the service configuration and running the playbook again):

$ ls /usr/local/bin/

grafana-agent

$ cat /etc/systemd/system/multi-user.target.wants/grafana-agent.service

[Unit]
Description=Grafana Agent

[Service]
User=grafana-agent
ExecStart=/usr/local/bin/agent-linux-amd64 --config.file=/etc/grafana/agent-config.yaml
Restart=always

[Install]
WantedBy=multi-user.target

The result is that the service fails, because it can't find the executable:

 grafana-agent.service: Failed to locate executable /usr/local/bin/agent-linux-amd64: No such file or directory
systemd[3158]: grafana-agent.service: Failed at step EXEC spawning /usr/local/bin/agent-linux-amd64: No such file or directory
systemd[1]: Started Grafana Agent.
systemd[1]: grafana-agent.service: Main process exited, code=exited, status=203/EXEC
systemd[1]: grafana-agent.service: Failed with result 'exit-code'.
systemd[1]: grafana-agent.service: Scheduled restart job, restart counter is at 1.
systemd[1]: Stopped Grafana Agent.

from grafana-ansible-collection.

ishanjainn avatar ishanjainn commented on June 16, 2024

Try reinstalling the collection using --force
If that doesn't solve it, I would recommend removing the existing Grafana Agent binary, Config file and the service file from the system. And then run the updated playbook (Make sure the collection version is 2.0.0 or above).

If its still an issue after this, Feel free to reopen the issue, Happy to debug further

from grafana-ansible-collection.

ishanjainn avatar ishanjainn commented on June 16, 2024

Try changing the

grafana_agent_local_tmp_dir: /tmp/grafana-agent

To just grafana-agent

from grafana-ansible-collection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.