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

TypeError /v2.auslib_web_admin_views_releases_v2_update_release #2868

Open
bhearsum opened this issue Apr 3, 2023 · 7 comments
Open

TypeError /v2.auslib_web_admin_views_releases_v2_update_release #2868

bhearsum opened this issue Apr 3, 2023 · 7 comments

Comments

@bhearsum
Copy link
Contributor

bhearsum commented Apr 3, 2023

This showed up in Sentry on March 27th. There were 179 instances of it that day, and none since. The traceback is:

TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
  File "flask/app.py", line 1820, in full_dispatch_request
    rv = self.dispatch_request()
  File "flask/app.py", line 1796, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "connexion/decorators/decorator.py", line 68, in wrapper
    response = function(request)
  File "connexion/decorators/uri_parsing.py", line 149, in wrapper
    response = function(request)
  File "connexion/decorators/validation.py", line 196, in wrapper
    response = function(request)
  File "connexion/decorators/validation.py", line 399, in wrapper
    return function(request)
  File "connexion/decorators/response.py", line 112, in wrapper
    response = function(request)
  File "connexion/decorators/parameter.py", line 120, in wrapper
    return function(**kwargs)
  File "auslib/web/admin/views/releases_v2.py", line 39, in update_release
    new_data_versions = releases.update_release(name, body["blob"], body["old_data_versions"], body.get("when"), request.username, request.transaction)
  File "auslib/services/releases.py", line 521, in update_release
    set_by_path(new_data_versions, path, old_data_version + 1)

Obviously not a huge issue, but there's clearly at least one case here where old_data_version may not be initialized (possibly a race condition?).

@sentry-io
Copy link

sentry-io bot commented May 30, 2023

Sentry issue: BALROG-STAGE-ADMIN-1Q

@sentry-io
Copy link

sentry-io bot commented Sep 25, 2023

Sentry issue: BALROG-STAGE-ADMIN-1V

@bhearsum
Copy link
Contributor Author

bhearsum commented Sep 25, 2023

We've had another spike of this in the past week, again only on stage.

@jcristau
Copy link
Contributor

jcristau commented Oct 2, 2023

@bhearsum
Copy link
Contributor Author

I ran two staging releases today. The first was 122.0b2, which worked fine. The second had all of its per locale Balrog submission tasks fail with this. Perhaps a coincidence, but I wonder if there's some causation here?

@bhearsum
Copy link
Contributor Author

OK, I know what's happening here! For the most recent spate of them today, with 122.0b3, we actually had two 122.0b3's triggered on Try. One was done by me, through Ship It, the other by @jcristau, directly through Treeherder. This is a bit weird, but ultimately shouldn't necessarily fail (although it would never happen in production...).

The reason this ends up becoming an issue is because balrogscript sets old_data_versions as empty for every locale submission. I have a vague memory that this was done beacuse the API requires it always to be set -- but obviously this is very wrong if the locale already exists in the release. This data ends up in old_data_versions in releases.py, which is how we end up with old_data_version set to None.

There's a few actions we ought to take here, although I don't think anything in urgent now that we know what's going on:

  • Ensure balrogscript passes old_data_versions when appropriate.
  • Ensure Balrog's admin API allows old_data_versions to be empty (this probably means we need some post-swagger verification that they're only empty when appropriate).
  • Add a safeguard in releases.py that fails with a more appropriate and useful error if old_data_version is None when it needs to be an int.

@bhearsum
Copy link
Contributor Author

I filed mozilla-releng/scriptworker-scripts#885 for the balrogscript issue.

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