hermes icon indicating copy to clipboard operation
hermes copied to clipboard

`hermes clean` command fails

Open Aidajafarbigloo opened this issue 11 months ago • 2 comments

hermes clean command on the develop and main branch fails to run.

Behavior:

Run subcommand clean Removing HERMES caches... An error occurred during execution of clean (Find details in './hermes.log')

hermes.log:

1741025466.680383: hermes.cli: ERROR | An error occurred during execution of clean (Find details in './hermes.log')

1741025466.680383: hermes.cli: DEBUG | Original exception was: [WinError 32] The process cannot access the file because it is being used by another process: '.hermes\audit.log'

  • No projects containing this file are open and all audit.log files are cleaned up.
  • The command functions correctly up until commit 398fc8f29b6d5ca29f72a75f240d10531a7676da on cli.py.
  • This issue occurs when installing dependencies via venv and running the clean command inside a virtual environment.
  • However, it works correctly when cloning hermes and using Poetry for dependency management.

Aidajafarbigloo avatar Mar 05 '25 17:03 Aidajafarbigloo

I haven't looked into it too much but it feels like a similar situation to https://github.com/softwarepub/hermes/issues/225. For me it works. Maybe someone on Windows can check, too.

zyzzyxdonta avatar Mar 06 '25 07:03 zyzzyxdonta

The error is: The process cannot access the file because it is being used by another process: '.hermes\\audit.log'. This happened because the log file was still open when trying to delete the .hermes folder using shutil.rmtree(). I used logging.shutdown() in the hermes\commands\clean\base.py before the deletion, and the clean command works.

Aidajafarbigloo avatar Apr 25 '25 13:04 Aidajafarbigloo