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

Bug 1854857: initial create errors should map to SamplesExists instead of ImageChangesInProgress #303

Merged

Conversation

gabemontero
Copy link
Contributor

So we finally got an intermittent situation when the api server was momentarily unavailable during an upgrade when samples operator tried to upsert new samples.

In setting the error condition, the code (since 4.1 I believe) set the error on the ImageChangesInProgress condition.

However, that results in text in the reason field which would not get cleared as we start tracking import completion in the ImageChangesInProgress reason field. As it never gets cleared, we never set Progressing to false.

The pattern in samples operator is to set these errors in SamplesExists, as that reflects whether samples are fully created/up to date.

This PR hence fixes this single inconsistency. I went back and confirmed this was the only place this situation was occurring.
Also added some additional unit tests to distinguish between api server get errors and upsert errors.

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Jul 9, 2020
@openshift-ci-robot
Copy link
Contributor

@gabemontero: This pull request references Bugzilla bug 1854857, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1854857: initial create errors should map to SamplesExists instead of ImageChangesInProgress

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jul 9, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabemontero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 9, 2020
@gabemontero
Copy link
Contributor Author

terraform/aws flake on e2e-aws

/test e2e-aws

@gabemontero
Copy link
Contributor Author

Hmmm .... the django-psql-example template BC seems to have developed a bug:

2020-07-09T15:09:25.641872927Z STEP 10: FROM 02991b792848b60061edee8eefa6b6019a17f2f6af4f488eec90816a3bbba15f
2020-07-09T15:09:25.668846136Z STEP 11: RUN /bin/sh -ic './manage.py test'
2020-07-09T15:09:26.469313414Z sh: no job control in this shell
2020-07-09T15:09:27.106452803Z Traceback (most recent call last):
2020-07-09T15:09:27.106452803Z   File "./manage.py", line 21, in <module>
2020-07-09T15:09:27.106452803Z     main()
2020-07-09T15:09:27.106452803Z   File "./manage.py", line 17, in main
2020-07-09T15:09:27.106452803Z     execute_from_command_line(sys.argv)
2020-07-09T15:09:27.106452803Z   File "/opt/app-root/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
2020-07-09T15:09:27.106452803Z     utility.execute()
2020-07-09T15:09:27.106452803Z   File "/opt/app-root/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
2020-07-09T15:09:27.106452803Z     django.setup()
2020-07-09T15:09:27.106452803Z   File "/opt/app-root/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
2020-07-09T15:09:27.106452803Z     apps.populate(settings.INSTALLED_APPS)
2020-07-09T15:09:27.106452803Z   File "/opt/app-root/lib/python3.6/site-packages/django/apps/registry.py", line 114, in populate
2020-07-09T15:09:27.106572714Z     app_config.import_models()
2020-07-09T15:09:27.106572714Z   File "/opt/app-root/lib/python3.6/site-packages/django/apps/config.py", line 211, in import_models
2020-07-09T15:09:27.10666306Z     self.models_module = import_module(models_module_name)
2020-07-09T15:09:27.10666306Z   File "/opt/app-root/lib64/python3.6/importlib/__init__.py", line 126, in import_module
2020-07-09T15:09:27.106792528Z     return _bootstrap._gcd_import(name[level:], package, level)
2020-07-09T15:09:27.106792528Z   File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2020-07-09T15:09:27.106957145Z   File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-07-09T15:09:27.10704337Z   File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2020-07-09T15:09:27.107122884Z   File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-07-09T15:09:27.10718999Z   File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-07-09T15:09:27.107289566Z   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-07-09T15:09:27.107361777Z   File "/opt/app-root/lib/python3.6/site-packages/django/contrib/auth/models.py", line 2, in <module>
2020-07-09T15:09:27.107462294Z     from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
2020-07-09T15:09:27.107462294Z   File "/opt/app-root/lib/python3.6/site-packages/django/contrib/auth/base_user.py", line 47, in <module>
2020-07-09T15:09:27.10755862Z     class AbstractBaseUser(models.Model):
2020-07-09T15:09:27.10755862Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/models/base.py", line 117, in __new__
2020-07-09T15:09:27.107668009Z     new_class.add_to_class('_meta', Options(meta, app_label))
2020-07-09T15:09:27.107668009Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/models/base.py", line 321, in add_to_class
2020-07-09T15:09:27.107842991Z     value.contribute_to_class(cls, name)
2020-07-09T15:09:27.107842991Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/models/options.py", line 204, in contribute_to_class
2020-07-09T15:09:27.108010076Z     self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
2020-07-09T15:09:27.108010076Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/__init__.py", line 28, in __getattr__
2020-07-09T15:09:27.108097414Z     return getattr(connections[DEFAULT_DB_ALIAS], item)
2020-07-09T15:09:27.108097414Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/utils.py", line 201, in __getitem__
2020-07-09T15:09:27.108209557Z     backend = load_backend(db['ENGINE'])
2020-07-09T15:09:27.108209557Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/utils.py", line 110, in load_backend
2020-07-09T15:09:27.108311137Z     return import_module('%s.base' % backend_name)
2020-07-09T15:09:27.108311137Z   File "/opt/app-root/lib64/python3.6/importlib/__init__.py", line 126, in import_module
2020-07-09T15:09:27.108412573Z     return _bootstrap._gcd_import(name[level:], package, level)
2020-07-09T15:09:27.108412573Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 66, in <module>
2020-07-09T15:09:27.1085243Z     check_sqlite_version()
2020-07-09T15:09:27.1085243Z   File "/opt/app-root/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 63, in check_sqlite_version
2020-07-09T15:09:27.108611265Z     raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
2020-07-09T15:09:27.108611265Z django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
2020-07-09T15:09:27.153796021Z subprocess exited with status 1
2020-07-09T15:09:27.163655701Z subprocess exited with status 1
2020-07-09T15:09:27.860619828Z error: build error: error building at STEP "RUN /bin/sh -ic './manage.py test'": exit status 1

may get to temporarily disable that test and open a SCL bz/jira

@gabemontero
Copy link
Contributor Author

/test e2e-aws
/test e2e-aws-upgrade

@gabemontero
Copy link
Contributor Author

https://projects.engineering.redhat.com/browse/RHELPLAN-48796 has been opened for the new django template issue
Revert PR sclorg/django-ex#154 is a possible workaround, though we'll give the upstream devs some time to sort it out.

@gabemontero gabemontero added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2020
@gabemontero
Copy link
Contributor Author

/override ci/prow/e2e-aws-image-ecosystem

@openshift-ci-robot
Copy link
Contributor

@gabemontero: Overrode contexts on behalf of gabemontero: ci/prow/e2e-aws-image-ecosystem

In response to this:

/override ci/prow/e2e-aws-image-ecosystem

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit 09de303 into openshift:master Jul 9, 2020
@openshift-ci-robot
Copy link
Contributor

@gabemontero: All pull requests linked via external trackers have merged: openshift/cluster-samples-operator#303. Bugzilla bug 1854857 has been moved to the MODIFIED state.

In response to this:

Bug 1854857: initial create errors should map to SamplesExists instead of ImageChangesInProgress

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@gabemontero gabemontero deleted the api-svr-err-not-cleared branch July 10, 2020 13:20
@gabemontero
Copy link
Contributor Author

/cherrypick release-4.5

@openshift-cherrypick-robot

@gabemontero: new pull request created: #304

In response to this:

/cherrypick release-4.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants