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

service.nextcloud.config.adminpassFile doesn't accept space-separated passwords #49487

Closed
turion opened this issue Oct 30, 2018 · 9 comments
Closed
Assignees
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@turion
Copy link
Contributor

turion commented Oct 30, 2018

Steps to reproduce

  1. Create a file /root/db_pass.txt with contents
these are several words
  1. Enable nextcloud, add service.nextcloud.config.adminpassFile = "/root/db_pass.txt";
  2. nixos-rebuild switch fails because the database creation command is ill-formed.

Technical details

  • system: "x86_64-linux"
  • host os: Linux 4.14.76, NixOS, 19.03pre155751.45a419ab5a2 (Koi)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.1.3
  • channels(root): "nixos-19.03pre155751.45a419ab5a2"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@turion
Copy link
Contributor Author

turion commented Jun 3, 2020

I think this is still open.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2020
@tobiasBora
Copy link
Contributor

Who, I was not expecting that, but that issue completely broke my install with a strange error message:

[root@colisson:/etc/nixos]# rm -rf /var/lib/nextcloud/

[root@me:/etc/nixos]# nixos-rebuild --switch
Nixpkgs: /nix/store/m59d3v89nhp9207hgvf6v21wxq7lhq64-source
building Nix...
building the system configuration...
trace: warning: builtPerlPackage: `name' ("shelldap-1.4.0") is deprecated, use `pname' and `version' instead
trace: warning: builtPerlPackage: `name' ("Term-Shell-0.10") is deprecated, use `pname' and `version' instead
activating the configuration...
setting up /etc...
reloading user units for root...
setting up tmpfiles
warning: the following units failed: nextcloud-setup.service

● nextcloud-setup.service
   Loaded: loaded (/nix/store/q9r1sxxbcn1dym25npffg9zkcj36v2wv-unit-nextcloud-setup.service/nextcloud-setup.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-08-31 21:17:09 CEST; 159ms ago
  Process: 30700 ExecStart=/nix/store/vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start (code=exited, status=1/FAILURE)
 Main PID: 30700 (code=exited, status=1/FAILURE)
       IP: 0B in, 0B out
      CPU: 1.487s

Aug 31 21:17:05 colisson sudo[30708]: pam_unix(sudo:session): session opened for user nextcloud by (uid=0)
Aug 31 21:17:09 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[30700]:
Aug 31 21:17:09 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[30700]:   Too many arguments, expected arguments "command".
Aug 31 21:17:09 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[30700]:
Aug 31 21:17:09 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[30700]: maintenance:install [--database DATABASE] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-port DATABASE-PORT] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-prefix [DATABASE-TABLE-PREFIX]] [--database-table-space [DATABASE-TABLE-SPACE]] [--admin-user ADMIN-USER] [--admin-pass ADMIN-PASS] [--admin-email [ADMIN-EMAIL]] [--data-dir DATA-DIR]...
Aug 31 21:17:09 colisson sudo[30708]: pam_unix(sudo:session): session closed for user nextcloud
Aug 31 21:17:09 colisson systemd[1]: nextcloud-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 31 21:17:09 colisson systemd[1]: nextcloud-setup.service: Failed with result 'exit-code'.
Aug 31 21:17:09 colisson systemd[1]: Failed to start nextcloud-setup.service.
Aug 31 21:17:09 colisson systemd[1]: nextcloud-setup.service: Consumed 1.487s CPU time, no IP traffic.
Hint: Some lines were ellipsized, use -l to show in full.
warning: error(s) occurred while switching to the new configuration


[root@me:/etc/nixos]# nixos-rebuild --switch
Nixpkgs: /nix/store/m59d3v89nhp9207hgvf6v21wxq7lhq64-source
building Nix...
building the system configuration...
trace: warning: builtPerlPackage: `name' ("shelldap-1.4.0") is deprecated, use `pname' and `version' instead
trace: warning: builtPerlPackage: `name' ("Term-Shell-0.10") is deprecated, use `pname' and `version' instead
activating the configuration...
setting up /etc...
reloading user units for root...
setting up tmpfiles
warning: the following units failed: nextcloud-setup.service

● nextcloud-setup.service

   Loaded: loaded (/nix/store/q9r1sxxbcn1dym25npffg9zkcj36v2wv-unit-nextcloud-setup.service/nextcloud-setup.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-08-31 21:20:44 CEST; 144ms ago
  Process: 31420 ExecStart=/nix/store/vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start (code=exited, status=1/FAILURE)
 Main PID: 31420 (code=exited, status=1/FAILURE)
       IP: 0B in, 0B out
      CPU: 1.537s

Aug 31 21:20:39 colisson sudo[31427]: pam_unix(sudo:session): session opened for user nextcloud by (uid=0)
Aug 31 21:20:44 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[31420]: Nextcloud is not installed - only a limited number of commands are available
Aug 31 21:20:44 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[31420]:
Aug 31 21:20:44 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[31420]:   Command "upgrade" is not defined.
Aug 31 21:20:44 colisson vzi7spighcmjcvv712023igp0hq996bx-unit-script-nextcloud-setup-start[31420]:
Aug 31 21:20:44 colisson sudo[31427]: pam_unix(sudo:session): session closed for user nextcloud
Aug 31 21:20:44 colisson systemd[1]: nextcloud-setup.service: Main process exited, code=exited, status=1/FAILURE
Aug 31 21:20:44 colisson systemd[1]: nextcloud-setup.service: Failed with result 'exit-code'.
Aug 31 21:20:44 colisson systemd[1]: Failed to start nextcloud-setup.service.
Aug 31 21:20:44 colisson systemd[1]: nextcloud-setup.service: Consumed 1.537s CPU time, no IP traffic.
warning: error(s) occurred while switching to the new configuration

removing spaces in the password removes also the error message!

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/problem-with-services-nextcloud/6267/11

@stale
Copy link

stale bot commented Mar 5, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 5, 2021
@turion turion self-assigned this Mar 6, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 6, 2021
@turion
Copy link
Contributor Author

turion commented Mar 6, 2021

It seems that this has been fixed by:

commit caa725a
Author: Robbert Gurdeep Singh git@beardhatcode.be
Date: Sun Dec 20 17:16:11 2020 +0100

nixos/nextcloud: fix missing quotes arround $* in occ wrapper and replace with $@

This will allow this to work:
    nextcloud-occ config:app:set theming slogan --value="A place for testing"
diff --git nixos/modules/services/web-apps/nextcloud.nix nixos/modules/services/web-apps/nextcloud.nix
index 0dad85d681a..da019aa2507 100644
--- nixos/modules/services/web-apps/nextcloud.nix
+++ nixos/modules/services/web-apps/nextcloud.nix
@@ -39,7 +39,7 @@ let
     export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
     $sudo \
       ${phpPackage}/bin/php \
-      occ $*
+      occ "$@"
   '';
 
   inherit (config.system) stateVersion;

@turion
Copy link
Contributor Author

turion commented Mar 6, 2021

I might upload a test that tests the adminpassFile option later.

@stale
Copy link

stale bot commented Sep 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 3, 2021
@turion
Copy link
Contributor Author

turion commented Sep 3, 2021

I'm not coming around to updating the test.

@turion turion closed this as completed Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants