flyingcircusio / batou_ext

A library of batou extensions.
Other
4 stars 1 forks source link

Prediction for not existing checkout impossible #152

Open nichmoe opened 7 months ago

nichmoe commented 7 months ago

Bug: You are not able to test a new GitCheckout, without deploying it.

Reproduction: Add a new batou_ext.git.GitCheckout to the deployment and test it with the -P prediction option. The deployment prediction fails, because of a (correctly) missing folder.

Expectation: A prediction doesn't fail, because the component could not change the file system.

Traceback:

host > CRS > GitCheckout > Directory('work/crs/prepared-0bd51ff806c68e2a54c4d60ca13f731c5355696d') > SyncDirectory('prepared-0bd51ff806c68e2a54c4d60ca13f731c5355696d')
ERROR: rsync -rclnv --exclude '.git' /srv/user/deployment/work/crs/checkout/ /srv/user/deployment/work/crs/prepared-0bd51ff806c68e2a54c4d60ca13f731c5355696d
    Return code: 23
STDOUT
sending incremental file list

sent 19 bytes  received 12 bytes  62.00 bytes/sec
total size is 0  speedup is 0.00 (DRY RUN)

STDERR
rsync: [sender] change_dir "/srv/user/deployment/work/crs/checkout" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2.7]

ERROR: Unexpected exception
        Traceback (most recent call last):
        File "/Deployment/.appenv/2a69e431/lib/python3.11/site-packages/batou/deploy.py", line 371, in main
    getattr(deployment, step)()
        File "/Deployment/.appenv/2a69e431/lib/python3.11/site-packages/batou/deploy.py", line 317, in deploy
    self.loop.run_until_complete(asyncio.gather(*pending))
        File "/User/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
        File "/Deployment/.appenv/2a69e431/lib/python3.11/site-packages/batou/deploy.py", line 272, in _deploy_component
    await self.loop.run_in_executor(
        File "/User/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Deployment/.appenv/2a69e431/lib/python3.11/site-packages/batou/host.py", line 196, in deploy_component
    self.rpc.deploy(component, predict_only)
        File "/Deployment/.appenv/2a69e431/lib/python3.11/site-packages/batou/host.py", line 97, in call
    raise RuntimeError(
        RuntimeError: host.domain: Remote exception encountered.
======================================================================= DEPLOYMENT PREDICTION FAILED (during deploy) ========================================================================