Giter Club home page Giter Club logo

Comments (8)

dj-wasabi avatar dj-wasabi commented on May 31, 2024 4

@sk1u You are using Debian or Ubuntu as well?

It seems the apt repository containing Telegraf only contains the latest available version. With every new Telegraf version, the old one is removed from their apt repository and thus new installation fails.

I've created an issue on the Telegraf project:

influxdata/telegraf#5685

from ansible-telegraf.

asfaltboy avatar asfaltboy commented on May 31, 2024 2

Just wanted to chip in, that using telegraf_agent_version only solves half the problem, as running the role again will fail if a new version comes out. It would be awesome if there was a way to "force" an update to the latest "minor/patch" version (e.g today it's 1.10.4).

I had the previous patch version before, and when I ran the role I saw this:

TASK [dj-wasabi.telegraf : Debian | Install Telegraf package] ******************************************************************************************************************************************************************************
Tuesday 28 May 2019  19:12:15 +0200 (0:00:00.040)       0:00:20.324 ***********
FAILED - RETRYING: Debian | Install Telegraf package (3 retries left).
FAILED - RETRYING: Debian | Install Telegraf package (2 retries left).
FAILED - RETRYING: Debian | Install Telegraf package (1 retries left).
fatal: [my-server.example.com]: FAILED! => {"attempts": 3, "cache_update_time": 1557211497, "cache_updated": false, "changed": false, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-confdef\" -o \"Dpkg::Options::=--force-confold\"     install 'telegraf'' failed: E: Failed to fetch https://repos.influxdata.com/debian/pool/stable/t/telegraf/telegraf_1.10.3-1_amd64.deb  404  Not Found\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n", "rc": 100, "stderr": "E: Failed to fetch https://repos.influxdata.com/debian/pool/stable/t/telegraf/telegraf_1.10.3-1_amd64.deb  404  Not Found\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\n", "stderr_lines": ["E: Failed to fetch https://repos.influxdata.com/debian/pool/stable/t/telegraf/telegraf_1.10.3-1_amd64.deb  404  Not Found", "E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"], "stdout": "Reading package lists...\nBuilding dependency tree...\nReading state information...\nThe following packages will be upgraded:\n  telegraf\n1 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.\nNeed to get 18.1 MB of archives.\nAfter this operation, 0 B of additional disk space will be used.\nErr:1 https://repos.influxdata.com/debian stretch/stable amd64 telegraf amd64 1.10.3-1\n  404  Not Found\n", "stdout_lines": ["Reading package lists...", "Building dependency tree...", "Reading state information...", "The following packages will be upgraded:", "  telegraf", "1 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.", "Need to get 18.1 MB of archives.", "After this operation, 0 B of additional disk space will be used.", "Err:1 https://repos.influxdata.com/debian stretch/stable amd64 telegraf amd64 1.10.3-1", "  404  Not Found"]}

Do note that I was able to run apt install telegraf manually just fine, and this unblocked me. Maybe we should consider using some of the parameters of the apt_module ? Such as autoclean, force_apt_get, update_cache, etc ... if either of these works, we can hide it behind an optional toggle for extra safety / backward-compat.

from ansible-telegraf.

edbizarro avatar edbizarro commented on May 31, 2024

hm, with telegraf_agent_version: 1.10.2 everything works, but with default does not

from ansible-telegraf.

maiku1008 avatar maiku1008 commented on May 31, 2024

I have experienced the same issue.
Using default telegraf_agent_version yields the same error message, even if I set it to telegraf_agent_version: 1.10.2, I still get failed: E: Version '1.10.2-1' for 'telegraf' was not found.

The workaround in my case was to use instead telegraf_agent_package_state: latest as per docs.
Would be nice however to freeze the Telegraf version.

from ansible-telegraf.

maiku1008 avatar maiku1008 commented on May 31, 2024

That is right, it is a Debian 9 host.

Your explanation makes sense, thank you for that.

from ansible-telegraf.

matttrach avatar matttrach commented on May 31, 2024

This is still happening, even on "online" installs. This entire step is contradictory (the name is "==latest", the when is "!= latest"). It always sets the name, unless 'latest' is not set...

- name: "Debian | Set name if state == latest"
set_fact:
telegraf_agent_package: telegraf={{ telegraf_agent_version }}-{{ telegraf_agent_version_patch }}
when:
- telegraf_agent_package_state != "latest"

When combined with this, you can only use the defaults (which are a minor version behind 1.10 vs 1.11.5) because the destination "telegraf_agent_package" needs to be a full file path.

- name: "Debian | Download Telegraf package (online)"
get_url:
url: https://dl.influxdata.com/telegraf/releases/{{ telegraf_agent_package_file_deb }}
dest: "{{ telegraf_agent_package }}"
when:
- telegraf_agent_package_method == "online"

from ansible-telegraf.

matttrach avatar matttrach commented on May 31, 2024

When I set my version to 1.11.5 the "telegraf_agent_package" variable gets set to "telegraf=1.11.5-1" which is not a path as required by the get_url module.

These could be a typo:
Maybe this should be "== latest"?

- telegraf_agent_package_state != "latest"

from ansible-telegraf.

matttrach avatar matttrach commented on May 31, 2024

Changing the conditional to match the task description fixed my problems (per the pull request I created). This pull request is a simple 1 character change which allows most installs to work, it should be an easy approval:
#108

from ansible-telegraf.

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.