-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
nixos/plausible: Fix shell scripting errors, runtime fixes #130062
Conversation
Thank you for this! Out of curiosity what was your failure case? Did you not set those conf variables or was it something else? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ofborg test plausible
@happysalada I'm not sure what you mean, assertions on nix variables or shell variables? For the shell variables, this PR adds
The problem from #124055 (comment): I didn't put my secrets into the nix store, where they are world-readable. As a result, the |
I was thinking of a nix assert. But in your case you don't want to put those variables in the nix store right? So no assertions is fine probably. Out of curiosity what solution did you end up with ? Something like agenix or sops2nix ? |
@happysalada I changed the module for now to not use |
@Ma27 @happysalada I pushed 2 more commits, one that fixes that the patch introduced in https://github.com/NixOS/nixpkgs/pull/124055/files#diff-17ac0fd74e68fbbd03f80f2621d691d3f120a776537bae768bc2206de9559063R31 completely breaks Plausible because it's incompatible with the version of |
Please wait with merging, I'd like to take a closer look at this today! |
patches = [ ./ecto_sql-fix.patch ]; | ||
patches = [ | ||
./ecto_sql-fix.patch | ||
./plausible-Bump-clickhouse_ecto-dependency-to-be-compatible-with-ecto-3.6.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of adding a patch,, how about updating plausible to an unstable version ? (trying to use the current master for example)
There are a couple of things that work differently, but I would be happy to details the changes (the ones I followed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An additional info regarding this. Upstream provides now a secure way to read secrets, you can now specify a configuration folder and the which file the secret should be read from.
Appart from that, I don't think much has changed. If you are still against an update to an unstable version, no worries.
Note that <literal>/path</literal> components are currently ignored: | ||
<link xlink:href="https://github.com/plausible/analytics/issues/1182"> | ||
https://github.com/plausible/analytics/issues/1182 | ||
</link>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<xref xlink:href="..." />
should be sufficient here.
@nh2 I have to admit that I somehow lost track of what your issues are specifically after reading something in multiple threads/conversations. Are the fixes here plus #130101 sufficient? Also regarding 1656e8e: can you elaborate what exactly went wrong there? I mean, the createdb.sh somehow succeeded still. I mean, I believe you, but I'd really like to fully understand what went wrong there :D |
Fixes runtime error during `migrate.sh`: ** (UndefinedFunctionError) function ClickhouseEcto.lock_for_migrations/3 is undefined or private The function `lock_for_migrations` indeed does not exist in the `ClickhouseEcto` module packaged so far. Reason: So far we use the patch `ecto_sql-fix.patch` doing - {:ecto_sql, "~> 3.0"}, + {:ecto_sql, "~> 3.6"}, @scvalex found that the commit that makes the `plausible/clickhouse_ecto` fork compatible with 3.6 is _newer_ than the commit pinned in the `.lock` file, namely `1969f14ecef - Update for ecto 3.6.1`: plausible/clickhouse_ecto@1969f14ecef That commit introduces the function that my error shows (`def lock_for_migrations`). This means that the version that's in the lockfile (and pulled) was incompatible with the version the nixpkgs patch forces. This commit fixes it by patching the `.lock` file to have the version of `plausible/clickhouse_ecto` that makes it compatible with `ecto_sql` 3.6.
1656e8e
to
6de23b9
Compare
@Ma27 Yes. Concretely, there were 3 issues I encountered in this order:
I made a mistake in the commit message: It is I believe it should be impossible to deploy a working Plausible service on Because that function that's called there, I have verified that using:
This prints the functions in the module, and If you run the NixOS tests on current NIX_PATH=nixpkgs=. nix-build --no-link nixos/tests/plausible.nix Output:
So the conclusion here is that because of the lack of effective
Yes, full understanding is usually the best approach. 👍 Hope the above helps clear it up! |
Another related topic you may want to be aware of, also involving I have found the options to set the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's reasonable to delay this even more. The current changes solve an actual problem, so I'm going to merge this.
If you prefer to go to an unstable version now rather than waiting for an upstream-release, I'd be fine with that.
Motivation for this change
See https://github.com/NixOS/nixpkgs/pull/124055/files#r668271575
Fixes script continuing on fatal errors instead of aborting.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)