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

[Bug] NixOS module missing dependencies #1645

Open
sgillespie opened this issue Mar 6, 2024 · 2 comments
Open

[Bug] NixOS module missing dependencies #1645

sgillespie opened this issue Mar 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sgillespie
Copy link
Contributor

OS
NixOS

Versions
The db-sync version (eg cardano-db-sync --version): 13.2.0.1
PostgreSQL version: 15

Build/Install Method
NixOS module

Run method
The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none): NixOS module

Additional context
Add any other context about the problem here.

Problem Report
The getconf bin in postgresql.sh setup script used here isn't in coreutils pkg of nixos, but this script does get used by the dbsync systemd service:

/nix/store/8srs5rqymbnsm8gg515qxxbnl3k4jjyl-postgresql-setup.sh: line 28: getconf: command not found
/nix/store/8srs5rqymbnsm8gg515qxxbnl3k4jjyl-postgresql-setup.sh: line 29: test: : integer expression expected
During a takeSnapshot operation, the error is fatal and a snapshot won't be taken:
Mar 06 19:18:06 misc1-snapshots-eu-central-1a-1 systemd[1]: Stopping cardano-db-sync.service...
Mar 06 19:18:07 misc1-snapshots-eu-central-1a-1 cardano-db-sync-post-stop[131443]: yes: standard output: Broken pipe
Mar 06 19:18:07 misc1-snapshots-eu-central-1a-1 cardano-db-sync-post-stop[131456]: /nix/store/1bys3yjgm97yxy91sfy8f5law41fyif9-postgresql-setup.sh: line 28: getconf: command not found
Mar 06 19:18:07 misc1-snapshots-eu-central-1a-1 cardano-db-sync-post-stop[131454]: /nix/store/1bys3yjgm97yxy91sfy8f5law41fyif9-postgresql-setup.sh: line 29: test: : integer expression expected
Mar 06 19:18:07 misc1-snapshots-eu-central-1a-1 cardano-db-sync-post-stop[131454]: Working directory: /tmp/db-sync-snapshot-JPdTxx0lUE
Mar 06 19:18:07 misc1-snapshots-eu-central-1a-1 cardano-db-sync-post-stop[131472]: pg_dump: error: -j/--jobs must be in range 1..2147483647
Mar 06 19:18:07 misc1-snapshots-eu-central-1a-1 systemd[1]: cardano-db-sync.service: Control process exited, code=exited, status=1/FAILURE
I've added pkgs.getconf to the systemd.services.cardano-db-sync.path and that fixes the takeSnapshot failure (probably will also fix the non-fatal error for restore snapshot, but haven't tested that).  Probably that getconf package should get added to the nixos cardano-db-sync service path by default. (edited)
@sgillespie sgillespie added the bug Something isn't working label Mar 6, 2024
@sgillespie
Copy link
Contributor Author

The following warning should also be looked at:

cardano-db-sync-post-stop[131443]: yes: standard output: Broken pipe

Although it does not prevent the snapshot from being created

@johnalotoski
Copy link
Contributor

Package tree is also missing from the nixos service but referenced here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants