NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.86k stars 13.93k forks source link

Unifi does not start in NixOS 23.11 #275227

Open Dehumanizer77 opened 10 months ago

Dehumanizer77 commented 10 months ago

Describe the bug

Unifi controller does not start after NixOS upgrade.

Steps To Reproduce

Steps to reproduce the behavior:

  1. enable unifi service with services.unifi.unifiPackage = pkgs.unifi; (i.e. unifi 7.5.187 as of now)
  2. the service does not start (due to mongodb restarting in a loop, see bellow)

Additional context

once again the same problem (but different error than with upgrade to nixos 23.05 - https://github.com/NixOS/nixpkgs/issues/236293) However this time upgrading to mongodb 4.4 by setting mongodbPackage = pkgs.mongodb-4_4; while still on NixOS 23.05 doesn't help and renders the very same error as with 23.11 (see bellow). Of course setting mongodbPackage to the default mongo in 23.11 which is currently 6.0.11 (i.e. removing the setting completely) does not work either.

mongodb is restarting in a loop, producing these logs:

{"t":{"$date":"2023-12-18T17:13:02.930+00:00"},"s":"I",  "c":"CONTROL",  "id":20698,   "ctx":"main","msg":"***** SERVER RESTARTED *****"}
{"t":{"$date":"2023-12-18T17:13:02.935+00:00"},"s":"I",  "c":"CONTROL",  "id":23285,   "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2023-12-18T17:13:02.938+00:00"},"s":"I",  "c":"NETWORK",  "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2023-12-18T17:13:02.938+00:00"},"s":"I",  "c":"STORAGE",  "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":1466,"port":27117,"dbPath":"/var/lib/unifi/data/db","architecture":"64-bit","host":"unifi1"}}
{"t":{"$date":"2023-12-18T17:13:02.938+00:00"},"s":"I",  "c":"CONTROL",  "id":23403,   "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.19","gitVersion":"9a996e0ad993148b9650dc402e6d3b1804ad3b8a","openSSLVersion":"OpenSSL 3.0.8 7 Feb 2023","modules":[],"allocator":"tcmalloc","environment":{"distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2023-12-18T17:13:02.938+00:00"},"s":"I",  "c":"CONTROL",  "id":51765,   "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"nixos","version":"\"23.05\""}}}
{"t":{"$date":"2023-12-18T17:13:02.939+00:00"},"s":"I",  "c":"CONTROL",  "id":21951,   "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"127.0.0.1","port":27117,"unixDomainSocket":{"pathPrefix":"/var/lib/unifi/run"}},"processManagement":{"pidFilePath":"/var/lib/unifi/run/mongod.pid"},"storage":{"dbPath":"/var/lib/unifi/data/db","wiredTiger":{"engineConfig":{"configString":"cache_size=256M"}}},"systemLog":{"destination":"file","logAppend":true,"logRotate":"reopen","path":"/var/lib/unifi/logs/mongod.log"}}}}
{"t":{"$date":"2023-12-18T17:13:02.939+00:00"},"s":"I",  "c":"STORAGE",  "id":22270,   "ctx":"initandlisten","msg":"Storage engine to use detected by data files","attr":{"dbpath":"/var/lib/unifi/data/db","storageEngine":"wiredTiger"}}
{"t":{"$date":"2023-12-18T17:13:02.939+00:00"},"s":"I",  "c":"STORAGE",  "id":22297,   "ctx":"initandlisten","msg":"Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem","tags":["startupWarnings"]}
{"t":{"$date":"2023-12-18T17:13:02.940+00:00"},"s":"I",  "c":"STORAGE",  "id":22315,   "ctx":"initandlisten","msg":"Opening WiredTiger","attr":{"config":"create,cache_size=445M,session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress,compact_progress],cache_size=256M"}}
{"t":{"$date":"2023-12-18T17:13:03.568+00:00"},"s":"W",  "c":"STORAGE",  "id":22347,   "ctx":"initandlisten","msg":"Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade."}
{"t":{"$date":"2023-12-18T17:13:03.568+00:00"},"s":"F",  "c":"STORAGE",  "id":28595,   "ctx":"initandlisten","msg":"Terminating.","attr":{"reason":"95: Operation not supported"}}
{"t":{"$date":"2023-12-18T17:13:03.568+00:00"},"s":"F",  "c":"-",        "id":23091,   "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":28595,"file":"src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp","line":958}}
{"t":{"$date":"2023-12-18T17:13:03.568+00:00"},"s":"F",  "c":"-",        "id":23092,   "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}

Notify maintainers

@globin @Patryk27

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.64, NixOS, 23.11 (Tapir), 23.11pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

Dehumanizer77 commented 10 months ago

Ok so this can also be worked around by recreating the mongo database after upgrading mongodb as per https://github.com/NixOS/nixpkgs/issues/236293#issuecomment-1861403441

Aleksanaa commented 7 months ago

We might need some stateVersion stuff again?