bug: false positive duplicate key in configuration #2555

Closed
opened 2026-11-19 21:55:51 +00:00 by poz · 8 comments

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:

service.matrix-continuwuity = {
    enable = true;

    settings.global = {
        address = [ "127.0.0.1" ];
        server_name = "poz.pet";
        database_backend = "rocksdb";
        port = [ 6167 ];
        enable_lightning_bolt = false;
        max_request_size = 104857600;
        allow_check_for_updates = false;
        allow_registration = false;
    };
};

(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.service in Environment, should be the first variable

[global]
address = ["127.0.0.1"]
allow_announcements_check = true
allow_check_for_updates = false
allow_encryption = true
allow_federation = true
allow_registration = false
database_backend = "rocksdb"
database_path = "/var/lib/continuwuity/"
enable_lightning_bolt = false
max_request_size = 104857600
port = [6167]
server_name = "poz.pet"
trusted_servers = ["matrix.org"]
unix_socket_perms = 660

when trying to start the systemd service, it fails with the following in journalctl -u continuwuity.service

Nov 19 22:38:50 szparag systemd[1]: Starting Continuwuity Matrix Server...
Nov 19 22:38:50 szparag conduwuit[1317585]: Error: There was a problem with your configuration file: duplicate field `allow_announcements_check`
Nov 19 22:38:50 szparag systemd[1]: continuwuity.service: Main process exited, code=exited, status=1/FAILURE
Nov 19 22:38:50 szparag systemd[1]: continuwuity.service: Failed with result 'exit-code'.
Nov 19 22:38:50 szparag systemd[1]: Failed to start Continuwuity Matrix Server.
Nov 19 22:39:00 szparag systemd[1]: continuwuity.service: Scheduled restart job immediately on client request, restart counter is at 1.

this 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, continuwuity 26.9.4

### 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: ```nix service.matrix-continuwuity = { enable = true; settings.global = { address = [ "127.0.0.1" ]; server_name = "poz.pet"; database_backend = "rocksdb"; port = [ 6167 ]; enable_lightning_bolt = false; max_request_size = 104857600; allow_check_for_updates = false; allow_registration = false; }; }; ``` (full module here: https://git.poz.pet/poz/niksos/src/commit/069689bf38c610a9ee3d4a01c7f8005b53a88d8c/hosts/szparag/services/continuwuity.nix) this results in the following config file, path in the nix store taken from `systemctl show continuwuity.service` in `Environment`, should be the first variable ```toml [global] address = ["127.0.0.1"] allow_announcements_check = true allow_check_for_updates = false allow_encryption = true allow_federation = true allow_registration = false database_backend = "rocksdb" database_path = "/var/lib/continuwuity/" enable_lightning_bolt = false max_request_size = 104857600 port = [6167] server_name = "poz.pet" trusted_servers = ["matrix.org"] unix_socket_perms = 660 ``` when trying to start the systemd service, it fails with the following in `journalctl -u continuwuity.service` ``` Nov 19 22:38:50 szparag systemd[1]: Starting Continuwuity Matrix Server... Nov 19 22:38:50 szparag conduwuit[1317585]: Error: There was a problem with your configuration file: duplicate field `allow_announcements_check` Nov 19 22:38:50 szparag systemd[1]: continuwuity.service: Main process exited, code=exited, status=1/FAILURE Nov 19 22:38:50 szparag systemd[1]: continuwuity.service: Failed with result 'exit-code'. Nov 19 22:38:50 szparag systemd[1]: Failed to start Continuwuity Matrix Server. Nov 19 22:39:00 szparag systemd[1]: continuwuity.service: Scheduled restart job immediately on client request, restart counter is at 1. ``` this 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`, continuwuity `26.9.4`
Owner

IDK 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

IDK 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
Author

@Aranjedeath wrote in #2555 (comment):

IDK 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.

wdym by "the other"? it is setting allow_announcements_check here

@Aranjedeath wrote in https://forgejo.ellis.link/continuwuation/continuwuity/issues/2555#issuecomment-40428: > IDK 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. wdym by "the other"? it is setting `allow_announcements_check` here
Member

I 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:

Lines 193 to 199 in bfb611d
/// 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.

I *think* this might be a nixpkgs-side problem. Per the authoritative source of the config file (as noted [here](https://forgejo.ellis.link/continuwuation/continuwuity/src/branch/main/conduwuit-example.toml#L8)), one setting name is an alias for the other: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/bfb611d9e4344412bbeb82dcf5dabec4c696a8cc/src/core/config/mod.rs#L193-L199 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.
Member

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.

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.
Owner

@poz wrote in #2555 (comment):

@Aranjedeath wrote in #2555 (comment):

IDK 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.

wdym by "the other"? it is setting allow_announcements_check here

Your second text block contains:

allow_announcements_check = true
allow_check_for_updates = false

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.

@poz wrote in https://forgejo.ellis.link/continuwuation/continuwuity/issues/2555#issuecomment-40429: > @Aranjedeath wrote in #2555 (comment): > > > IDK 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. > > wdym by "the other"? it is setting `allow_announcements_check` here Your second text block contains: ``` allow_announcements_check = true allow_check_for_updates = false ``` 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.
Author

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_updates is the old one, it does now work properly

thank you so much for your patience!!!!

(also not sure how hard it would be but maybe proper errors/warnings for deprecated options?)

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_updates` is the old one, it does now work properly thank you so much for your patience!!!! (also not sure how hard it would be but maybe proper errors/warnings for deprecated options?)
poz closed this issue 2026-11-19 23:42:25 +00:00
Owner

@poz wrote in #2555 (comment):

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_updates is the old one, it does now work properly

thank you so much for your patience!!!!

(also not sure how hard it would be but maybe proper errors/warnings for deprecated options?)

Yeah no worries. I think we just haven't marked that one as deprecated. We do have a thing for that.

@poz wrote in https://forgejo.ellis.link/continuwuation/continuwuity/issues/2555#issuecomment-40434: > 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_updates` is the old one, it does now work properly > > thank you so much for your patience!!!! > > (also not sure how hard it would be but maybe proper errors/warnings for deprecated options?) Yeah no worries. I think we just haven't marked that one as deprecated. We do have a thing for that.
Member

@poz wrote in #2555 (comment):

(also not sure how hard it would be but maybe proper errors/warnings for deprecated options?)

Semantics quibble as this may be, Continuwuity does have warnings for deprecated options, allow_check_for_updates just isn't one of them:

Lines 2975 to 2991 in bfb611d
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_updates is in fact deprecated, please let me know; I'll gladly file the PR to treat it as such.

@poz wrote in https://forgejo.ellis.link/continuwuation/continuwuity/issues/2555#issuecomment-40434: > (also not sure how hard it would be but maybe proper errors/warnings for deprecated options?) Semantics quibble as this may be, Continuwuity *does* have warnings for deprecated options, `allow_check_for_updates` just isn't one of them: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/bfb611d9e4344412bbeb82dcf5dabec4c696a8cc/src/core/config/mod.rs#L2975-L2991 @Aranjedeath if `allow_check_for_updates` *is* in fact deprecated, please let me know; I'll gladly file the PR to treat it as such.
Sign in to join this conversation.
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2555
No description provided.