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
GpgKeyNotFoundError
can block deletion of a Source
#6669
Comments
It seems like we should just catch and suppress the GpgKeyNotFoundError error since during deletion, that's what we want...? |
I will do this. |
@cfm I hope you don't mind a question - I'm having some difficulty making the Docker test environment reload my code when making changes. I've tried on both my own PC, and in a GitHub Codespace, and rebuilt it from scratch several times, and at no point can I get Docker to detect or reload my changes when making changes in I've tried looking in some likely places where this may be configured or enabled but I've found nothing. Any ideas? It's such a complex development environment that I'm not sure where to look. The last time I contributed, I recall it worked fine out of the box. |
Good catch, @anorthall! I can reproduce this too. It looks like #6563 reintroduced #5594. I'll file a pull request to fix this on Monday. In the meantime, try the following patch: --- a/securedrop/sdconfig.py
+++ b/securedrop/sdconfig.py
@@ -43,6 +43,8 @@ class SourceInterfaceConfig(_FlaskAppConfig):
@dataclass(frozen=True)
class SecureDropConfig:
+ env: str
+
JOURNALIST_APP_FLASK_CONFIG_CLS: JournalistInterfaceConfig
SOURCE_APP_FLASK_CONFIG_CLS: SourceInterfaceConfig
@@ -115,6 +117,8 @@ def _parse_config_from_file(config_module_name: str) -> SecureDropConfig:
config_from_local_file, "SCRYPT_PARAMS", dict(N=2**14, r=8, p=1)
)
+ env = getattr(config_from_local_file, "env", "prod")
+
try:
final_securedrop_root = Path(config_from_local_file.SECUREDROP_ROOT)
except AttributeError:
@@ -188,6 +192,7 @@ def _parse_config_from_file(config_module_name: str) -> SecureDropConfig:
)
return SecureDropConfig(
+ env=env,
JOURNALIST_APP_FLASK_CONFIG_CLS=parsed_journ_flask_config,
SOURCE_APP_FLASK_CONFIG_CLS=parsed_source_flask_config,
GPG_KEY_DIR=final_gpg_key_dir, |
Thanks for the quick response and patch @cfm - I'll give it a go. Glad it wasn't just me. |
Sorry, life has taken over a bit and I haven't had a chance to work on this. Just posting here to let any other contributors know that they are free to have a go - although it's still on my to-do list if nobody else does in a few months. |
Description
One of #6667's
Source
s withlast_updated = None
cannot be deleted, becauseDELETE /sources/<source_uuid>
returns HTTP500
on aGpgKeyNotFoundError
.Steps to Reproduce
See #6667 for context. In the SecureDrop Client, select source
politic paperweight
and select Delete Source Account.Expected Behavior
The source is deleted.
Actual Behavior
The source is not deleted, and the SecureDrop Client returns error:
sd-log
Server
Comments
Per #6667, because this source is not listed in the Journalist Interface, it cannot be deleted except directly at the SQLite shell.
The text was updated successfully, but these errors were encountered: