Skip to content

Updates SI to render /lookup even if reply files are missing from storage #5497

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

Merged
merged 1 commit into from
Sep 16, 2020

Conversation

zenmonkeykstop
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop commented Sep 15, 2020

Status

Ready for review / Work in progress

Description of Changes

Fixes #5402

Adds exception handling to cover the case when a source has replies in the db
whose corresponding files are missing from disk. Previously the /lookup path
would fail, preventing the source from viewing replies or uploading submissions.

Testing

dev environment:

  • check out this branch and run make dev
  • note the codename and journalist designation in the docker output for one of the sources created with 2 reply files in the docker output
  • run docker ps in a separate terminal to determine the ID for the dev container
  • run docker exec -it <dockerID> bash to connect to the dev container
  • find and delete one of the reply files for the source identified above, under /var/lib/securedrop/store.
  • open the source interface at localhost:8080 and log in with the source codename:
    • The login is successful and the /lookup page is displayed
    • One reply is displayed
    • An error message like [2020-09-15 17:49:31,400] ERROR in main: Reply file missing: 3-blameless_fumble-reply.gpg is printed in the docker output.

staging environment:

  • check out this branch and run make staging
  • log in to the source interface and submit a message, note the codename, then log out.
  • log into the journalist interface and reply to a message
  • log back into the SI and verify that the reply is visible, then logout
  • log into the app staging serve, andr find and delete the reply file for the source, under /var/lib/securedrop/store.
  • log into the source interface with the source codename:
    • The login is successful and the /lookup page is displayed
    • No replies are displayed.
    • An error message like Reply file missing: 3-blameless_fumble-reply.gpg is printed in the source error log on the app server.

Deployment

No special deployment requirements.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

…from storage

Added exception handling to cover the case when a source has replies in the db
whose corresponding files are missing from disk. Previously the /lookup endpoint
would fail, preventing the source from viewing replies or uploading submissions.
@zenmonkeykstop zenmonkeykstop added this to the 1.6.0 milestone Sep 15, 2020
@kushaldas kushaldas self-assigned this Sep 16, 2020
Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing

dev environment:

  • check out this branch and run make dev
  • note the codename and journalist designation in the docker output for one of the sources created with 2 reply files in the docker output
  • run docker ps in a separate terminal to determine the ID for the dev container
  • run docker exec -it <dockerID> bash to connect to the dev container
  • find and delete one of the reply files for the source identified above, under /var/lib/securedrop/store.
  • open the source interface at localhost:8080 and log in with the source codename:
    • The login is successful and the /lookup page is displayed
    • One reply is displayed
    • An error message like [2020-09-15 17:49:31,400] ERROR in main: Reply file missing: 3-blameless_fumble-reply.gpg is printed in the docker output.

staging environment:

  • check out this branch and run make staging
  • log in to the source interface and submit a message, note the codename, then log out.
  • log into the journalist interface and reply to a message
  • log back into the SI and verify that the reply is visible, then logout
  • log into the app staging serve, andr find and delete the reply file for the source, under /var/lib/securedrop/store.
  • log into the source interface with the source codename:
    • The login is successful and the /lookup page is displayed
    • No replies are displayed.
    • An error message like Reply file missing: 3-blameless_fumble-reply.gpg is printed in the source error log on the app server.

This is good, approved. 🦄

@kushaldas kushaldas merged commit 4e07763 into develop Sep 16, 2020
@kushaldas kushaldas deleted the 5402-source-missing-reply-files branch September 16, 2020 12:17
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

Successfully merging this pull request may close these issues.

Source cannot log in with codename if reply files are missing
2 participants