Skip to content
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

etherpad-lite: init at 2.2.6 #353814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

etherpad-lite: init at 2.2.6 #353814

wants to merge 1 commit into from

Conversation

erdnaxe
Copy link
Member

@erdnaxe erdnaxe commented Nov 5, 2024

Fix #117608

When starting etherpad-lite, you need to provide some arguments:

  • --settings with an absolute path to settings.json
  • --credentials with an absolute path to credentials.json (which will be created),
  • --sessionkey with an absolute path to SESSIONKEY.txt (which will be created).

else etherpad-lite will try to write into the Nix store and fail.

settings.json also needs to reference a database outside of the nix store.

Note: we will need to contribute an option upstream later for plugins support, as Etherpad hardcodes the path to <etherpad_root>/var/installed_plugins.json: https://github.com/ether/etherpad-lite/blob/056e777539dc9b5ef7db965740965b0f49ac388e/bin/plugins.ts#L68

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@KiaraGrouwstra
Copy link
Contributor

Result of nixpkgs-review pr 353814 run on x86_64-linux 1

1 package built:
  • etherpad-lite

@KiaraGrouwstra
Copy link
Contributor

the package builds fine.

i seem to also get a run-time error tho about the db, for which it similarly defaults to trying to write to the nix store:

[2024-11-09T21:34:13.932] [ERROR] server - Error: ENOENT: no such file or directory, open '/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/var/dirty.db'

could you maybe update your instructions to incorporate that one as well?

(i kinda wish it at least had a working --help to kinda clarify stuff like this...)

@erdnaxe
Copy link
Member Author

erdnaxe commented Nov 12, 2024

i seem to also get a run-time error tho about the db, for which it similarly defaults to trying to write to the nix store:

You need to change the database path in settings.json. I am going to update my instructions with this precision, thanks!

@KiaraGrouwstra
Copy link
Contributor

Hm. Does it not create the dirty/sqlite db files by themselves, if they do not yet exist?
$ results/etherpad-lite-x86_64-linux/bin/etherpad-lite --credentials ./credentials.json --sessionkey ./SESSIONKEY.txt --settings ~/Downloads/etherpad-lite-settings.json
[2024-11-13T18:32:34.612] [INFO] settings - All relative paths will be interpreted relative to the identified Etherpad base dir: /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib
[2024-11-13T18:32:34.626] [INFO] settings - settings loaded from: /home/kiara/Downloads/etherpad-lite-settings.json
[2024-11-13T18:32:34.627] [INFO] settings - No credentials file found in /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/credentials.json. Ignoring.
[2024-11-13T18:32:34.627] [WARN] settings - loglevel: INFO
[2024-11-13T18:32:34.628] [WARN] settings - logLayoutType: colored
[2024-11-13T18:32:34.628] [INFO] settings - Using skin "colibris" in dir: /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/static/skins/colibris
[2024-11-13T18:32:34.628] [WARN] settings - DirtyDB is used. This is not recommended for production. File location: /var/dirty.db
[2024-11-13T18:32:34.628] [INFO] settings - Random string used for versioning assets: b02dd51b
[2024-11-13T18:32:35.083] [INFO] server - Starting Etherpad...
[2024-11-13T18:32:35.110] [INFO] plugins - check installed plugins for migration
[2024-11-13T18:32:35.111] [ERROR] server - Metrics at time of fatal error:
{
  "httpStartTime": 0,
  "memoryUsage": 210235392,
  "memoryUsageHeap": 79129112,
  "ueberdb_lockAwaits": 0,
  "ueberdb_lockAcquires": 0,
  "ueberdb_lockReleases": 0,
  "ueberdb_reads": 0,
  "ueberdb_readsFailed": 0,
  "ueberdb_readsFinished": 0,
  "ueberdb_readsFromCache": 0,
  "ueberdb_readsFromDb": 0,
  "ueberdb_readsFromDbFailed": 0,
  "ueberdb_readsFromDbFinished": 0,
  "ueberdb_writes": 0,
  "ueberdb_writesFailed": 0,
  "ueberdb_writesFinished": 0,
  "ueberdb_writesObsoleted": 0,
  "ueberdb_writesToDb": 0,
  "ueberdb_writesToDbFailed": 0,
  "ueberdb_writesToDbFinished": 0,
  "ueberdb_writesToDbRetried": 0
}
[2024-11-13T18:32:35.111] [ERROR] server - Error: EACCES: permission denied, open '/var/dirty.db'
[2024-11-13T18:32:35.111] [INFO] server - Exiting...
[2024-11-13T18:32:35.112] [INFO] plugins - /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/var/installed_plugins.json not found, creating using current node modules
[2024-11-13T18:32:35.112] [INFO] plugins - start migration of plugins in node_modules
[2024-11-13T18:32:35.118] [INFO] plugins - pnpm --version: 9.12.3
[2024-11-13T18:32:35.514] [WARN] plugins - unable to create /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/var/installed_plugins.json, skipping plugin migrations
[2024-11-13T18:32:35.514] [INFO] plugins - Loading plugin ep_etherpad-lite...
[2024-11-13T18:32:35.515] [INFO] plugins - Loaded 1 plugins
[2024-11-13T18:32:36.244] [INFO] server - Installed plugins:
[2024-11-13T18:32:36.245] [INFO] settings - Report bugs at https://github.com/ether/etherpad-lite/issues
[2024-11-13T18:32:36.246] [WARN] settings - Can't get git version for server header
ENOENT: no such file or directory, lstat '/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/.git'
[2024-11-13T18:32:36.246] [WARN] settings - Can't get git version for server header
ENOENT: no such file or directory, lstat '/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/.git'
[2024-11-13T18:32:36.246] [INFO] settings - Your Etherpad version is 2.2.6 ()
[2024-11-13T18:32:36.252] [ERROR] server - Error occurred while starting Etherpad
[2024-11-13T18:32:36.252] [ERROR] server - Metrics at time of fatal error:
{
  "httpStartTime": 0,
  "memoryUsage": 276463616,
  "memoryUsageHeap": 130400088,
  "ueberdb_lockAwaits": 0,
  "ueberdb_lockAcquires": 1,
  "ueberdb_lockReleases": 1,
  "ueberdb_reads": 0,
  "ueberdb_readsFailed": 0,
  "ueberdb_readsFinished": 0,
  "ueberdb_readsFromCache": 0,
  "ueberdb_readsFromDb": 0,
  "ueberdb_readsFromDbFailed": 0,
  "ueberdb_readsFromDbFinished": 0,
  "ueberdb_writes": 1,
  "ueberdb_writesFailed": 1,
  "ueberdb_writesFinished": 1,
  "ueberdb_writesObsoleted": 0,
  "ueberdb_writesToDb": 1,
  "ueberdb_writesToDbFailed": 1,
  "ueberdb_writesToDbFinished": 1,
  "ueberdb_writesToDbRetried": 0,
  "totalUsers": 0,
  "activePads": 0
}
[2024-11-13T18:32:36.254] [ERROR] server - Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
    at _write (node:internal/streams/writable:489:11)
    at Writable.write (node:internal/streams/writable:508:10)
    at Dirty._flush (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:62691:54)
    at Dirty.set (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:62546:19)
    at Dirty_db.set (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:62776:17)
    at node:internal/util:432:7
    at new Promise (<anonymous>)
    at bound set [as set] (node:internal/util:418:12)
    at writeOneOp (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:586:46)
    at Database._write (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:598:19)
    at Database._setLocked (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:423:22)
    at Database.set (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:377:26)
    at async Object.set (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/node/db/DB.ts:50:47)
    at async SecretRotator._publish (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/node/security/SecretRotator.ts:114:5)
[2024-11-13T18:32:36.254] [ERROR] server - Error occurred while waiting to exit. Forcing an immediate unclean exit...
$ hx ~/Downloads/etherpad-lite-settings.json                                                                review-shell
$ results/etherpad-lite-x86_64-linux/bin/etherpad-lite --credentials ./credentials.json --sessionkey ./SESSIONKEY.txt --settings ~/Downloads/etherpad-lite-settings.json
[2024-11-13T18:33:38.748] [INFO] settings - All relative paths will be interpreted relative to the identified Etherpad base dir: /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib
[2024-11-13T18:33:38.761] [INFO] settings - settings loaded from: /home/kiara/Downloads/etherpad-lite-settings.json
[2024-11-13T18:33:38.763] [INFO] settings - No credentials file found in /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/credentials.json. Ignoring.
[2024-11-13T18:33:38.763] [WARN] settings - loglevel: INFO
[2024-11-13T18:33:38.763] [WARN] settings - logLayoutType: colored
[2024-11-13T18:33:38.764] [INFO] settings - Using skin "colibris" in dir: /nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/static/skins/colibris
[2024-11-13T18:33:38.764] [WARN] settings - File location: /var/dirty.db
[2024-11-13T18:33:38.764] [INFO] settings - Random string used for versioning assets: e410af92
[2024-11-13T18:33:39.230] [INFO] server - Starting Etherpad...
[2024-11-13T18:33:39.256] [ERROR] server - Error occurred while starting Etherpad
[2024-11-13T18:33:39.257] [ERROR] server - Metrics at time of fatal error:
{
  "httpStartTime": 0,
  "memoryUsage": 215609344,
  "memoryUsageHeap": 79336720
}
[2024-11-13T18:33:39.258] [ERROR] server - Error: Rusqlite error: unable to open database file: /var/dirty.db
    at SQLiteDB.init (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:333383:19)
    at node:internal/util:432:7
    at new Promise (<anonymous>)
    at bound init [as init] (node:internal/util:418:12)
    at Database.init (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:267:30)
    at Database.init (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/ueberdb2/dist/index.js:343317:24)
    at Object.exports.init (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/node/db/DB.ts:41:20)
    at Object.exports.start (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/node/server.ts:169:14)
    at err (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/node/server.ts:310:38)
    at Object.<anonymous> (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/src/node/server.ts:313:61)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Object.transformer (/nix/store/b5yhggnm80kp5ifkdyr0chqbdw30r7l5-etherpad-lite-2.2.6/lib/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/register-DpmFHar1.cjs:2:1186)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
    at node:internal/main/run_main_module:28:49
[2024-11-13T18:33:39.258] [INFO] server - Exiting...
[2024-11-13T18:33:39.258] [INFO] server - Waiting for Node.js to exit...
[2024-11-13T18:33:39.261] [INFO] plugins - pnpm --version: 9.12.3
[2024-11-13T18:33:44.258] [ERROR] server - Something that should have been cleaned up during the shutdown hook (such as a timer, worker thread, or open connection) is preventing Node.js from exiting
[2024-11-13T18:33:44.259] [ERROR] server - Enable `dumpOnUncleanExit` setting to get a dump of objects preventing a clean exit
[2024-11-13T18:33:44.259] [ERROR] server - Forcing an unclean exit...
 ~  .cache  nixpkgs-review  pr-353814    ERROR  %  ls results/etherpad-lite-x86_64-linux/bin/                                                        review-shell
 etherpad-lite

Your package seems fine, I guess I'm just not so familiar with this software.

@erdnaxe
Copy link
Member Author

erdnaxe commented Nov 13, 2024

@KiaraGrouwstra In your log you see the following error: Error: EACCES: permission denied, open '/var/dirty.db'
It's expected: Etherpad cannot write into /var/ as it is owned by root, not by your user.

@erdnaxe
Copy link
Member Author

erdnaxe commented Nov 13, 2024

I plan to contribute a NixOS module later, to help users setup Etherpad on NixOS. I agree with the fact that Etherpad doesn't have an intuitive command line interface.

pkgs/by-name/et/etherpad-lite/package.nix Outdated Show resolved Hide resolved
runHook postBuild
'';

# Upstream scripts uses `pnpm run prod` which is equivalent to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How hard would it be to patch that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by 'that'? Should I change makeWrapper arguments to use pnpm in $out?

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 14, 2024
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 17, 2024
@FliegendeWurst FliegendeWurst added the needs_reviewer (old Marvin label, do not use) label Nov 25, 2024
@SigmaSquadron SigmaSquadron removed the needs_reviewer (old Marvin label, do not use) label Jan 5, 2025
fetchFromGitHub,
fetchpatch,
gitUpdater,
pnpm,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely you need to change pnpm to pnpm_9. Since #371832, it points to pnpm_10 instead of pnpm_9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

packaging request: etherpad
7 participants