-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix webapp errors caused by mismatching setup and expected Flask definitions #10
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
matprov
approved these changes
Feb 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
fmigneault
added a commit
to bird-house/birdhouse-deploy
that referenced
this pull request
Apr 20, 2023
## Overview Please include a summary of the changes and which issues are fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. ## Breaking changes - CanarieAPI: update to `0.7.1`. - The Docker running `CanarieAPI` is now using Python 3 (since `0.4.x` tags). Configurations need to be updated if any specific Python 2 definitions were used. See [2to3](https://docs.python.org/3/library/2to3.html) to help migrate configurations automatically if necessary. - Update the [CanarieAPI configuration](birdhouse/config/canarie-api/docker_configuration.py.template) to use Python 3.x executable code. ## Changes - CanarieAPI: update to `0.7.1`. - The server node now provides a generic ``server`` configuration for the current ``platform`` definition. - Added multiple missing docuementation references for all the services included within `CanarieAPI` configurations. - With new `CanarieAPI` version, a slightly improved UI with more service details are provided for the active server: ![image](https://user-images.githubusercontent.com/19194484/232822454-e39c0111-54dc-4f9b-adf6-5ea6e59d67e3.png) - Add optional variables witht defaults to define reference Docker image version tags. Following optional variables are defined by default. These are used as reference in the respective Docker compose service definition of these components, as well as in their `CanarieAPI` configuration to retrieve the release time of the tag, and refer to relevant URL references as needed. - `CATALOG_VERSION` - `FINCH_VERSION` - `FLYINGPIGEON_VERSION` - `GEOSERVER_VERSION` - `HUMMINGBIRD_VERSION` - `MALLEEFOWL_VERSION` - `RAVEN_VERSION` ## Fixes: - CanarieAPI: update to `0.7.1`. - Fixes an `AttributeError` raised due to misconfiguration of the Web Application with Flask 2.x definitions (relates to [Ouranosinc/CanarieAPI#10](Ouranosinc/CanarieAPI#10)). - Skip over `0.4.x`, `0.5.x`, `0.6.x` versions to avoid issue related to `cron` job monitoring and log parser command failures in order to collect configured service statistics and statuses (see also [Ouranosinc/CanarieAPI#14](Ouranosinc/CanarieAPI#14)). - Weaver: update CanarieAPI monitoring definitions - Move monitoring of public endpoint under [optional-components/canarie-api-full-monitoring][canarie-monitor]. - Add monitoring of private endpoint by default when using Weaver component. - Cowbird: update CanarieAPI monitoring definitions - Add monitoring of public endpoint under [optional-components/canarie-api-full-monitoring][canarie-monitor]. - Add public Magpie permission on Cowbird entrypoint only to allow its monitoring. ## Additional Information Resolves the following log error. ``` proxy | [2023-01-31 19:37:01 +0000] [37] [DEBUG] GET /canarie/ proxy | [2023-01-31 19:37:01,708] [37] [INFO] app_object : Disconnecting from database proxy | [2023-01-31 19:37:01,709] [37] [DEBUG] app_object : Using db filename : /opt/local/src/CanarieAPI/stats.db proxy | [2023-01-31 19:37:01 +0000] [37] [DEBUG] Closing connection. proxy | [2023-01-31 19:37:02 +0000] [37] [DEBUG] GET /canarie/background.jpg proxy | [2023-01-31 19:37:02,176] [37] [INFO] app_object : Disconnecting from database proxy | [2023-01-31 19:37:02,176] [37] [DEBUG] app_object : Using db filename : /opt/local/src/CanarieAPI/stats.db proxy | [2023-01-31 19:37:02 +0000] [37] [ERROR] Error handling request /canarie/background.jpg proxy | Traceback (most recent call last): proxy | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 56, in handle proxy | self.handle_request(listener_name, req, client, addr) proxy | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 152, in handle_request proxy | super(GeventWorker, self).handle_request(*args) proxy | File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/async.py", line 107, in handle_request proxy | respiter = self.wsgi(environ, resp.start_response) proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1997, in __call__ proxy | return self.wsgi_app(environ, start_response) proxy | File "/opt/local/src/CanarieAPI/canarieapi/reverse_proxied.py", line 33, in __call__ proxy | return self.app(environ, start_response) proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app proxy | response = self.handle_exception(e) proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1532, in handle_exception proxy | handler = self._find_error_handler(InternalServerError()) proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1449, in _find_error_handler proxy | .get(code)) proxy | File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1440, in find_handler proxy | handler = handler_map.get(cls) proxy | AttributeError: 'function' object has no attribute 'get' ``` The above problem lead to unresponsive CanarieAPI, which in turn caused the platform to fail responding with successful monitoring statuses for requests toward the configured services, which in turn, caused the stack to never completely boot. When the stack failed to boot, the *End2End Test Results* (example: #283 (comment)) could not run due to the unresponsive instance, which is the cause of the incomplete output: ````` Tests URL : NOTEBOOK TEST RESULTS ```` </code> `` ````` # To Do (in follow-up PRs) - remove deprecated configs deleted in #287 - remove deprecated configs deleted in #291 - remove deprecated configs deleted in #292
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Flask
requirements and expected configurations to setup the web application.canarieapi/default_configuration.py
.Example Error Log