nextcloud / nextcloud/nextcloudpi

nc-encrypt: fuse device not found / fusermount exited with code 256

Open
#1,440 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docker has-updates needs triage
Dominant language
Shell
Stars
2.9k
Forks
318
PR merge metrics
No merged PRs in 30d

Description

I'm running nextcloudpi for a year in a docker container (portainer). Now I want to have a second container for nextcloudpi with nc-encrypt enabled.
When I do so, I get the following error with a red dot next to the apply-button:

[ nc-encrypt ] (Wed Mar 9 13:37:34 UTC 2022)
Maintenance mode enabled
/bin/fusermount: fuse device not found, try 'modprobe fuse' first
fuse.NewServer failed: fusermount exited with code 256
{"reqId":"vqqTVbUIVR1QL3dCjfNb","level":2,"time":"2022-03-09T13:37:35+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /var/www/nextcloud/data/tmp is not present or writable","userAgent":"--","version":"23.0.2.1"}
{"reqId":"vqqTVbUIVR1QL3dCjfNb","level":2,"time":"2022-03-09T13:37:35+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /var/www/nextcloud/data/tmp is not present or writable","userAgent":"--","version":"23.0.2.1"}
{"reqId":"vqqTVbUIVR1QL3dCjfNb","level":3,"time":"2022-03-09T13:37:36+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/data/nextcloud/data/data_dir_writability_test_6228ada00b844.tmp): failed to open stream: Permission denied at /data/nextcloud/lib/private/legacy/OC_Util.php#792","userAgent":"--","version":"23.0.2.1","exception":{"Exception":"Error","Message":"fopen(/data/nextcloud/data/data_dir_writability_test_6228ada00b844.tmp): failed to open stream: Permission denied at /data/nextcloud/lib/private/legacy/OC_Util.php#792","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/data/nextcloud/lib/private/legacy/OC_Util.php","line":792,"function":"fopen"},{"file":"/data/nextcloud/lib/private/Console/Application.php","line":157,"function":"checkServer","class":"OC_Util","type":"::"},{"file":"/data/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/data/nextcloud/occ","line":11,"args":["/data/nextcloud/console.php"],"function":"require_once"}],"File":"/data/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/23/go.php?to=admin-dir_permissions.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /data/nextcloud/lib/private/Console/Application.php:164
Stack trace:
#0 /data/nextcloud/console.php(98): OC\Console\Application->loadCommands()
#1 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#2 {main}{"reqId":"vqqTVbUIVR1QL3dCjfNb","level":3,"time":"2022-03-09T13:37:36+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/data/nextcloud/data/nextcloud.log): failed to open stream: Permission denied at /data/nextcloud/lib/private/Log/File.php#84","userAgent":"--","version":"23.0.2.1"}

Not quite sure what causes the issue.
When I access ncp web interface (:4443), it redirects to :4443/decrypt with a blank page.
When I access nc, it says that the data directory is invalid and not writable.
When I reboot the container and then access nc, it asks for the password to decrypt but it says it's wrong.

Here's a step-by-step video:

https://user-images.githubusercontent.com/24477557/157534705-0c74cbdb-8d05-4d09-8009-1ae05b116e31.mp4

The 2 NextCloudPi Containers are managed by Portainer. Portainer is installed on Proxmox.
ncp version: 1.46.9
nc version: 23.0.2.1

System information (after nc-encrypt enabled+restart)

NextCloudPi diagnostics

{"reqId":"LEZT2HlJkseU2IkIPk0Q","level":2,"time":"2022-03-09T20:54:05+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /var/www/nextcloud/data/tmp is not present or writable","userAgent":"--","version":"23.0.2.1"}
{"reqId":"LEZT2HlJkseU2IkIPk0Q","level":2,"time":"2022-03-09T20:54:05+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /var/www/nextcloud/data/tmp is not present or writable","userAgent":"--","version":"23.0.2.1"}
Nextcloud is in maintenance mode, hence the database isn't accessible.
Cannot perform any command except 'maintenance:mode --off'

{"reqId":"LEZT2HlJkseU2IkIPk0Q","level":3,"time":"2022-03-09T20:54:05+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/data/nextcloud/data/data_dir_writability_test_622913ed385bc.tmp): failed to open stream: Permission denied at /data/nextcloud/lib/private/legacy/OC_Util.php#792","userAgent":"--","version":"23.0.2.1","exception":{"Exception":"Error","Message":"fopen(/data/nextcloud/data/data_dir_writability_test_622913ed385bc.tmp): failed to open stream: Permission denied at /data/nextcloud/lib/private/legacy/OC_Util.php#792","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/data/nextcloud/lib/private/legacy/OC_Util.php","line":792,"function":"fopen"},{"file":"/data/nextcloud/lib/private/Console/Application.php","line":157,"function":"checkServer","class":"OC_Util","type":"::"},{"file":"/data/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/data/nextcloud/occ","line":11,"args":["/data/nextcloud/console.php"],"function":"require_once"}],"File":"/data/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"LEZT2HlJkseU2IkIPk0Q","level":3,"time":"2022-03-09T20:54:05+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/data/nextcloud/data/nextcloud.log): failed to open stream: Permission denied at /data/nextcloud/lib/private/Log/File.php#84","userAgent":"--","version":"23.0.2.1"}
NextCloudPi version  v1.46.9
NextCloudPi image    NextCloudPi_docker_03-07-22
OS                   Debian GNU/Linux 11. 5.11.22-1-pve (x86_64)
automount            no
USB devices          none
datadir              /data/nextcloud/data
data in SD           yes
data filesystem      overlayfs
data disk usage      122G/147G
rootfs usage         122G/147G
swapfile             /dev/dm-0
dbdir                /data/database
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
HPB service          down
Postfix service      up
internet check       ok
port check 80        closed
port check 443       open
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               79days

Nextcloud configuration

{"reqId":"FnUACUzrTgy1KS8kB4i9","level":2,"time":"2022-03-09T20:54:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /var/www/nextcloud/data/tmp is not present or writable","userAgent":"--","version":"23.0.2.1"}
{"reqId":"FnUACUzrTgy1KS8kB4i9","level":2,"time":"2022-03-09T20:54:10+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"Temporary directory /var/www/nextcloud/data/tmp is not present or writable","userAgent":"--","version":"23.0.2.1"}
Nextcloud is in maintenance mode, hence the database isn't accessible.
Cannot perform any command except 'maintenance:mode --off'

{"reqId":"FnUACUzrTgy1KS8kB4i9","level":3,"time":"2022-03-09T20:54:10+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/data/nextcloud/data/data_dir_writability_test_622913f2b7447.tmp): failed to open stream: Permission denied at /data/nextcloud/lib/private/legacy/OC_Util.php#792","userAgent":"--","version":"23.0.2.1","exception":{"Exception":"Error","Message":"fopen(/data/nextcloud/data/data_dir_writability_test_622913f2b7447.tmp): failed to open stream: Permission denied at /data/nextcloud/lib/private/legacy/OC_Util.php#792","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/data/nextcloud/lib/private/legacy/OC_Util.php","line":792,"function":"fopen"},{"file":"/data/nextcloud/lib/private/Console/Application.php","line":157,"function":"checkServer","class":"OC_Util","type":"::"},{"file":"/data/nextcloud/console.php","line":98,"function":"loadCommands","class":"OC\\Console\\Application","type":"->"},{"file":"/data/nextcloud/occ","line":11,"args":["/data/nextcloud/console.php"],"function":"require_once"}],"File":"/data/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/23/go.php?to=admin-dir_permissions.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /data/nextcloud/lib/private/Console/Application.php:164
Stack trace:
#0 /data/nextcloud/console.php(98): OC\Console\Application->loadCommands()
#1 /data/nextcloud/occ(11): require_once('/data/nextcloud...')
#2 {main}{"reqId":"FnUACUzrTgy1KS8kB4i9","level":3,"time":"2022-03-09T20:54:10+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/data/nextcloud/data/nextcloud.log): failed to open stream: Permission denied at /data/nextcloud/lib/private/Log/File.php#84","userAgent":"--","version":"23.0.2.1"}

HTTPd logs

[Wed Mar 09 20:47:41.824775 2022] [core:notice] [pid 115:tid 139627137887552] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 09 20:48:10.372914 2022] [mpm_event:notice] [pid 115:tid 139627137887552] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Mar 09 20:48:10.379695 2022] [ssl:error] [pid 115:tid 139627137887552] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 77013E54EC5E5AF8723BFFC6B78B9031967A2436 / notbefore: Mar  1 23:30:13 2022 GMT / notafter: Feb 27 23:30:13 2032 GMT]
[Wed Mar 09 20:48:10.379706 2022] [ssl:error] [pid 115:tid 139627137887552] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed Mar 09 20:48:10.380582 2022] [mpm_event:notice] [pid 115:tid 139627137887552] AH00489: Apache/2.4.52 (Debian) OpenSSL/1.1.1k configured -- resuming normal operations
[Wed Mar 09 20:48:10.380588 2022] [core:notice] [pid 115:tid 139627137887552] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 09 20:48:24.786114 2022] [authnz_external:error] [pid 1516:tid 139626987177728] [client 192.168.178.20:36688] AuthExtern pwauth [/usr/sbin/pwauth]: Failed (1) for user ncp
[Wed Mar 09 20:48:24.786209 2022] [auth_basic:error] [pid 1516:tid 139626987177728] [client 192.168.178.20:36688] AH01617: user ncp: authentication failure for "/": Password Mismatch
[Wed Mar 09 20:49:45.557280 2022] [mpm_event:notice] [pid 115:tid 139627137887552] AH00492: caught SIGWINCH, shutting down gracefully
[Wed Mar 09 20:49:48.421479 2022] [ssl:error] [pid 108:tid 140473502526784] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 77013E54EC5E5AF8723BFFC6B78B9031967A2436 / notbefore: Mar  1 23:30:13 2022 GMT / notafter: Feb 27 23:30:13 2032 GMT]
[Wed Mar 09 20:49:48.421491 2022] [ssl:error] [pid 108:tid 140473502526784] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed Mar 09 20:49:48.428846 2022] [ssl:error] [pid 109:tid 140473502526784] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 77013E54EC5E5AF8723BFFC6B78B9031967A2436 / notbefore: Mar  1 23:30:13 2022 GMT / notafter: Feb 27 23:30:13 2032 GMT]
[Wed Mar 09 20:49:48.428858 2022] [ssl:error] [pid 109:tid 140473502526784] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Wed Mar 09 20:49:48.430529 2022] [mpm_event:notice] [pid 109:tid 140473502526784] AH00489: Apache/2.4.52 (Debian) OpenSSL/1.1.1k configured -- resuming normal operations
[Wed Mar 09 20:49:48.430550 2022] [core:notice] [pid 109:tid 140473502526784] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 09 20:49:53.440738 2022] [mpm_event:notice] [pid 109:tid 140473502526784] AH00493: SIGUSR1 received.  Doing graceful restart
[Wed Mar 09 20:49:53.446864 2022] [ssl:error] [pid 109:tid 140473502526784] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=localhost / issuer: CN=localhost / serial: 77013E54EC5E5AF8723BFFC6B78B9031967A2436 / notbefore: Mar  1 23:30:13 2022 GMT / notafter: Feb 27 23:30:13 2032 GMT]
[Wed Mar 09 20:49:53.446889 2022] [ssl:error] [pid 109:tid 140473502526784] AH02604: Unable to configure certificate localhost:443:0 for stapling
[Wed Mar 09 20:49:53.447740 2022] [mpm_event:notice] [pid 109:tid 140473502526784] AH00489: Apache/2.4.52 (Debian) OpenSSL/1.1.1k configured -- resuming normal operations
[Wed Mar 09 20:49:53.447748 2022] [core:notice] [pid 109:tid 140473502526784] AH00094: Command line: '/usr/sbin/apache2'

Database logs

tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory

Nextcloud logs

tail: cannot open '/data/nextcloud/data/nextcloud.log' for reading: No such file or directory

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing nc-encrypt in the Docker and Portainer setup, then inspect the /bin/fusermount error and the data-directory permission failures shown in the logs. Check the nc-encrypt entry point alongside Nextcloud's console.php, occ, and OC_Util.php references; done means encryption applies without the FUSE error and the data directory remains valid and writable.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.