Skip to content

Error "failed to copy source directory (C:\Program Files\Elastic-Agent)" in powershell is displayed on installing the agent after enrolling and running it #21744

@ghost

Description

Kibana version:
Kibana: 7.10.0 BC1 cloud environment with commit 7a9f9132fffd8567ce3b985dde8bea6529e8fa3c

Elasticsearch version:
Elasticsearch: 7.10.0 BC1 cloud environment

Host OS and Browser version:
Windows , All

Original install method (e.g. download page, yum, from source, etc.):
7.10.0 BC1 cloud environment deployed from Staging cloud platform https://staging.found.no

Description
Error "failed to copy source directory (C:\Program Files\Elastic-Agent)" in powershell is displayed on installing the agent after enrolling and running it

Preconditions

  1. 7.10.0 BC1 cloud environment should be available(with commit 7a9f9132fffd8567ce3b985dde8bea6529e8fa3c).
  2. Login to the above environment with elastic superuser.
  3. 7.10.0 BC1 agent downloaded from https://staging.elastic.co/7.10.0-116336aa/downloads/beats/elastic-agent/elastic-agent-7.10.0-windows-x86_64.zip
  4. A policy should exist.

Steps to Reproduce

  1. RDP to the endpoint and place the agent in C:/ProgramFiles directory
  2. Unarchive the agent
  3. Open powershell as admin and execute the enroll and run command(say) :
    .\elastic-agent enroll https://217abe597a6b48bba2b7bb82bd4aa8bb.us-central1.gcp.foundit.no:9243 TlhCMElYVUJsNGo3WW9rbDJ6clg6UWg2UDlYQUlUOTJNLWQ2QWNKUE5Edw==
    .\elastic-agent.exe run
  4. Execute ./elastic-agent install
  5. Observe that following error is displayed.
    "Error: failed to copy source directory (C:\Program Files\Elastic-Agent) to destination (C:\Program Files\Elastic\Agent):
    read C:\Program Files\Elastic-Agent\data\agent.lock: The process cannot access the file because another process has loc
    ked a portion of the file."

Test data
N/A

Impacted Test case id
N/A

Actual Result
Error "failed to copy source directory (C:\Program Files\Elastic-Agent)" is displayed in powershell on installing the agent after enrolling and running it

Expected Result
User should be successfully able to install the agent after enrolling and running it.

What's working

  • N/A

What's not working

  • N/A

Screenshot
powershell_error

Logs
agent lock file.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions