Skip to content

Email Delivery - Missing PDF Document_Incorporation #24321

Closed

Description

@ArwenQin

File an Incorporation, occasionally, the Certificate of Incorporation is not attached, though the email says it's attached.
This bug is rare, out of 10 tests, it was missing twice.

Happened for a ltd:
image.png

Happened for a CCC:
image.png

https://test.business.bcregistry.gov.bc.ca/BC1147574/

Activity

  1. added
    Entities Team
    on Nov 8, 2024
  2. added
    bug
    on Nov 8, 2024
  3. added
    Entities - Data Migration
    and removed
    Entities Team
    on Nov 8, 2024
  4. self-assigned this
    on Nov 8, 2024
  5. AimeeGao commented on Nov 14, 2024

    @AimeeGao

    Investigation Notes:

    Issue Description:

    During the testing, we found an intermittent issue where PDF attachments were missing from incorporation emails. The issue occurs approximately 2 out of 10 times when incorporated business filings.

    Investigation Process:

    After investigating the logs, we found that these missing attachments are caused by 503 errors from the Report API service.
    image.png

    image.png

    After reaching out to Andriy, we confirmed several important points:

    1. The Report-API service in dev/test environments was running with 512 MiB memory allocation, which caused the 503 error as the REPORT API container did not have enough memory allocated. A typical incorporation certificate PDF is around 644KB.

    image.png

    2. The production environment has 8GB memory allocation, so this issue may not happen in the production environment.
    1. The REPORT API moved to GCP a few months ago, and the URL for dev is: https://report-api-dev-366678529892.northamerica-northeast1.run.app. While the old service in OpenShift is still running, the SRE team recommends that we transition to using the new GCP endpoint.

    Troubleshooting Process:

    After Andriy bumped up the memory from 500 MB to 2 GB in both dev and test environments, I ran about 30 test requests on the report API endpoint. During this testing, no 503 errors were encountered.
    It seems the memory increase has resolved the issue.
    image.png

    Next Steps:

    1. Configuration Updates:
      We need to confirm if we should update the 1password secrets in DEV and TEST to use the new GCP REPORT API URL.

    2. The intermittent missing attachments issue could be due to limited resources allocated to DEV and TEST. Should we solve it by increasing the memory or should we maintain the current configuration (512 MiB) in TEST/DEV to keep costs down? As more memory means more costs, maybe we should focus on the PROD env.

    3. Since PROD already has 8 GB, it might not be affected, but we can't be 100% sure. Perhaps we should monitor it and create a post-launch monitoring ticket to see if we encounter this issue in production.

    @leodube-aot @vysakh-menon-aot @severinbeauvais
    What do you all think about these findings? We'd appreciate hearing your thoughts and suggestions on how we should address these issues.

  6. eason-pan-bc commented on Nov 14, 2024

    @eason-pan-bc

    This is the same root cause of intermittently missing PDFs for voluntary dissolution documents (rare, but happened) #24318

    And I also have 2 questions regarding the next steps:

    1. Do we wanna update the Secrets in DEV and/or TEST for REPORT API URL, to use GCP instead of OpenShift? (maybe a good idea?)
    2. Do we wanna increase the memory allocated to DEV/TEST (maybe not a good idea?), or just keep this in mind, and closely monitor issues after launch?

    Same here, would like to know your thoughts 😃

  7. vysakh-menon-aot commented on Nov 14, 2024

    @vysakh-menon-aot
    Contributor

    @AimeeGao Update to use report-api in GCP. While updating please make sure that there is no auth issues

    Update 1Password and Openshift Secret (since updating secret with 1password is disabled in openshift. ref: #23222)

  8. severinbeauvais commented on Nov 14, 2024

    @severinbeauvais
    Collaborator

    Fantastic investigation, Aimee! 👍

    Thanks for your response, Vysakh.

    • Do we need to let anyone know that we're using the GCP Report API? Patrick? Thor? Omid?
    • Can the OCP Report API be shut down or is anyone still using it?
  9. AimeeGao commented on Nov 14, 2024

    @AimeeGao

    Thanks, Vysakh and Sev! Good points.
    For the first question, do you think it would be helpful if we post a message in the channel to let everyone know that we're planning to switch to the GCP Report API?
    As for the second question, maybe I can check with Andriy since Patrick is on vacation. Does that sound good?

  10. severinbeauvais commented on Nov 14, 2024

    @severinbeauvais
    Collaborator

    For the first question, I think specific people have to be notified directly. Do you know who owns Report API?

    For the second question, yes, sure.

  11. AimeeGao commented on Nov 14, 2024

    @AimeeGao

    For the first question, I think specific people have to be notified directly. Do you know who owns Report API?

    For the second question, yes, sure.

    I’m not entirely sure who the owner of the Report API is. However, I know that the code comes from this repo: https://github.com/bcgov/bcros-common/tree/main/report-api. Maybe we could check with someone familiar with this repository to confirm ownership?

  12. 2 remaining items

  13. AimeeGao commented on Nov 14, 2024

    @AimeeGao

    For the first question, I think specific people have to be notified directly. Do you know who owns Report API?

    For the second question, yes, sure.

    I got some feedback from Andriy regarding the OCP Report API. He mentioned that there is still traffic going through it. shutting it down earlier would have an impact.

  14. severinbeauvais commented on Nov 14, 2024

    @severinbeauvais
    Collaborator

    OK, let's leave this with Andriy for now. And please tag @pwei1018 as needed.

    Also, let's update the keys so that Dev and Test use the GCP instance of Report API.

    Everything else is above my pay grade, so cc: @davemck513 @OlgaPotiagalova

  15. seeker25 commented on Nov 15, 2024

    @seeker25
    Contributor

    @severinbeauvais shouldn't be an issue raising the resources. I was talking to Patrick about this before he left.. we pay way more for SQL and storage than Cloudrun services at least for auth.

  16. severinbeauvais commented on Nov 15, 2024

    @severinbeauvais
    Collaborator

    Thanks, Travis.

    But, soon, we'll want to use Report API in GCP. Is it stable? Should we just change the 1Pass keys? Or should we first try to see who would be affect by changing the keys and then ensure they're ready for the change?

  17. seeker25 commented on Nov 15, 2024

    @seeker25
    Contributor

    I think it is fairly stable, we're using it for receipt generation. Probably not hard to switch back if necessary? Patrick is back off vacation on the 18th/19th? Could always just wait for then?

  18. severinbeauvais commented on Nov 15, 2024

    @severinbeauvais
    Collaborator

    Thanks again, Travis. Yes, just a couple of keys to change + redeploy.

    @AimeeGao , it sounds like it would be OK to change it for Dev and Test right now and then park this ticket (or create a duplicate) for changing Prod later.

  19. AimeeGao commented on Nov 15, 2024

    @AimeeGao

    Thanks again, Travis. Yes, just a couple of keys to change + redeploy.

    @AimeeGao , it sounds like it would be OK to change it for Dev and Test right now and then park this ticket (or create a duplicate) for changing Prod later.

    Thanks, Sev and Travis.
    I also got feedback from Dave (@davemck513 ), which aligns well with your suggestions.

    So, we'll proceed as follows:

    1. Change the Report API OCP Secret for the legal api in Dev and Test first.
    2. Change the 1pass. Sev, could you help me update the 1Password config, as we discussed this morning?
    3. If everything goes smoothly, we'll create a new ticket for the prod change.
  20. severinbeauvais commented on Nov 15, 2024

    @severinbeauvais
    Collaborator
    1. Change the 1pass. Sev, could you help me update the 1Password config, as we discussed this morning?

    It's changed for Dev only. Is there any way you can test this before I change Test?

    image

    PS - What's the new URL for Test?

  21. AimeeGao commented on Nov 15, 2024

    @AimeeGao

    Thanks for the update. I've also updated the OCP Secret in Dev.
    I'm currently testing the changes by calling the API to verify if there are any issues with the Dev changes.

    As for the Test URL, I'm still in the process of confirming it.
    I'll update you as soon as I have that information.

  22. AimeeGao commented on Nov 16, 2024

    @AimeeGao

    QA Notes:

    We’ve confirmed that the latest GCP configuration is in place for both Dev and Test environments, and no other changes were needed.
    After scaling up resources, I ran tests in both environments:

    1. 20 requests in TEST, 10 requests in DEV.
    2. Checked the logs and verified the email attachments in MailHog(DEV) and Email(TEST).

    Everything looks good, no 503 errors came up during testing, and everything seems to be running smoothly.

  23. severinbeauvais commented on Nov 18, 2024

    @severinbeauvais
    Collaborator

    Does anything need to be done for Prod right now?

    Does anything need to be done for Prod later? (When?)

  24. AimeeGao commented on Nov 19, 2024

    @AimeeGao

    Thanks, Sev for pointing this out 👍

    Our current Prod configuration is still using the old OCP setup. Here's what we’ll need to do:

    1. Update Legal API's Prod OCP Secret.
    2. Check if the 1Password configuration for Prod is up-to-date. If not, we’ll need to update it to use the new GCP setup.

    It might be a good idea to make these changes after we've confirmed everything is working smoothly in Dev/Test, and then monitor the performance in Prod for a while.

    I’ve created a ticket to track these updates. As for the timing, @vysakh-menon-aot, when you have a moment, could you help confirm the timing for when we should do the Prod changes? Thanks.

  25. vishnup0422 commented on Nov 19, 2024

    @vishnup0422
    Collaborator

    Test env:

    Created a new BEN business with Filing ID: 395939
    BEN: BC1152926

    Ran 20 requests against GET certificate endpoint

    image.png

    Made 30 requests against Incorporation Application endpoint.

    image.png

    Made 30 requests to fetch Receipt.

    image.png

    Notice of Articles

    image.png

    Dev Env

    Business: BC0883763
    FilingId: 152549

    Made 30 requests against Incorporation Application endpoint.

    image.png

    Certificate

    image.png

    Receipt:

    image.png

    Notice of Articles

    image.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities - Data MigrationPriority2bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions