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

PermissionError when running local monkey #3578

Closed
ilija-lazoroski opened this issue Aug 10, 2023 · 3 comments
Closed

PermissionError when running local monkey #3578

ilija-lazoroski opened this issue Aug 10, 2023 · 3 comments
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island.
Milestone

Comments

@ilija-lazoroski
Copy link
Contributor

Describe the bug

When we try to run the agent from the island using Run Local Monkey service on Windows sometimes we get PermissionError that we can't access the agent.

This is a bit racey due to the fact that the agent can still be running on the machine.
The issue is produced by this lines:

try:
with open(dest_path, "wb") as dest_agent:
copyfileobj(agent_binary, dest_agent)
dest_path.chmod(stat.S_IRWXU | stat.S_IRWXG)
except Exception as exc:
logger.error("Copy file failed", exc_info=True)
return False, "Copy file failed: %s" % exc

What was tried is using common.utils.file_utils.open_securely_permissioned_file which doesn't create the agent if it is already existing.

To Reproduce

Steps to reproduce the behavior:

  1. Run depth_3 BB tests couple of time
  2. You should see error.

Expected behavior

Two things shouldn't happen: the agent should be stopped and not used by a process and the agent should be created on the machine regardless if it is existing or not.

Screenshots

Error message now.
image

The check with common.utils.file_utils.open_securely_permissioned_file
image

Machine version (please complete the following information):

  • OS: Windows
@ilija-lazoroski ilija-lazoroski added the Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. label Aug 10, 2023
@mssalvatore mssalvatore added this to the v2.3.0 milestone Aug 10, 2023
@mssalvatore
Copy link
Collaborator

This is probably caused by #3543

@mssalvatore
Copy link
Collaborator

I think this is resolved by #3557 and #3543. @ilija-lazoroski Please confirm.

@cakekoa
Copy link
Contributor

cakekoa commented Aug 17, 2023

Confirmed, this is resolved by #3543

@cakekoa cakekoa closed this as completed Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island.
Projects
None yet
Development

No branches or pull requests

3 participants