Page MenuHomePhabricator

RESTBase deployment fails with unhandled error when there are empty checks defined
Closed, ResolvedPublic

Description

eevans@deployment-deploy04:/srv/deployment/restbase/deploy$ scap deploy --environment beta "Initial deployment (new host)"
21:08:09 Started deploy [restbase/deploy@b504108] (beta)
21:08:09 Deploying Rev: HEAD = b504108ebe6dc130da330c8b4411bd6f61cb6bf3
21:08:09 Started deploy [restbase/deploy@b504108] (beta): Initial deployment (new host)
21:08:09
== DEFAULT ==
:* deployment-restbase05.deployment-prep.eqiad1.wikimedia.cloud
21:08:11 ['/usr/bin/scap', 'deploy-local', '-v', '--repo', 'restbase/deploy', '-g', 'default', 'fetch', '--refresh-config'] (ran as deploy-service@deployment-restbase05.deployment-prep.eqiad1.wikimedia.cloud) returned [70]: Registering scripts in directory '/srv/deployment/restbase/deploy-cache/revs/b504108ebe6dc130da330c8b4411bd6f61cb6bf3/scap/scripts'
Unhandled error:
deploy-local failed: <AttributeError> {}

21:08:11 restbase/deploy: fetch stage(s): 100% (in-flight: 0; ok: 0; fail: 1; left: 0) |
21:08:11 1 targets had deploy errors
21:08:11 1 targets failed
21:08:11 1 of 1 default targets failed, exceeding limit

The full error report is:

17:12:10 [www] Unhandled error:
Traceback (most recent call last):
  File "/workspace/scap/scap/cli.py", line 580, in run
    exit_status = app.main(app.extra_arguments)
  File "/workspace/scap/scap/deploy.py", line 171, in main
    status = self._execute_checks("before", stage, group)
  File "/workspace/scap/scap/utils.py", line 328, in context_wrapper
    return func(*args, **kwargs)
  File "/workspace/scap/scap/deploy.py", line 539, in _execute_checks
    target_stage = getattr(chk, when)
AttributeError: 'OverrideCheck' object has no attribute 'before'

Event Timeline

dancy triaged this task as High priority.Aug 20 2024, 5:13 PM
dancy renamed this task from RESTBase deployment fails with unhandled error to RESTBase deployment fails with unhandled error when there are empty checks defined.Aug 20 2024, 7:29 PM

dancy opened https://gitlab.wikimedia.org/repos/releng/scap/-/merge_requests/409

test_deploy.py: Add check for proper handling of check overrides

dancy merged https://gitlab.wikimedia.org/repos/releng/scap/-/merge_requests/409

test_deploy.py: Add check for proper handling of check overrides

The fix for the blank check problem has been merged and deployed to the production deploy server but I ran into trouble installing scap in deployment-prep. I enlisted @jnuche for help.

I worked around the scap installation problem in beta.

@Eevans Please try your deployment again!

Fixed in scap 4.99.0.