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

[Elastic Agent] Set permissions during installation #26665

Merged
merged 12 commits into from
Jul 22, 2021

Conversation

blakerouse
Copy link
Contributor

What does this PR do?

The install command now sets the correct permissions for the installation directory on all platforms.

Why is it important?

So the started Elastic Agent that is running as a system level service has the required permissions to run correctly and to ensure that only those with the correct level of permissions can access those files.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@blakerouse blakerouse added Team:Elastic-Agent Label for the Agent team backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify labels Jul 1, 2021
@blakerouse blakerouse self-assigned this Jul 1, 2021
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jul 1, 2021
@blakerouse blakerouse marked this pull request as ready for review July 1, 2021 13:44
@elasticmachine
Copy link
Collaborator

Pinging @elastic/agent (Team:Agent)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 1, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-07-22T13:53:23.920+0000

  • Duration: 11 min 59 sec

  • Commit: 80ff3bb

Trends 🧪

Image of Build Times

❕ Flaky test report

No test was executed to be analysed.

@mergify
Copy link
Contributor

mergify bot commented Jul 5, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b agent-install-perms upstream/agent-install-perms
git merge upstream/master
git push upstream agent-install-perms

Copy link
Contributor

@michalpristas michalpristas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good it would be nice if somebody with env where problem occurred could test it before merge

@blakerouse
Copy link
Contributor Author

@alvarolobato Anyway you could give this a test to see if it fixes the issue for you?

@alvarolobato
Copy link

alvarolobato commented Jul 7, 2021

@blakerouse I gave it a try but this only generates 8.0 artifacts which are not working with my cloud deployment on 7.13, is there a config option to make the agent ignore the fleet server version? or do I need to manually run a 8.0 fleet server to test this?

2021-07-07T18:30:33.671+0100    INFO    cmd/enroll_cmd.go:414   Starting enrollment to URL: https://xxxxxxxxxxx.fleet.eu-west-1.aws.found.io:443/
Error: fail to enroll: fail to execute request to fleet-server: status code: 400, fleet-server returned an error: UnsupportedVersion, message: version is not supported
Error: enroll command failed with exit code: 1

I called the install command without enrollment token to see how the files looked like and at least now the service generates logs, which didn't before and this is the error:

{"log.level":"error","@timestamp":"2021-07-07T17:35:47.125Z","log.logger":"control","log.origin":{"file.name":"server/server.go","file.line":63},"message":"unable to create listener: failed to lookup Administrators group: Não foi efectuado qualquer mapeamento entre nomes de contas e IDs de segurança.","ecs.version":"1.6.0"}

The only windows I have access to is in Portuguese, the error translates to:
"failed to lookup Administrators group: No mapping between account names and security IDs was done."

@blakerouse
Copy link
Contributor Author

@alvarolobato There is no way to override the version check.

You will need to manually run the whole stack with 8.0.0, or you could normally spin up an 8.0.0-SNAPSHOT in the cloud (but I believe it is broken until a new SNAPSHOT is built).

@alvarolobato
Copy link

@blakerouse ok, I'll start an 8 snapshot once it's working, I'll give it a try.

Not sure if that error is helpful.

@mergify
Copy link
Contributor

mergify bot commented Jul 9, 2021

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b agent-install-perms upstream/agent-install-perms
git merge upstream/master
git push upstream agent-install-perms

@blakerouse
Copy link
Contributor Author

@alvarolobato Any way you could setup a local stack and try this? 8.0.0-SNAPSHOT still seems broken in Cloud, but running it locally with a docker-compose works. I want to get this in soon as I think it needs to be in 7.14, but don't want it in to late if any issue pop up from the change.

@alvarolobato
Copy link

@blakerouse cloud is working, I was just able to test this and it's still failing. This is what I'm getting on the logs:

{"log.level":"error","@timestamp":"2021-07-14T14:55:49.762Z","log.logger":"control","log.origin":{"file.name":"server/server.go","file.line":63},"message":"unable to create listener: failed to lookup Administrators group: Não foi efectuado qualquer mapeamento entre nomes de contas e IDs de segurança.","ecs.version":"1.6.0"}

agent-perms.csv

@alvarolobato
Copy link

alvarolobato commented Jul 14, 2021

These are the logs if I start as Administrator:

{"log.level":"info","@timestamp":"2021-07-14T15:01:25.793Z","log.origin":{"file.name":"warn/warn.go","file.line":18},"message":"The Elastic Agent is currently in BETA and should not be used in production","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:25.794Z","log.origin":{"file.name":"application/application.go","file.line":68},"message":"Detecting execution mode","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:25.796Z","log.origin":{"file.name":"application/application.go","file.line":93},"message":"Agent is managed by Fleet","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:25.797Z","log.origin":{"file.name":"capabilities/capabilities.go","file.line":59},"message":"capabilities file not found in C:\\Program Files\\Elastic\\Agent\\capabilities.yml","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:26.795Z","log.logger":"composable","log.origin":{"file.name":"composable/controller.go","file.line":46},"message":"EXPERIMENTAL - Inputs with variables are currently experimental and should not be used in production","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:26.928Z","log.logger":"composable.providers.docker","log.origin":{"file.name":"docker/docker.go","file.line":43},"message":"Docker provider skipped, unable to connect: protocol not available","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:26.931Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":62},"message":"Starting stats endpoint","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:26.931Z","log.origin":{"file.name":"application/managed_mode.go","file.line":290},"message":"Agent is starting","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:26.931Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":64},"message":"Metrics endpoint listening on: \\\\.\\pipe\\elastic-agent (configured: npipe:///elastic-agent)","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2021-07-14T15:01:27.033Z","log.origin":{"file.name":"application/managed_mode.go","file.line":303},"message":"failed to ack update open C:\\Program Files\\Elastic\\Agent\\data\\.update-marker: O sistema não conseguiu localizar o ficheiro especificado.","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:30.517Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is n-fHYPrR","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:30.517Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 3 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:32.396Z","log.origin":{"file.name":"status/reporter.go","file.line":236},"message":"Elastic Agent status changed to: 'error'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:32.396Z","log.origin":{"file.name":"log/reporter.go","file.line":36},"message":"2021-07-14T16:01:32+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to FAILED: operation 'operation-verify' failed to verify filebeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n - type: 'ERROR' - sub_type: 'FAILED'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:32.397Z","log.origin":{"file.name":"operation/operation_retryable.go","file.line":85},"message":"operation operation-verify failed, err: operation 'operation-verify' failed to verify filebeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:32.397Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'operation-verify' failed to verify filebeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n: operation 'operation-verify' failed to verify filebeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:34.995Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is n-fHYPrR","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:34.995Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 3 step(s)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:39.553Z","log.origin":{"file.name":"operation/operation_fetch.go","file.line":75},"message":"downloaded binary 'filebeat.8.0.0-SNAPSHOT' into 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\filebeat-8.0.0-SNAPSHOT-windows-x86_64.zip' as part of operation 'operation-fetch'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:44.857Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:01:44+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to RESTARTING: Restarting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:46.048Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:01:46+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:46.515Z","log.origin":{"file.name":"operation/operation_retryable.go","file.line":85},"message":"operation operation-verify failed, err: operation 'operation-verify' failed to verify metricbeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:46.515Z","log.origin":{"file.name":"log/reporter.go","file.line":36},"message":"2021-07-14T16:01:46+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to FAILED: operation 'operation-verify' failed to verify metricbeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n - type: 'ERROR' - sub_type: 'FAILED'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-14T15:01:46.516Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'operation-verify' failed to verify metricbeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n: operation 'operation-verify' failed to verify metricbeat.8.0.0-SNAPSHOT: 3 errors occurred:\n\t* fetching asc file from 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc': open C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: O sistema não conseguiu localizar o ficheiro especificado.\n\t* check detached signature: openpgp: invalid signature: hash tag doesn't match\n\t* fetching asc file from https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc: call to 'https://artifacts.elastic.co/downloads/beats/metricbeat/metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip.asc' returned unsuccessful status code: 404\n\n","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:46.548Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:01:46+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:48.671Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is n-fHYPrR","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:48.672Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 3 step(s)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:49.889Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-install' skipped for filebeat.8.0.0-SNAPSHOT","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:49.889Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-start' skipped for filebeat.8.0.0-SNAPSHOT","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:01:54.996Z","log.origin":{"file.name":"operation/operation_fetch.go","file.line":75},"message":"downloaded binary 'metricbeat.8.0.0-SNAPSHOT' into 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-e22bb5\\downloads\\metricbeat-8.0.0-SNAPSHOT-windows-x86_64.zip' as part of operation 'operation-fetch'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:01.206Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:01+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to RESTARTING: Restarting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:02.460Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-install' skipped for filebeat.8.0.0-SNAPSHOT","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:03.081Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:03+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:03.581Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:03+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:03.653Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:03+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:04.643Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-install' skipped for metricbeat.8.0.0-SNAPSHOT","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:05.111Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:05+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:05.124Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":66},"message":"Updating internal state","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:05.331Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:05+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:05.803Z","log.origin":{"file.name":"status/reporter.go","file.line":236},"message":"Elastic Agent status changed to: 'online'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-14T15:02:07.376Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-14T16:02:07+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[caef0447-4c22-4f5f-8645-f6777711eebe]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}

@blakerouse
Copy link
Contributor Author

@alvarolobato Based on the logs you provided, it seems that it is running. Installing as an Administrator is required. Other than the log message, are you seeing the Elastic Agent stop running?

@alvarolobato
Copy link

@blakerouse I installed as administrator, but when I run the service as system it dies and the logs are the first ones I shared.
If I change the service to user the administrator account it will run and show the second log file I shared.

So it's not working as expected, it should run properly with the system account.

@blakerouse
Copy link
Contributor Author

@alvarolobato Thanks for explaining I was confused.

Being I can't reproduce the behavior that you are seeing it is hard to know what is heppening. I will see if I can figure out why the listener cannot be created.

@alvarolobato
Copy link

@blakerouse let me know if there's anything I can do to help with testing.

@blakerouse
Copy link
Contributor Author

Looking at the permission file you provided (which is very helpful, thank you!) I see the issue. The issue is that being your Windows is not en_US the Administrator account name is different. Elastic Agent does some look ups based on the Administrator and Administrators group name, and in your case it is actually Administradores

@alvarolobato
Copy link

@blakerouse but there should be a way to lookup in a language independent way, I don't believe software will need take that into account.

For file names the common files have also a localized name, but the english name usually works.

@alvarolobato
Copy link

Just saw your push. I'll wait for the build and test again.

@blakerouse
Copy link
Contributor Author

@alvarolobato Build should be ready if you can give it a try.

@alvarolobato
Copy link

alvarolobato commented Jul 15, 2021

@blakerouse IT WORKS!!!!!!

@blakerouse
Copy link
Contributor Author

@alvarolobato Can you test again? Finally got a good build.

@blakerouse
Copy link
Contributor Author

@alvarolobato I wonder if the build you are using is the correct one, like maybe the build was not published correctly or something?

Because just grep-ing through all the code based for failed to lookup shows no results in my branch. That makes me think the filebeat and metricbeat that is being used on your system is not the one built from this PR.

@blakerouse
Copy link
Contributor Author

@alvarolobato
Copy link

@blakerouse I thought exactly the same, it's very strange. This is the exact URL I used, copied from the browser: https://storage.googleapis.com/beats-ci-artifacts/pull-requests/pr-26665/elastic-agent/elastic-agent-8.0.0-SNAPSHOT-windows-x86_64.zip

Also the build is different from the previous one, it has 13KB more than before and build dates are 2021-07-21 at 14:03:10 (don't know the timezone) so it matches with your PR.

Can you launch the job again and see if not all the changes are in?

@blakerouse
Copy link
Contributor Author

/package

@blakerouse
Copy link
Contributor Author

@alvarolobato
Copy link

alvarolobato commented Jul 22, 2021

@blakerouse filebeat and metricbeat are working now and reporting data. 🎉 The file was different from the previous one, that's odd.

Endpoint still failing, but I guess you want to split this and give it to security.

{"log.level":"info","@timestamp":"2021-07-22T16:26:37.489Z","log.origin":{"file.name":"cmd/run.go","file.line":133},"message":"Artifact has been built with security disabled. Elastic Agent will not verify signatures of the artifacts.","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:39.749Z","log.origin":{"file.name":"application/application.go","file.line":66},"message":"Detecting execution mode","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2021-07-22T16:26:39.753Z","log.logger":"cfgwarn","log.origin":{"file.name":"tlscommon/config.go","file.line":100},"message":"DEPRECATED: Treating the CommonName field on X.509 certificates as a host name when no Subject Alternative Names are present is going to be removed. Please update your certificates if needed. Will be removed in version: 8.0.0","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:39.753Z","log.origin":{"file.name":"application/application.go","file.line":91},"message":"Agent is managed by Fleet","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:39.754Z","log.origin":{"file.name":"capabilities/capabilities.go","file.line":59},"message":"capabilities file not found in C:\\Program Files\\Elastic\\Agent\\capabilities.yml","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:40.387Z","log.logger":"composable.providers.docker","log.origin":{"file.name":"docker/docker.go","file.line":43},"message":"Docker provider skipped, unable to connect: protocol not available","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:40.390Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":62},"message":"Starting stats endpoint","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:40.390Z","log.origin":{"file.name":"application/managed_mode.go","file.line":290},"message":"Agent is starting","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:40.390Z","log.logger":"api","log.origin":{"file.name":"api/server.go","file.line":64},"message":"Metrics endpoint listening on: \\\\.\\pipe\\elastic-agent (configured: npipe:///elastic-agent)","ecs.version":"1.6.0"}
{"log.level":"warn","@timestamp":"2021-07-22T16:26:40.491Z","log.origin":{"file.name":"application/managed_mode.go","file.line":303},"message":"failed to ack update open C:\\Program Files\\Elastic\\Agent\\data\\.update-marker: O sistema não conseguiu localizar o ficheiro especificado.","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:43.792Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is GsX8yolV","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:43.792Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 3 step(s)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:48.375Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:48+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:50.277Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:50+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:52.420Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:52+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:52.794Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-install' skipped for filebeat.8.0.0-SNAPSHOT","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:53.081Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:53+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:53.418Z","log.origin":{"file.name":"operation/operator.go","file.line":259},"message":"operation 'operation-install' skipped for metricbeat.8.0.0-SNAPSHOT","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:53.966Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:53+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to STARTING: Starting - type: 'STATE' - sub_type: 'STARTING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:53.981Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":66},"message":"Updating internal state","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:54.802Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:54+01:00 - message: Application: filebeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:54.866Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:54+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:26:56.268Z","log.origin":{"file.name":"log/reporter.go","file.line":40},"message":"2021-07-22T17:26:56+01:00 - message: Application: metricbeat--8.0.0-SNAPSHOT--36643631373035623733363936343635[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to RUNNING: Running - type: 'STATE' - sub_type: 'RUNNING'","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:15.620Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:15.621Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:18.190Z","log.origin":{"file.name":"operation/operation_fetch.go","file.line":75},"message":"downloaded binary 'endpoint-security.8.0.0-SNAPSHOT' into 'C:\\Program Files\\Elastic\\Agent\\data\\elastic-agent-93b14a\\downloads\\endpoint-security-8.0.0-SNAPSHOT-windows-x86_64.zip' as part of operation 'operation-fetch'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:34.589Z","log.origin":{"file.name":"status/reporter.go","file.line":236},"message":"Elastic Agent status changed to: 'error'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:34.590Z","log.origin":{"file.name":"log/reporter.go","file.line":36},"message":"2021-07-22T17:29:34+01:00 - message: Application: endpoint-security--8.0.0-SNAPSHOT[9174d0a3-d3c7-4417-9da8-ddd19108e974]: State changed to FAILED: operation 'Exec' failed (return code: 1): (command had no output) - type: 'ERROR' - sub_type: 'FAILED'","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:34.590Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:36.673Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:36.673Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:39.538Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:41.855Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:41.855Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:44.530Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:46.901Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:46.902Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:49.670Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:51.887Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:51.888Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:54.561Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:56.891Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:29:56.892Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:29:59.570Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:02.081Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:02.082Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:04.676Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:07.124Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:07.124Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:09.933Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:12.161Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:12.161Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:14.871Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:17.148Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:17.148Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:19.872Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:22.429Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:22.429Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:25.183Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:27.674Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:27.674Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:30.364Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:32.922Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:32.923Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:35.657Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:37.932Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:37.932Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:50.416Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:52.822Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:52.823Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:30:55.644Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:58.145Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:30:58.145Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:00.891Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:03.058Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:03.058Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:06.016Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:08.087Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:08.087Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:10.719Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:12.987Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:12.987Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:15.754Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:18.225Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:18.226Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:21.046Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:23.376Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:23.377Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:25.773Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:28.270Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:28.271Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2021-07-22T16:31:30.950Z","log.origin":{"file.name":"fleet/fleet_gateway.go","file.line":180},"message":"failed to dispatch actions, error: operator: failed to execute step sc-run, error: operation 'Exec' failed (return code: 1): (command had no output): operation 'Exec' failed (return code: 1): (command had no output)","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:33.227Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":48},"message":"New State ID is B65qeITL","ecs.version":"1.6.0"}
{"log.level":"info","@timestamp":"2021-07-22T16:31:33.227Z","log.origin":{"file.name":"stateresolver/stateresolver.go","file.line":49},"message":"Converging state requires execution of 4 step(s)","ecs.version":"1.6.0"}

@blakerouse
Copy link
Contributor Author

@alvarolobato Yeah let's split it. I will merge this for Elastic Agent and beats, and then we can work on the issue for Endpoint Security.

@blakerouse blakerouse merged commit 48a4703 into elastic:master Jul 22, 2021
@blakerouse blakerouse deleted the agent-install-perms branch July 22, 2021 18:39
mergify bot pushed a commit that referenced this pull request Jul 22, 2021
* Change permissions on install on Windows

* Update go.sum.

* Add perms for unix.

* Fix format.

* Add changelog entry.

* Fix imports.

* Fix go.sum.

* Add comments for access masks.

* Fix control listener to use Administrators GUID vs name lookup

* Set SecurityDescriptor for starting the Elastic Agent local metrics endpoint

* Fix format

* Fix lookup in libbeat for Administrators group

(cherry picked from commit 48a4703)
mergify bot pushed a commit that referenced this pull request Jul 22, 2021
* Change permissions on install on Windows

* Update go.sum.

* Add perms for unix.

* Fix format.

* Add changelog entry.

* Fix imports.

* Fix go.sum.

* Add comments for access masks.

* Fix control listener to use Administrators GUID vs name lookup

* Set SecurityDescriptor for starting the Elastic Agent local metrics endpoint

* Fix format

* Fix lookup in libbeat for Administrators group

(cherry picked from commit 48a4703)
@alvarolobato
Copy link

@blakerouse thanks for all the work put into these painful bugs, I know it's really hard and frustrating when you can't reproduce it yourself.

blakerouse added a commit that referenced this pull request Jul 23, 2021
* Change permissions on install on Windows

* Update go.sum.

* Add perms for unix.

* Fix format.

* Add changelog entry.

* Fix imports.

* Fix go.sum.

* Add comments for access masks.

* Fix control listener to use Administrators GUID vs name lookup

* Set SecurityDescriptor for starting the Elastic Agent local metrics endpoint

* Fix format

* Fix lookup in libbeat for Administrators group

(cherry picked from commit 48a4703)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
blakerouse added a commit that referenced this pull request Jul 23, 2021
* Change permissions on install on Windows

* Update go.sum.

* Add perms for unix.

* Fix format.

* Add changelog entry.

* Fix imports.

* Fix go.sum.

* Add comments for access masks.

* Fix control listener to use Administrators GUID vs name lookup

* Set SecurityDescriptor for starting the Elastic Agent local metrics endpoint

* Fix format

* Fix lookup in libbeat for Administrators group

(cherry picked from commit 48a4703)

Co-authored-by: Blake Rouse <blake.rouse@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.14.0 Automated backport with mergify backport-v7.15.0 Automated backport with mergify Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elastic Agent service fails to start on windows with default installation
5 participants