Can't setup a Nextcloud server...

You are using UBOS on a Rasberry Pi. Please state which model you are using, e.g. Zero, Zero W, model 3 or such.
Post Reply
recrispi
Posts: 8
Joined: Wed Nov 03, 2021 12:21 am

Can't setup a Nextcloud server...

Post by recrispi »

Hello,

I'm trying to setup a local Nexcloud server with UBOS, but I get a problem with mysql server (or is it mariaDB?).
I followed all instructions in the UBOS webpage and got everything working. When I completer the ubos-admin createsite command I got the message "Cannot access MySQL database. File missing: /etc/mysql/root-defaults-ubos.cnf". In fact that file doesn't exist.
I tried the solution from the FAQ:

Code: Select all

sudo systemctl start mysqld.service
The result was:

Code: Select all

Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xeu mysqld.service" for details.
running those commands to geet more details I get the following results:

Code: Select all

journalctl -xeu mysqld.service
-- Journal begins at Sat 2021-10-30 22:10:06 UTC, ends at Tue 2021-11-02 23:48:06 UTC. --
-- No entries --

Code: Select all

systemctl status mysqld.service
× mysqld.service - MariaDB database server
     Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Tue 2021-11-02 23:48:06 UTC; 2min 35s ago
    Process: 6544 ExecStartPre=/usr/share/ubos-admin/bin/ubos-service-prestart mysqld (code=exited, status=0/SUCCESS)
    Process: 6545 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 6547 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 6555 ExecStartPre=/usr/bin/mysql_install_db --user=mysql --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/ubos/lib/mysql (code=exited, status=1/FAILURE)
    Process: 6618 ExecStopPost=/usr/share/ubos-admin/bin/ubos-service-poststop mysqld (code=exited, status=0/SUCCESS)
        CPU: 1.119s
Process 6555 seems to be failing, however I don't know why.

By the way, uname -a gives:

Code: Select all

Linux ubos-raspberry-pi2 5.10.42-1-ARCH #1 SMP Tue Jun 8 14:18:46 UTC 2021 armv7l GNU/Linux
My hardware is as follows:
  • Raspberry Pi 3B+ inside a PiDesktop from Element14
    UBOS running from a MicroSD card
    Seagate 4TB HDD with external energy supply (plugged to the wall socket)
    Ethernet cable
Thank you for any help you can give me to solve my problem.


j12t
Posts: 208
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

Re: Can't setup a Nextcloud server...

Post by j12t »

Try to create / deploy your site again (undeploy first). Sometimes this happens on a slow disk.

systemctl restart doesn't work yet, because some other configuration (including the one that creates the file you noticed is missing) has failed.
recrispi
Posts: 8
Joined: Wed Nov 03, 2021 12:21 am

Re: Can't setup a Nextcloud server...

Post by recrispi »

Hello,

Thank you for your suggestions. I undeployed all sites from my server (nextcloud was the only one) with the command:

Code: Select all

sudo ubos-admin undeploy --backuptofile backup.ubos-backup --all
Then I ran the command:

Code: Select all

sudo ubos-admin createsite
After choosing nextcloud and its accesories got all working up to the last part of the command:

Code: Select all

Next app to run (or leave empty when no more apps): 
Deploying...
DBI connect('host=localhost','root',...) failed: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/vendor_perl/UBOS/Databases/MySqlDriver.pm line 56.
ERROR: Cannot access MySQL database. File missing: /etc/mysql/root-defaults-ubos.cnf
and yes, when I look into the folder, there is no mysqld.sock in there:

Code: Select all

$ ls /run/mysqld/
$ 
I don't know what to do now.
Yo say this happens on a slow disk. Is there any way to tell the server to wait a little longer for the disk?
Thank you again.
j12t
Posts: 208
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

Re: Can't setup a Nextcloud server...

Post by j12t »

Can you do the same thing again, except that this time you run it "ubos-admin createsite -v -v" (with two -v) arguments, and post the entire output here? (This will be long.)
recrispi
Posts: 8
Joined: Wed Nov 03, 2021 12:21 am

Re: Can't setup a Nextcloud server...

Post by recrispi »

Hello,

Sure, here is all I did, starting with undeploying it first:

Code: Select all

$ sudo ubos-admin undeploy --backuptofile backup.ubos-backup --all
ERROR: Output file exists already. Use --force to overwrite.
$ sudo ubos-admin undeploy --backuptofile backup.ubos-backup --all --force
$ sudo ubos-admin createsite -v -v
INFO : ubos-admin createsite -v -v
First a few questions about the website that you are about to create:
Hostname (or * for any): *
Site admin user id (e.g. admin): admin
Site admin user name (e.g. John Doe): admin
Site admin user password (e.g. v3rys3cr3t): 
Repeat site admin user password: 
Site admin user e-mail (e.g. foo@bar.com): foo@bar.com
Now a few questions about the app(s) you are going to deploy to this site:
First app to run (or leave empty when no more apps): nextcloud
TRACE: ensurePackages nextcloud
TRACE: Exec: ( pacman -Q nextcloud > /dev/null 2>&1 )
TRACE: slurpFile( /etc/ubos/config.json )
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud.json )
TRACE: Checking manifest for nextcloud
App nextcloud suggests context path /nextcloud
Enter context path: /nextcloud
Any accessories for nextcloud? Enter list: nextcloud-audioplayer nextcloud-bookmarks nextcloud-bruteforcesettings nextcloud-cache-redis nextcloud-calendar nextcloud-extract nextcloud-files-fulltextsearch nextcloud-fulltextsearch nextcloud-group-everyone nextcloud-groupfolders nextcloud-markdown nextcloud-notes nextcloud-passwords nextcloud-tasks
TRACE: ensurePackages nextcloud-fulltextsearch nextcloud-bruteforcesettings nextcloud-passwords nextcloud-tasks nextcloud-groupfolders nextcloud-bookmarks nextcloud-group-everyone nextcloud-notes nextcloud-calendar nextcloud-cache-redis nextcloud-extract nextcloud-audioplayer nextcloud-files-fulltextsearch nextcloud-markdown
TRACE: Exec: ( pacman -Q nextcloud-fulltextsearch > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-bruteforcesettings > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-passwords > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-tasks > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-groupfolders > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-bookmarks > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-group-everyone > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-notes > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-calendar > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-cache-redis > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-extract > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-audioplayer > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-files-fulltextsearch > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q nextcloud-markdown > /dev/null 2>&1 )
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-fulltextsearch.json )
TRACE: Checking manifest for nextcloud-fulltextsearch
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-bruteforcesettings.json )
TRACE: Checking manifest for nextcloud-bruteforcesettings
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-passwords.json )
TRACE: Checking manifest for nextcloud-passwords
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-tasks.json )
TRACE: Checking manifest for nextcloud-tasks
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-groupfolders.json )
TRACE: Checking manifest for nextcloud-groupfolders
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-bookmarks.json )
TRACE: Checking manifest for nextcloud-bookmarks
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-group-everyone.json )
TRACE: Checking manifest for nextcloud-group-everyone
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-notes.json )
TRACE: Checking manifest for nextcloud-notes
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-calendar.json )
TRACE: Checking manifest for nextcloud-calendar
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-cache-redis.json )
TRACE: Checking manifest for nextcloud-cache-redis
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-extract.json )
TRACE: Checking manifest for nextcloud-extract
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-audioplayer.json )
TRACE: Checking manifest for nextcloud-audioplayer
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-files-fulltextsearch.json )
TRACE: Checking manifest for nextcloud-files-fulltextsearch
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-markdown.json )
TRACE: Checking manifest for nextcloud-markdown
Next app to run (or leave empty when no more apps): 
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud.json )
TRACE: Checking manifest for nextcloud
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-groupfolders.json )
TRACE: Checking manifest for nextcloud-groupfolders
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-bookmarks.json )
TRACE: Checking manifest for nextcloud-bookmarks
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-group-everyone.json )
TRACE: Checking manifest for nextcloud-group-everyone
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-passwords.json )
TRACE: Checking manifest for nextcloud-passwords
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-bruteforcesettings.json )
TRACE: Checking manifest for nextcloud-bruteforcesettings
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-fulltextsearch.json )
TRACE: Checking manifest for nextcloud-fulltextsearch
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-tasks.json )
TRACE: Checking manifest for nextcloud-tasks
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-markdown.json )
TRACE: Checking manifest for nextcloud-markdown
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-cache-redis.json )
TRACE: Checking manifest for nextcloud-cache-redis
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-notes.json )
TRACE: Checking manifest for nextcloud-notes
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-calendar.json )
TRACE: Checking manifest for nextcloud-calendar
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-audioplayer.json )
TRACE: Checking manifest for nextcloud-audioplayer
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-files-fulltextsearch.json )
TRACE: Checking manifest for nextcloud-files-fulltextsearch
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-extract.json )
TRACE: Checking manifest for nextcloud-extract
TRACE: ensurePackages php-gd php-systemd php-imagick php-redis php-apache smbclient php-apcu smtp-server
TRACE: Exec: ( pacman -Q php-gd > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q php-systemd > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q php-imagick > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q php-redis > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q php-apache > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q smbclient > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q php-apcu > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q smtp-server > /dev/null 2>&1 )
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: ensurePackages
TRACE: Site::_deployOrCheck 0 s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: apache2::setupSiteOrCheck apache2 0 s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: AppConfiguration::deployOrCheck 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a
TRACE: Role::deployOrCheck mysql 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud
TRACE: Database::deployOrCheck 0 /ubos/share/nextcloud <undef> mysql maindb
TRACE: ResourceManager::findProvisionedDatabaseFor mysql a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud maindb
TRACE: ResourceManager::_readCachesIfNeeded
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud nextcloud/$1 .user.ini 3rdparty apps core lib ocm-provider ocs ocs-provider resources themes AUTHORS console.php COPYING cron.php index.html index.php occ public.php remote.php robots.txt status.php version.php
TRACE: File::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud nextcloud/.htaccess .htaccess
TRACE: slurpFile( /ubos/share/nextcloud/nextcloud/.htaccess )
TRACE: Directory::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud data
TRACE: Directory::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud ${appconfig.datadir}
TRACE: Directory::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud ${appconfig.datadir}/data
TRACE: Directory::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud config
TRACE: File::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud tmpl/htaccess.tmpl ${appconfig.apache2.appconfigfragmentfile}
TRACE: slurpFile( /ubos/share/nextcloud/tmpl/htaccess.tmpl )
TRACE: Perlscript::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud bin/fix-permissions.pl
TRACE: File::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud tmpl/nextcloud@.service.tmpl /etc/systemd/system/nextcloud@${appconfig.appconfigid}.service
TRACE: slurpFile( /ubos/share/nextcloud/tmpl/nextcloud@.service.tmpl )
TRACE: AbstractSystemdItem::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud
TRACE: AbstractSystemdItem::deployOrCheck 0 /ubos/share/nextcloud /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-groupfolders
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-groupfolders
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-groupfolders /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/groupfolders apps/groupfolders
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-bookmarks
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-bookmarks
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-bookmarks /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/bookmarks apps/bookmarks
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-group-everyone
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-group-everyone
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-group-everyone /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/group_everyone apps/group_everyone
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-passwords
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-passwords
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-passwords /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/passwords apps/passwords
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-bruteforcesettings
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-bruteforcesettings
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-bruteforcesettings /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/bruteforcesettings apps/bruteforcesettings
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-fulltextsearch
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-fulltextsearch
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-fulltextsearch /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/fulltextsearch apps/fulltextsearch
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-tasks
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-tasks
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-tasks /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/tasks apps/tasks
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-markdown
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-markdown
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-markdown /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/files_markdown apps/files_markdown
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-cache-redis
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-cache-redis
TRACE: Directory::deployOrCheck 0 /ubos/share/nextcloud-cache-redis /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/lib/${package.name}/${appconfig.appconfigid}
TRACE: Directory::deployOrCheck 0 /ubos/share/nextcloud-cache-redis /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/lib/${package.name}/${appconfig.appconfigid}/redis
TRACE: File::deployOrCheck 0 /ubos/share/nextcloud-cache-redis /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud tmpl/${package.name}.conf.tmpl /etc/${package.name}/${package.name}-${appconfig.appconfigid}.conf
TRACE: slurpFile( /ubos/share/nextcloud-cache-redis/tmpl/nextcloud-cache-redis.conf.tmpl )
TRACE: AbstractSystemdItem::deployOrCheck 0 /ubos/share/nextcloud-cache-redis /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-notes
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-notes
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-notes /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/notes apps/notes
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-calendar
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-calendar
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-calendar /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/calendar apps/calendar
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-audioplayer
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-audioplayer
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-audioplayer /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/audioplayer apps/audioplayer
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-files-fulltextsearch
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-files-fulltextsearch
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-files-fulltextsearch /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/files_fulltextsearch apps/files_fulltextsearch
TRACE: apache2::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-extract
TRACE: Role::deployOrCheck apache2 0 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud-extract
TRACE: DirectoryTree::deployOrCheck 0 /ubos/share/nextcloud-extract /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/nextcloud /ubos/share/nextcloud/apps/extract apps/extract
Deploying...
INFO : Setting device state to: in maintenance
TRACE: invokeCallbacks( /etc/ubos/state-callbacks 1 stateChanged InMaintenance )
INFO : Setting up placeholder sites
TRACE: Site::setupPlaceholder s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud.json )
TRACE: Checking manifest for nextcloud
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-groupfolders.json )
TRACE: Checking manifest for nextcloud-groupfolders
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-bookmarks.json )
TRACE: Checking manifest for nextcloud-bookmarks
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-group-everyone.json )
TRACE: Checking manifest for nextcloud-group-everyone
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-passwords.json )
TRACE: Checking manifest for nextcloud-passwords
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-bruteforcesettings.json )
TRACE: Checking manifest for nextcloud-bruteforcesettings
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-fulltextsearch.json )
TRACE: Checking manifest for nextcloud-fulltextsearch
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-tasks.json )
TRACE: Checking manifest for nextcloud-tasks
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-markdown.json )
TRACE: Checking manifest for nextcloud-markdown
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-cache-redis.json )
TRACE: Checking manifest for nextcloud-cache-redis
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-notes.json )
TRACE: Checking manifest for nextcloud-notes
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-calendar.json )
TRACE: Checking manifest for nextcloud-calendar
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-audioplayer.json )
TRACE: Checking manifest for nextcloud-audioplayer
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-files-fulltextsearch.json )
TRACE: Checking manifest for nextcloud-files-fulltextsearch
TRACE: slurpFile( /ubos/lib/ubos/manifests/nextcloud-extract.json )
TRACE: Checking manifest for nextcloud-extract
TRACE: apache2::setupPlaceholderSite apache2 s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: saveFile-as-root-or-owner( /etc/httpd/defaultsites/any.conf 625 bytes, mask 644 , uid 0 , gid 0 0 )
TRACE: Host::executeTriggers: httpd-reload
TRACE: Exec: ( systemctl reload httpd.service ) >/tmp/RqyrCdMAzA 2>&1
TRACE: slurpFile( /tmp/RqyrCdMAzA )
TRACE: Detected Apache restart after  0.200601100921631 seconds
TRACE: Site s2f628148bacca5c2a5b54a4daf26872cca569d5b ->deploy
TRACE: Site::_deployOrCheck 1 s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: Host::siteDeploying s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: invokeCallbacks( /etc/ubos/hostname-callbacks 1 siteDeploying UBOS::Site=HASH(0x15fd1a8) )
TRACE: slurpFile( /etc/ubos/hostname-callbacks/etchosts )
TRACE: apache2::setupSiteOrCheck apache2 1 s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: Creating directory /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: Symlink /srv/http/_errors /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/_errors
TRACE: Symlink /srv/http/_common /ubos/http/sites/s2f628148bacca5c2a5b54a4daf26872cca569d5b/_common
TRACE: apache2::setupSite s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: Creating directory /ubos/http/wellknown/s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: Creating directory /ubos/http/wellknown/s2f628148bacca5c2a5b54a4daf26872cca569d5b/.well-known
TRACE: Creating directory /etc/httpd/appconfigs/s2f628148bacca5c2a5b54a4daf26872cca569d5b
TRACE: AppConfiguration::deployOrCheck 1 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a
TRACE: Creating directory /ubos/lib/ubos/appconfigpars/a9983b61b970190f52e4b80e5648d9a0ed9f15b2a
TRACE: Creating directory /ubos/lib/ubos/appconfigpars/a9983b61b970190f52e4b80e5648d9a0ed9f15b2a/nextcloud
TRACE: saveFile-as-root-or-owner( /ubos/lib/ubos/appconfigpars/a9983b61b970190f52e4b80e5648d9a0ed9f15b2a/nextcloud/upload_max_filesize_mb 3 bytes, mask 644 , uid 0 , gid 0 0 )
TRACE: saveFile-as-root-or-owner( /ubos/lib/ubos/appconfigpars/a9983b61b970190f52e4b80e5648d9a0ed9f15b2a/nextcloud/memory_limit_mb 3 bytes, mask 644 , uid 0 , gid 0 0 )
TRACE: Role::deployOrCheck mysql 1 a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud
TRACE: Role::deployOrCheck a9983b61b970190f52e4b80e5648d9a0ed9f15b2a 0
TRACE: Database::deployOrCheck 1 /ubos/share/nextcloud <undef> mysql maindb
TRACE: ResourceManager::findProvisionedDatabaseFor mysql a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud maindb
TRACE: ResourceManager::provisionLocalDatabase mysql a9983b61b970190f52e4b80e5648d9a0ed9f15b2a nextcloud maindb all privileges utf8mb4 <undef>
TRACE: MySqlDriver::provisionLocalDatabase xaqsnmsjogxukfhu YWa7PCMVMWKSEzls <pass> simple-password all privileges utf8mb4 utf8mb4_general_ci
TRACE: MySqlDriver::ensureRunning 0
TRACE: ensurePackages mariadb perl-dbd-mysql
TRACE: Exec: ( pacman -Q mariadb > /dev/null 2>&1 )
TRACE: Exec: ( pacman -Q perl-dbd-mysql > /dev/null 2>&1 )
TRACE: Exec: ( chattr +C /ubos/lib/mysql 2> /dev/null )
TRACE: Exec: ( systemctl is-enabled mysqld > /dev/null || systemctl enable mysqld ) >/tmp/hvR48LzEXt 2>/tmp/7694PHaj5M
TRACE: slurpFile( /tmp/hvR48LzEXt )
TRACE: slurpFile( /tmp/7694PHaj5M )
TRACE: Exec: ( systemctl is-active  mysqld > /dev/null || systemctl start  mysqld ) >/tmp/QhwnIkPtTu 2>/tmp/nFdUIxBQ8i
TRACE: slurpFile( /tmp/QhwnIkPtTu )
TRACE: slurpFile( /tmp/nFdUIxBQ8i )
DBI connect('host=localhost','root',...) failed: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/vendor_perl/UBOS/Databases/MySqlDriver.pm line 56.
Cannot access MySQL database. File missing: /etc/mysql/root-defaults-ubos.cnf at /usr/share/perl5/vendor_perl/UBOS/Logging.pm line 176.
	UBOS::Logging::fatal("Cannot access MySQL database. File missing:", "/etc/mysql/root-defaults-ubos.cnf") called at /usr/share/perl5/vendor_perl/UBOS/Databases/MySqlDriver.pm line 213
	UBOS::Databases::MySqlDriver::findRootUserPass() called at /usr/share/perl5/vendor_perl/UBOS/Databases/MySqlDriver.pm line 154
	UBOS::Databases::MySqlDriver::dbConnectAsRoot(undef, "a9983b61b970190f52e4b80e5648d9a0ed9f15b2a / nextcloud / maindb") called at /usr/share/perl5/vendor_perl/UBOS/Databases/MySqlDriver.pm line 301
	UBOS::Databases::MySqlDriver::provisionLocalDatabase(UBOS::Databases::MySqlDriver=HASH(0x16373f8), "xaqsnmsjogxukfhu", "YWa7PCMVMWKSEzls", "eLEWcuktg6IcIcaG", "simple-password", "all privileges", "utf8mb4", undef, ...) called at /usr/share/perl5/vendor_perl/UBOS/ResourceManager.pm line 129
	UBOS::ResourceManager::provisionLocalDatabase("mysql", "a9983b61b970190f52e4b80e5648d9a0ed9f15b2a", "nextcloud", "maindb", "all privileges", "utf8mb4", undef) called at /usr/share/perl5/vendor_perl/UBOS/AppConfigurationItems/Database.pm line 79
	UBOS::AppConfigurationItems::Database::deployOrCheck(UBOS::AppConfigurationItems::Database=HASH(0x1637358), 1, "/ubos/share/nextcloud", undef, UBOS::Variables=HASH(0x1636de8)) called at /usr/share/perl5/vendor_perl/UBOS/Role.pm line 115
	UBOS::Role::deployOrCheck(UBOS::Roles::mysql=HASH(0x160a160), 1, UBOS::AppConfiguration=HASH(0x16184e8), UBOS::App=HASH(0x1618558), UBOS::Variables=HASH(0x1636de8)) called at /usr/share/perl5/vendor_perl/UBOS/AppConfiguration.pm line 365
	UBOS::AppConfiguration::deployOrCheck(UBOS::AppConfiguration=HASH(0x16184e8), 1, HASH(0x162f6e8)) called at /usr/share/perl5/vendor_perl/UBOS/Site.pm line 851
	UBOS::Site::_deployOrCheck(UBOS::Site=HASH(0x15fd1a8), 1, HASH(0x162f6e8)) called at /usr/share/perl5/vendor_perl/UBOS/Site.pm line 801
	UBOS::Site::deploy(UBOS::Site=HASH(0x15fd1a8), HASH(0x162f6e8)) called at /usr/share/perl5/vendor_perl/UBOS/Commands/Createsite.pm line 774
	UBOS::Commands::Createsite::run("createsite", "-v", "-v") called at /usr/share/perl5/vendor_perl/UBOS/Utils.pm line 1540
	UBOS::Utils::invokeMethod("UBOS::Commands::Createsite::run", "createsite", "-v", "-v") called at /usr/bin/ubos-admin line 54
INFO : Setting device state to: operational
TRACE: invokeCallbacks( /etc/ubos/state-callbacks 1 stateChanged Operational )
$
Thank you.
j12t
Posts: 208
Joined: Tue Dec 12, 2017 9:17 pm
Contact:

Re: Can't setup a Nextcloud server...

Post by j12t »

Not entirely clear how you got into this state. But based on some testing, this is how you should be able to get out of it.

This assumes you have no valuable data in your database. ALL MYSQL DATA WILL BE DELETED.

As root:

Code: Select all

ubos-admin undeploy --all
systemctl stop mysqld
pacman -R mariadb
rm -rf /ubos/lib/mysqld
Then redeploy with "ubos-admin createsite" or "ubos-admin deploy".

If this doesn't work, it may be simpler to restart with a clean image.
recrispi
Posts: 8
Joined: Wed Nov 03, 2021 12:21 am

Re: Can't setup a Nextcloud server...

Post by recrispi »

Hello,
Not entirely clear how you got into this state
Well I don't know either :lol:
Don't worry, I still have no data in the system, just starting from scratch, so no problem deleting everything.
I tried what you suggested and I leave here the results as reference. In summary, it didn't work :cry:
Now I will do as you suggested, to restart with a clean image.
Thank you very much.

Code: Select all

$ sudo su
[root]# ubos-admin undeploy --all
[root]# systemctl stop mysqld
[root]# pacman -R mariadb
checking dependencies...

Packages (1) mariadb-10.5.10-1.2

Total Removed Size:  196.36 MiB

:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing mariadb                             [####################] 100%
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
(2/2) Arming ConditionNeedsUpdate...
[root]# rm -rf /ubos/lib/mysql/
[root]# ubos-admin createsite
First a few questions about the website that you are about to create:
Hostname (or * for any): *
Site admin user id (e.g. admin): admin
Site admin user name (e.g. John Doe): admin
Site admin user password (e.g. v3rys3cr3t): 
Repeat site admin user password: 
Site admin user e-mail (e.g. foo@bar.com): foo@bar.com
Now a few questions about the app(s) you are going to deploy to this site:
First app to run (or leave empty when no more apps): nextcloud
App nextcloud suggests context path /nextcloud
Enter context path: /nextcloud
Any accessories for nextcloud? Enter list: nextcloud-audioplayer nextcloud-bookmarks nextcloud-bruteforcesettings nextcloud-cache-redis nextcloud-calendar nextcloud-extract nextcloud-files-fulltextsearch nextcloud-fulltextsearch nextcloud-group-everyone nextcloud-groupfolders nextcloud-markdown nextcloud-notes nextcloud-passwords nextcloud-tasks
Next app to run (or leave empty when no more apps): 
Deploying...
DBI connect('host=localhost','root',...) failed: Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2) at /usr/share/perl5/vendor_perl/UBOS/Databases/MySqlDriver.pm line 56.
ERROR: Cannot access MySQL database. File missing: /etc/mysql/root-defaults-ubos.cnf
[root]#
recrispi
Posts: 8
Joined: Wed Nov 03, 2021 12:21 am

Re: Can't setup a Nextcloud server...

Post by recrispi »

Hello,

After restarting with a fresh image and solving my "unrebootable" problem from the other thread, I configured my HDD and when trying to createsite I got another problem :cry:

Code: Select all

$ sudo snapper -c ubos create-config -t ubos-default /ubos
Creating config failed (creating btrfs subvolume .snapshots failed since it already exists).
[shepherd@ubos-raspberry-pi2 ~]$ sudo ubos-admin createsite
ERROR: Required service ubos-ready has failed. Attempting to restart. Try invoking your command again in a little while.
Job for ubos-ready.service failed because the control process exited with error code.
See "systemctl status ubos-ready.service" and "journalctl -xeu ubos-ready.service" for details.
$
The status command is:

Code: Select all

$ sudo systemctl status ubos-ready.service
× ubos-ready.service - UBOS ready actions
     Loaded: loaded (/usr/lib/systemd/system/ubos-ready.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Thu 2021-11-18 00:40:38 UTC; 7min ago
    Process: 640 ExecStartPre=/usr/share/ubos-admin/bin/ubos-service-prestart ubos-ready (code=exited, status=0/SUCCESS)
    Process: 641 ExecStart=/usr/share/ubos-admin/bin/ubos-ready (code=exited, status=1/FAILURE)
    Process: 659 ExecStopPost=/usr/share/ubos-admin/bin/ubos-service-poststop ubos-ready (code=exited, status=0/SUCCESS)
   Main PID: 641 (code=exited, status=1/FAILURE)
        CPU: 1.604s

Nov 18 00:40:38 ubos-raspberry-pi2 ubos-ready[641]: ERROR: snapper (create-config) failed for config ubos /ubos Creating config failed (creating btrfs subvolume .snapshots failed since it already exists).
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-admin[641]: snapper (create-config) failed for config ubos /ubos Creating config failed (creating btrfs subvolume .snapshots failed since it already exists).
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-ready[641]: ERROR: snapper --config 'ubos' setup-quota failed: Unknown config.
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-admin[641]: snapper --config 'ubos' setup-quota failed: Unknown config.
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-admin[641]: Setting device state to: operational
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: ubos-ready.service: Main process exited, code=exited, status=1/FAILURE
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-ready[659]: Stopping ubos-ready.service
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: ubos-ready.service: Failed with result 'exit-code'.
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: Failed to start UBOS ready actions.
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: ubos-ready.service: Consumed 1.604s CPU time.
$
And here is an extract of the journalctl command:

Code: Select all

$ sudo journalctl -xeu ubos-ready.service
Nov 18 00:40:36 ubos-raspberry-pi2 systemd[1]: Starting UBOS ready actions...
░░ Subject: A start job for unit ubos-ready.service has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit ubos-ready.service has begun execution.
░░ 
░░ The job identifier is 684.
Nov 18 00:40:37 ubos-raspberry-pi2 ubos-ready[640]: Starting ubos-ready.service
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-ready[641]: ERROR: snapper (create-config) failed for config ubos /ubos Creating config failed (creating btrfs subvolume .snapshots failed since it already exists).
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-admin[641]: snapper (create-config) failed for config ubos /ubos Creating config failed (creating btrfs subvolume .snapshots failed since it already exists).
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-ready[641]: ERROR: snapper --config 'ubos' setup-quota failed: Unknown config.
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-admin[641]: snapper --config 'ubos' setup-quota failed: Unknown config.
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-admin[641]: Setting device state to: operational
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: ubos-ready.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit ubos-ready.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
Nov 18 00:40:38 ubos-raspberry-pi2 ubos-ready[659]: Stopping ubos-ready.service
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: ubos-ready.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit ubos-ready.service has entered the 'failed' state with result 'exit-code'.
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: Failed to start UBOS ready actions.
░░ Subject: A start job for unit ubos-ready.service has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ A start job for unit ubos-ready.service has finished with a failure.
░░ 
░░ The job identifier is 684 and the job result is failed.
Nov 18 00:40:38 ubos-raspberry-pi2 systemd[1]: ubos-ready.service: Consumed 1.604s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit ubos-ready.service completed and consumed the indicated resources.
The file read at process 641 is here:

Code: Select all

$ cat /usr/share/ubos-admin/bin/ubos-ready 
#!/usr/bin/perl
#
# Invoked when ubos-ready.service is started
#
# Copyright (C) 2014 and later, Indie Computing Corp. All rights reserved. License: see package.
#

use strict;
use warnings;

use UBOS::Host;
use UBOS::Logging;
use UBOS::StaffManager;

UBOS::Logging::initialize( 'ubos-admin', 'ubos-ready', 0, '/etc/ubos/log-system.conf' );

my $errors = UBOS::Host::ensureSnapperConfig();
$errors += UBOS::Host::runAfterBootCommandsIfNeeded();
$errors += UBOS::StaffManager::performBootActions();

UBOS::Host::setState( 'Operational' );

if( $errors ) {
    exit( 1 );
} else {
    exit( 0 );
}

1;
$
I don't know if anything of what I pasted is useful. I hope so.
Thank you.
Post Reply