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

Better error message if batou is already running #446

Open
frlan opened this issue Mar 25, 2024 · 0 comments
Open

Better error message if batou is already running #446

frlan opened this issue Mar 25, 2024 · 0 comments
Milestone

Comments

@frlan
Copy link
Member

frlan commented Mar 25, 2024

I was running a deployment in shell 1 and wanted to start a second one in shell 2

./batou deploy -P production
batou/2.4.1 (cpython 3.11.8-final0, Darwin 23.4.0 arm64)
Could not acquire lock .batou-lock
Traceback (most recent call last):
  File "/Users/me/myprj/.appenv/a2ac3148/lib/python3.11/site-packages/batou/utils.py", line 71, in locked
    fcntl.lockf(lockfile, fcntl.LOCK_EX | fcntl.LOCK_NB)
BlockingIOError: [Errno 35] Resource temporarily unavailable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/me/myprj/./.appenv/a2ac3148/bin/batou", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/me/myprj/.appenv/a2ac3148/lib/python3.11/site-packages/batou/main.py", line 221, in main
    return args.func(**func_args)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/me/myprj/.appenv/a2ac3148/lib/python3.11/site-packages/batou/deploy.py", line 364, in main
    with locked(".batou-lock"):
  File "/Users/flanitz/.nix-profile/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/Users/me/myprj/.appenv/a2ac3148/lib/python3.11/site-packages/batou/utils.py", line 74, in locked
    raise RuntimeError(
RuntimeError: ('cannot create lock "<_io.TextIOWrapper name=\'.batou-lock\' mode=\'a+\' encoding=\'UTF-8\'>": more than one instance running concurrently?', <_io.TextIOWrapper name='.batou-lock' mode='a+' encoding='UTF-8'>)
@zagy zagy added this to the batou 2.6 milestone Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants