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

The agent.download.proxy_url setting is ignored for Fleet managed agents while it works for standalone #3560

Closed
cmacknz opened this issue Oct 6, 2023 · 2 comments · Fixed by #3803
Assignees
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team

Comments

@cmacknz
Copy link
Member

cmacknz commented Oct 6, 2023

Using a standalone agent if I set:

agent.download:
#   # source of the artifacts, requires elastic like structure and naming of the binaries
#   # e.g /windows-x86.zip
  sourceURI: "https://artifacts.elastic.co/downloads/beats/"
  proxy_url: http://127.0.0.1:9000/

and then run:

sudo elastic-agent upgrade 8.10.1

I can see the agent attempting to download from that location unsuccessfully as expected on my local machine:

{"log.level":"warn","@timestamp":"2023-10-06T20:10:03.432Z","log.origin":{"file.name":"upgrade/step_download.go","file.line":184},"message":"unable to download package: 2 errors occurred:\n\t* package '/Library/Elastic/Agent/data/elastic-agent-471966/downloads/elastic-agent-8.10.1-darwin-aarch64.tar.gz' not found: open /Library/Elastic/Agent/data/elastic-agent-471966/downloads/elastic-agent-8.10.1-darwin-aarch64.tar.gz: no such file or directory\n\t* fetching package failed: Get \"https://artifacts.elastic.co/downloads/beats/beats/elastic-agent/elastic-agent-8.10.1-darwin-aarch64.tar.gz\": proxyconnect tcp: dial tcp 127.0.0.1:9000: connect: connection refused\n\n; retrying (will be retry 5381639) in 0s.","log":{"source":"elastic-agent"},"ecs.version":"1.6.0"}

However if I do this from Fleet using the overrides API it does not work. Note that we plan to officially support doing this as described in elastic/kibana#162862

I add the override with:

PUT kbn:/api/fleet/agent_policies/<policy_id>
{
   "name": "Test policy",
    "namespace": "default",
    "overrides": {
         "agent": {
              "download": {
                "proxy_url": "http://127.0.0.1:9000/"
              }
            }
    }
}

I confirm the override was applied correctly in the agent policy locally:

sudo elastic-agent inspect
agent:
  download:
    proxy_url: http://127.0.0.1:9000
    sourceURI: https://artifacts.elastic.co/downloads/
  features: null
  headers: null
  id: c1124434-dfcc-45ce-b214-3e2e2b92e8c9
  logging:
    level: info
...

If I then initiate an upgrade from Fleet it succeeds and the proxy_url setting is ignored.

@cmacknz cmacknz added bug Something isn't working Team:Elastic-Agent Label for the Agent team labels Oct 6, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent (Team:Elastic-Agent)

@cmacknz
Copy link
Member Author

cmacknz commented Oct 6, 2023

I should note elatic-agent restart in the Fleet managed case did not cause the setting to apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants