Nextcloud Reinstall Issue

This all started when i could not log into Nextcloud and tried to debug it. I decided as I had an issue where I lost admin rights on a previous post here that I should just try to reinstall Nextcloud.

However when I tried to reinstall from the syncloud interface it failed to install. So I tried it from terminal using ‘snap install nextcloud’ and it gives the following error

root@syncloud:~# snap install nextcloud
error: cannot perform the following tasks:

  • Run configure hook of “nextcloud” snap if present (run hook “configure”:

2023-03-12 10:32:09,711 - database - INFO - postgres executing: snap run nextcloud.psql -U nextcloud -d postgres -c “ALTER USER nextcloud WITH PASSWORD ‘nextcloud’;”
2023-03-12 10:32:09,790 - database - INFO - ALTER ROLE
2023-03-12 10:32:09,790 - database - INFO - postgres executing: snap run nextcloud.psql -U nextcloud -d postgres -c “CREATE DATABASE nextcloud OWNER nextcloud TEMPLATE template0 ENCODING ‘UTF8’;”
2023-03-12 10:32:10,184 - database - INFO - CREATE DATABASE
2023-03-12 10:32:10,185 - database - INFO - postgres executing: snap run nextcloud.psql -U nextcloud -d postgres -c “GRANT CREATE ON SCHEMA public TO nextcloud;”
2023-03-12 10:32:10,222 - database - INFO - GRANT

In Folder.php line 166:

Could not create folder

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-space [DATABASE-TABLE-SPACE]] [–admin-user ADMIN-USER] [–admin-pass ADMIN-PASS] [–admin-email [ADMIN-EMAIL]] [–data-dir DATA-DIR]

2023-03-12 10:32:28,984 - nextcloud_occ - ERROR - occ error:
Traceback (most recent call last):
File “/snap/nextcloud/660/meta/hooks/configure”, line 7, in
Installer().configure()
File “/snap/nextcloud/660/hooks/installer.py”, line 107, in configure
self.initialize()
File “/snap/nextcloud/660/hooks/installer.py”, line 198, in initialize
self.occ.run(‘maintenance:install --database pgsql --database-host {0}:{1}’
File “/snap/nextcloud/660/hooks/octools.py”, line 19, in run
raise e
File “/snap/nextcloud/660/hooks/octools.py”, line 13, in run
output = check_output(‘{0} {1}’.format(self.occ_runner_path, args), shell=True).decode().strip()
File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “/snap/nextcloud/current/python/usr/local/lib/python3.8/subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘/snap/nextcloud/current/bin/occ-runner maintenance:install --database pgsql --database-host /var/snap/nextcloud/current/database:5436 --database-name nextcloud --database-user nextcloud --database-pass nextcloud --admin-user installer --admin-pass 171c05468df44d7892887c07eeff3a88 --data-dir /opt/disk/external/nextcloud’ returned non-zero exit status 1.
-----)

and I see in the log this error about no space on the device

Mar 12 10:32:27 syncloud Nextcloud[16141]: {“reqId”:“2EsoloYk7zqGMbOvLwXM”,“level”:3,“time”:“2023-03-12T10:32:27+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“PHP”,“method”:“”,“url”:“–”,“message”:“{"Exception":"Error","Message":"file_put_contents(): Write of 542 bytes failed with errno=28 No space left on device at /snap/nextcloud/660/nextcloud/lib/private/Setup.php#586","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[8,"file_put_contents(): Write of 542 bytes failed with errno=28 No space left on device","/snap/nextcloud/660/nextcloud/lib/private/Setup.php",586]},{"file":"/snap/nextcloud/660/nextcloud/lib/private/Setup.php","line":586,"function":"file_put_contents","args":["/opt/disk/external/nextcloud/.htaccess","# Generated by Nextcloud on 2023-03-12 10:32:27\n# Section for Apache 2.4 to 2.6\n\n Require all denied\n\n\n Order Allow,Deny\n Deny from all\n Satisfy All\n\n\n# Section for Apache 2.2\n<IfModule !mod_authz_core.c>\n <IfModule !mod_access_compat.c>\n \n Order Allow,Deny\n Deny from all\n \n Satisfy All\n \n\n\n# Section for Apache 2.2 to 2.6\n\n IndexIgnore \n"]},{"file":"/snap/nextcloud/660/nextcloud/lib/private/Setup.php","line":417,"function":"protectDataDirectory","class":"OC\\Setup","type":"::","args":[]},{"file":"/snap/nextcloud/660/nextcloud/core/Command/Maintenance/Install.php","line":105,"function":"install","class":"OC\\Setup","type":" → ","args":["** sensitive parameters replaced ***"]},{"file":"/snap/nextcloud/660/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Maintenance\\Install","type":" → ","args":[{"class":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"class":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/snap/nextcloud/660/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":" → ","args":[{"class":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"class":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/snap/nextcloud/660/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":" → ","args":[{"class":"OC\\Core\\Command\\Maintenance\\Install"},{"class":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"class":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/snap/nextcloud/660/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":" → ","args":[{"class":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"class":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/snap/nextcloud/660/nextcloud/lib/private/Console/Application.php","line":213,"function":"run","class":"Symfony\\Component\\Console\\Application","type":" → ","args":[{"class":"Symfony\\Component\\Console\\Input\\ArgvInput"},{"class":"Symfony\\Component\\Console\\Output\\ConsoleOutput"}]},{"file":"/snap/nextcloud/660/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":" → ","args":},{"file":"/snap/nextcloud/660/nextcloud/occ","line":11,"args":["/snap/nextcloud/660/nextcloud/console.php"],"function":"require_once"}],"File":"/snap/nextcloud/660/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"–"}”,“userAgent”:“–”,“version”:“25.0.2.3”}

df -h gives me the following

root@syncloud:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 12G 0 12G 0% /dev
tmpfs 2.4G 25M 2.4G 2% /run
/dev/sdc2 229G 69G 151G 32% /
tmpfs 12G 1.1M 12G 1% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 12G 0 12G 0% /sys/fs/cgroup
/dev/loop2 183M 183M 0 100% /snap/platform/1760
/dev/loop3 676M 676M 0 100% /snap/collabora/18
/dev/loop1 189M 189M 0 100% /snap/users/262
/dev/loop4 190M 190M 0 100% /snap/platform/1851
/dev/loop0 347M 347M 0 100% /snap/plex/136
/dev/loop6 129M 129M 0 100% /snap/plex/150
/dev/loop5 129M 129M 0 100% /snap/plex/154
/dev/loop7 510M 510M 0 100% /snap/mastodon/202
/dev/loop8 187M 187M 0 100% /snap/users/244
/dev/loop9 465M 465M 0 100% /snap/mastodon/179
/dev/loop10 263M 263M 0 100% /snap/syncthing/103
/dev/loop11 376M 376M 0 100% /snap/grocy/34
/dev/loop12 103M 103M 0 100% /snap/files/158
/dev/loop13 191M 191M 0 100% /snap/platform/1862
/dev/sdb1 459G 436G 0 100% /opt/disk/external

open to ideas

/dev/sdb1 459G 436G 0 100% /opt/disk/external

External disk is full.

ok i will figure out what is taking up space, but surprised by this, but valid.
wonder if there is any way a notification can be triggered on space

ok figure out the culprit Mastodon backups took up 200GB of space

Free space warning issue: warn about free disk space before installing apps · Issue #678 · syncloud/platform · GitHub

1 Like