GSA / notifications-admin

The UI of Notify.gov
https://notify.gov
Other
11 stars 2 forks source link

add debug for investigating stack trace in logs #1606

Open terrazoon opened 3 weeks ago

terrazoon commented 3 weeks ago

Description

There is a stack trace happening, mostly down in the middleware, where an 'invalid IPv6 url' occurs, gets converted to a 500 error, but at the same time causes an exception down in werkzeug when it tries to log, because the RequestContext apparently doesn't have a 'service' attribute.

Wrap our method where the exception seems to occur in a try/except. This may be sufficient and all we can do for this issue (get the stack trace out of the log), but add some debug statements so we can have a better idea of what is actually going on. Like ... what is the original url we are trying to convert? Is it a IPv6 url? Who is using that and why, etc?

Security Considerations

N/A

ccostino commented 3 weeks ago

Thanks, @terrazoon! This just needs a quick update against main whenever you have a moment.

github-actions[bot] commented 2 weeks ago

Terraform Format and Style: success Terraform Initialization: success Terraform Validation: success Terraform Plan: success

Show Plan ``` module.api_network_route.data.cloudfoundry_space.space: Reading... module.redis.data.cloudfoundry_space.space: Reading... module.redis.data.cloudfoundry_service.redis: Reading... module.logo_upload_bucket.data.cloudfoundry_service.s3: Reading... module.logo_upload_bucket.data.cloudfoundry_space.space: Reading... module.logo_upload_bucket.data.cloudfoundry_service.s3: Read complete after 0s [id=440ce9d9-b108-4bbe-80b4-08338f3cc25b] module.redis.data.cloudfoundry_service.redis: Read complete after 0s [id=045871d3-d9a8-4a9b-a844-00a067fab054] module.redis.data.cloudfoundry_space.space: Read complete after 1s [id=9745decb-4988-4bab-88a4-e3f07b36241c] module.redis.cloudfoundry_service_instance.redis: Refreshing state... [id=a6e88a48-bae7-4cf4-84d5-3a86463e8814] module.api_network_route.data.cloudfoundry_space.space: Read complete after 1s [id=9745decb-4988-4bab-88a4-e3f07b36241c] module.api_network_route.data.cloudfoundry_app.destination_app: Reading... module.api_network_route.data.cloudfoundry_app.source_app: Reading... module.logo_upload_bucket.data.cloudfoundry_space.space: Read complete after 1s [id=9745decb-4988-4bab-88a4-e3f07b36241c] module.logo_upload_bucket.cloudfoundry_service_instance.bucket: Refreshing state... [id=d67c8c05-f22b-4fca-ba0b-312af08a61eb] module.api_network_route.data.cloudfoundry_app.source_app: Read complete after 0s [id=5d983d08-5079-4159-8721-67edf948d345] module.api_network_route.data.cloudfoundry_app.destination_app: Read complete after 1s [id=89c9b6a9-f030-4752-b30f-6b3193a25148] module.api_network_route.cloudfoundry_network_policy.internal_route: Refreshing state... [id=45c461a7-cc6c-c60d-cea7-1f5480589b64] No changes. Your infrastructure matches the configuration. Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed. Warning: Argument is deprecated with module.logo_upload_bucket.cloudfoundry_service_instance.bucket, on .terraform/modules/logo_upload_bucket/s3/main.tf line 14, in resource "cloudfoundry_service_instance" "bucket": 14: recursive_delete = var.recursive_delete Since CF API v3, recursive delete is always done on the cloudcontroller side. This will be removed in future releases (and one more similar warning elsewhere) ```

Pusher: @terrazoon, Action: pull_request

ccostino commented 2 days ago

@terrazoon this just needs a quick sync with main; thanks!