bug: false positive duplicate key in configuration #2555
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Compliance
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity#2555
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What is the bug?
continuwuity from nixpkgs gives a false positive duplicate key on a correct config
if this is an issue with nixpkgs specifically do send me over there
Steps to reproduce
nix config:
(full module here:
git.poz.pet/poz/niksos@069689bf38/hosts/szparag/services/continuwuity.nix)this results in the following config file, path in the nix store taken from
systemctl show continuwuity.serviceinEnvironment, should be the first variablewhen trying to start the systemd service, it fails with the following in
journalctl -u continuwuity.servicethis was tested with
allow_announcements_check = true;in the nix configuration - it has no effect and this error still occurs (toml config file has no changes either)Server name and version
poz.pet 26.9.4
Additional context
using the module and package from nixpkgs
04906337b6d53e8bb0eaf0470ae9f070a4d4eb55, continuwuity26.9.4IDK how to resolve it on your end, but only allow_announcements_check is valid. The other is the old version, and if we alias'd it for compatibility reasons you would indeed technically be declaring the same setting twice.
https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/conduwuit-example.toml#L135-L140
@Aranjedeath wrote in #2555 (comment):
wdym by "the other"? it is setting
allow_announcements_checkhereI think this might be a nixpkgs-side problem.
Per the authoritative source of the config file (as noted here), one setting name is an alias for the other:
/// If enabled, continuwuity will send a simple GET request periodically to/// `https://continuwuity.org/.well-known/continuwuity/announcements` for any new/// announcements or major updates. This is not an update check endpoint.////// default: true#[serde(alias = "allow_check_for_updates", default = "true_fn")]pub allow_announcements_check: bool,So, if the process generating the config file is asserting two different names for ultimately the same configuration choice (with different values to boot), that seems like a problem with that process, i.e. with whatever nixpkgs/Nix is doing under the hood.
From a git blame review, the alias seems to have existed since at least
2d9bdc0979.D'oh, curse Forgejo not rendering comments made before mine while I'm still writing them.
Long story short, yes, @Aranjedeath, one of the names is in fact an alias for the other.
@poz wrote in #2555 (comment):
Your second text block contains:
which are the exact same setting. Only the first one is valid. the other is deprecated, and may still exist as an alias for compatibility reasons. Delete it.
oh my god ok no this is neither an issue with nixpkgs nor this project, it's an issue with my brain
I just realized what @Aranjedeath meant is that
allow_check_for_updatesis the old one, it does now work properlythank you so much for your patience!!!!
(also not sure how hard it would be but maybe proper errors/warnings for deprecated options?)
@poz wrote in #2555 (comment):
Yeah no worries. I think we just haven't marked that one as deprecated. We do have a thing for that.
@poz wrote in #2555 (comment):
Semantics quibble as this may be, Continuwuity does have warnings for deprecated options,
allow_check_for_updatesjust isn't one of them:const DEPRECATED_KEYS: &[&str] = &["cache_capacity","conduit_cache_capacity_modifier","max_concurrent_requests","otlp_protocol","roomid_spacehierarchy_cache_capacity","well_known_client","well_known_server","well_known_support_page","well_known_support_role","well_known_support_email","well_known_support_mxid","well_known.rtc_focus_server_urls","allow_sticky_events","allow_moderators_to_view_redacted_content","unredacted_content_max_age_secs",];@Aranjedeath if
allow_check_for_updatesis in fact deprecated, please let me know; I'll gladly file the PR to treat it as such.