Help please to install NCP on Armbian (Cubietruck)

Hello, I have Cubieboard with sata hdd (Alwinner A20, 2Gb RAM).
Iā€™m trying to install NextCloud on Armbian Stretch , using armbian-config.
It fails on installation:

Reading state informationā€¦ Done

ca-certificates is already the newest version (20161130+nmu1+deb9u1).
sudo is already the newest version (1.8.19p1-2.1).
wget is already the newest version (1.18-5+deb9u3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
/tmp/nextcloudpi.2y1pVz /home/ubuser
/home/ubuser

Installing NextCloudPiā€¦
ERROR: distro not supported:
Debian GNU/Linux 9 \n \l

So, is this impossible now?
Ok, Iā€™ve installed Armbian Buster.
On Armbian Buster install process lasts for a long time and finishes with some errors:

Setting up dphys-swapfile (20100506-5) ā€¦
Job for dphys-swapfile.service failed because the control process exited with error code.
See ā€œsystemctl status dphys-swapfile.serviceā€ and ā€œjournalctl -xeā€ for details.
invoke-rc.d: initscript dphys-swapfile, action ā€œstartā€ failed.
** dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file*
Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-09-18 14:05:31 MSK; 104ms ago
Docs: man:dphys-swapfile(8)
Process: 651 ExecStart=/sbin/dphys-swapfile setup (code=exited, status=0/SUCCESS)

  • Process: 683 ExecStart=/sbin/dphys-swapfile swapon (code=exited, status=255/EXCEPTION)*
    Main PID: 683 (code=exited, status=255/EXCEPTION)

Sep 18 14:05:31 cubietruck systemd[1]: Starting dphys-swapfile - set up, mount/unmount, and delete a swap fileā€¦
Sep 18 14:05:31 cubietruck dphys-swapfile[651]: computing size, want /var/swap=4040MByte, restricting to config limit: 2048MBytes, generating swapfile ā€¦ of 2048MBytes
Sep 18 14:05:31 cubietruck dphys-swapfile[683]: swapon: /var/swap: swapon failed: Invalid argument
Sep 18 14:05:31 cubietruck systemd[1]: dphys-swapfile.service: Main process exited, code=exited, status=255/EXCEPTION
Sep 18 14:05:31 cubietruck systemd[1]: dphys-swapfile.service: Failed with result ā€˜exit-codeā€™.
Sep 18 14:05:31 cubietruck systemd[1]: Failed to start dphys-swapfile - set up, mount/unmount, and delete a swap file.
dpkg: error processing package dphys-swapfile (ā€“configure):
installed dphys-swapfile package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.8.5-2) ā€¦
Processing triggers for systemd (241-7~deb10u1) ā€¦
Errors were encountered while processing:
dphys-swapfile
E: Sub-process /usr/bin/dpkg returned an error code (1)
Running nc-init
Setting up a clean Nextcloud instanceā€¦ wait until message ā€˜NC init doneā€™
Setting up databaseā€¦
Setting up Nextcloudā€¦
Nextcloud was successfully installed
Set mode for background jobs to ā€˜cronā€™
System config value tempdirectory set to string /var/www/nextcloud/data/tmp
System config value mysql.utf8mb4 set to boolean true
System config value trusted_domains => 11 set to string 178.57.XX.XX
System config value trusted_domains => 1 set to string 178.57.XX.XX
System config value trusted_domains => 5 set to string nextcloudpi.local
System config value trusted_domains => 7 set to string nextcloudpi
System config value trusted_domains => 8 set to string nextcloudpi.lan
System config value mail_smtpmode set to string sendmail
System config value mail_smtpauthtype set to string LOGIN
System config value mail_from_address set to string admin
System config value mail_domain set to string ownyourbits.com
cp: cannot stat ā€˜/var/www/ncp-appā€™: No such file or directory

I do not know if these are critical errors or not. I have activated 4GB swap partition /dev/sda2 on the hard drive in /etc/fstab.

The final status is ā€œNextcloud was successfully installedā€, but http://ip or http://ip/nextcloud redirects to https and shows ā€œNot Found. The requested URL / was not found on this server.ā€

I donā€™t know what to do next, help please.

Stretch is no longer supported by the NCP installer.
It needs Buster

Is causing the critical dphys-swapfile error, it can not be enabled because swap is already on.
To fix it you can

  • disable swap (sudo swapoff)
  • format your 4GB /dev/sda2 partion to ext4 fs (I use fdisk and mkfs.ext4)
  • create mountpoint for swap, example /media/swap
  • edit fstab to mount sda2 as ext4 to /media/swap
  • edit /etc/dphys-swapfile to uncomment/edit CONF_SWAPFILE=/media/swap/swap
  • sudo mount -a
  • run installer again

Ok, that helped me, thanks.
I have reinstalled Armbian Buster, formatted /dev/sda2 to ext4, edited config of dphys-swapfile - everything was ok.
I started the installer again and got some other errors:

exfat-utils is already the newest version (1.3.0-1).
exfat-fuse is already the newest version (1.3.0-1).
php-smbclient is already the newest version (0.9.0-3+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package listsā€¦ 0%
Reading package listsā€¦ 100%
Reading package listsā€¦ Done
Building dependency treeā€¦ 0%
Building dependency treeā€¦ 0%
Building dependency treeā€¦ 50%
Building dependency treeā€¦ 50%
Building dependency tree
Reading state informationā€¦ 0%
Reading state informationā€¦ 0%
Reading state informationā€¦ Done
lsb-release is already the newest version (10.2019051400).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Nextcloud is not installed - only a limited number of commands are available

There are no commands defined in the ā€œconfig:appā€ namespace.

Running nc-init
Setting up a clean Nextcloud instanceā€¦ wait until message ā€˜NC init doneā€™
Setting up databaseā€¦
Setting up Nextcloudā€¦
Nextcloud was successfully installed
Set mode for background jobs to ā€˜cronā€™
System config value tempdirectory set to string /var/www/nextcloud/data/tmp
System config value mysql.utf8mb4 set to boolean true
System config value trusted_domains => 11 set to string 178.57.XX.XX
System config value trusted_domains => 1 set to string 178.57.XX.XX
System config value trusted_domains => 5 set to string nextcloudpi.local
System config value trusted_domains => 7 set to string nextcloudpi
System config value trusted_domains => 8 set to string nextcloudpi.lan
System config value mail_smtpmode set to string sendmail
System config value mail_smtpauthtype set to string LOGIN
System config value mail_from_address set to string admin
System config value mail_domain set to string
nextcloudpi enabled
calendar installed
calendar enabled
contacts installed
contacts enabled
notes installed
notes enabled
tasks installed
tasks enabled
news installed
news enabled
previewgenerator installed
previewgenerator enabled
calendar enabled
contacts enabled
notes enabled
tasks enabled
news enabled
previewgenerator enabled
Config value squareSizes for app previewgenerator set to 32 256
Config value widthSizes for app previewgenerator set to 256 384
Config value heightSizes for app previewgenerator set to 256
System config value preview_max_x set to string 2048
System config value preview_max_y set to string 2048
System config value jpeg_quality set to string 60
Config value jpeg_quality for app preview set to 60
System config value overwriteprotocol set to string https
All tables already up to date!
NC init done
Provisioning Redis password
Updating NextCloud config with Redis password
Provisioning MariaDB password
Updating NextCloud config with MariaDB password
Running nc-limits
Using 1580866560B for PHP
Using 3 PHP threads
Using 843128832 memory for the database
/home/ubuser
Done.

First: Visit https://178.57.XX.XX/
to activate your instance of NC, and save the auto generated passwords. You may review or reset them
anytime by using nc-admin and nc-passwd.
Second: Type ā€˜sudo ncp-configā€™ to further configure NCP, or access ncp-web on https://178.57.XX.XX:4443/
Note: You will have to add an exception, to bypass your browser warning when you
first load the activation and :4443 pages. You can run letsencrypt to get rid of
the warning if you have a (sub)domain available.

The links https://178.57.XX.XX/ or https://178.57.XX.XX/nextcloud are not working - "Forbidden You donā€™t have permission to access /nextcloud on this server. "
I tried to enter command chown -R www-data:www-data /var/www/nextcloud with no luck, nothing has changed.
Help, please.

And ncp-config is not working too.

root@ncp:/var/www# ncp-config
cat: /usr/local/etc/ncp-version: No such file or directory
cat: /usr/local/etc/ncp-version: No such file or directory

As output stated:
You will have to add an exception, to bypass your browser warning when you
first load the activation and :4443 pages.

You should not (have to) use chown, ncpā€™s installer takes care of that.

Just add exceptions, to bypass the browser warnings.

Try rebooting and/or check /usr/local/bin/ for ncp-config 's presence.

Might not be in rootā€™s PATH, if so, you can use full path to run it.

/usr/local/bin/ncp-config

If still not up and activated, would help if shared output of ncp-report via pastebin or similar.

1 Like

seemed like it installed ok, just access with your browser to your IP (no /nextcloud)

The only one warning was in the browser, itā€™s about untrusted (self-signed) certificate, so I accepted it and got Forbidden You donā€™t have permission to access / on this server.

Yes, itā€™s there: /usr/local/bin/ncp-config
I rebooted board and started ncp-config , it works. I changed ncp admin password, clicked ā€œsaveā€ and got this:

Running nc-admin
An unhandled exception has been thrown:
RedisException: Redis server went away in /var/www/nextcloud/lib/private/Memcache/Redis.php:54
Stack trace:
#0 /var/www/nextcloud/lib/private/Memcache/Redis.php(54): Redis->get(ā€˜2d14a50bb4b8171ā€¦ā€™)
#1 /var/www/nextcloud/lib/private/App/InfoParser.php(57): OC\Memcache\Redis->get(ā€˜/var/www/nextclā€¦ā€™)
#2 /var/www/nextcloud/lib/private/App/AppManager.php(381): OC\App\InfoParser->parse(ā€˜/var/www/nextclā€¦ā€™)
#3 /var/www/nextcloud/lib/private/legacy/app.php(552): OC\App\AppManager->getAppInfo(ā€˜filesā€™, false, NULL)
#4 /var/www/nextcloud/lib/private/AppFramework/App.php(66): OC_App::getAppInfo(ā€˜filesā€™)
#5 /var/www/nextcloud/lib/private/legacy/app.php(237): OC\AppFramework\App::buildAppNamespace(ā€˜filesā€™)
#6 /var/www/nextcloud/lib/private/legacy/app.php(120): OC_App::registerAutoloading(ā€˜filesā€™, ā€˜/var/www/nextclā€¦ā€™)
#7 /var/www/nextcloud/lib/base.php(640): OC_App::loadApps(Array)
#8 /var/www/nextcloud/lib/base.php(1056): OC::init()
#9 /var/www/nextcloud/console.php(46): require_once(ā€˜/var/www/nextclā€¦ā€™)
#10 /var/www/nextcloud/occ(11): require_once(ā€˜/var/www/nextclā€¦ā€™)
#11 {main}Done. Press any keyā€¦

Then I found nc-init and ran it:

Running nc-init
Setting up a clean Nextcloud instanceā€¦ wait until message ā€˜NC init doneā€™
Setting up databaseā€¦

*** FATAL CONFIG FILE ERROR ***
Reading the configuration file, at line 171

ā€˜logfile /var/log/redis/redis-server.logā€™
Canā€™t open the log file: No such file or directory

No difference.
Both links https://178.57.XX.XX/ or https://178.57.XX.XX/nextcloud are not working - "Forbidden You donā€™t have permission to access / on this server. "

I have several messages [FAILED] Failed to start Advanced key-value store during boot process. I googled and this means that redis-server does not work.
So, I tried to remove it and install again:
sudo apt-get --purge remove redis-server
sudo apt-get update
sudo apt-get install redis-server

Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
The following NEW packages will be installed:
redis-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/78.4 kB of archives.
After this operation, 160 kB of additional disk space will be used.
Selecting previously unselected package redis-server.
(Reading database ā€¦ 41993 files and directories currently installed.)
Preparing to unpack ā€¦/redis-server_5%3a5.0.3-4+deb10u1_armhf.deb ā€¦
Unpacking redis-server (5:5.0.3-4+deb10u1) ā€¦
Setting up redis-server (5:5.0.3-4+deb10u1) ā€¦
Created symlink /etc/systemd/system/redis.service ā†’ /lib/systemd/system/redis-server.service.
Created symlink /etc/systemd/system/multi-user.target.wants/redis-server.service ā†’ /lib/systemd/system/redis-server.service.
Job for redis-server.service failed because the control process exited with error code.
See ā€œsystemctl status redis-server.serviceā€ and ā€œjournalctl -xeā€ for details.
Processing triggers for man-db (2.8.5-2) ā€¦
Processing triggers for systemd (241-7~deb10u1) ā€¦

systemctl status redis-server.service

redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-09-23 11:32:37 MSK; 4min 24s ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 4746 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)

Sep 23 11:32:37 systemd[1]: redis-server.service: Service RestartSec=100ms expired, scheduling restart.
Sep 23 11:32:37 systemd[1]: redis-server.service: Scheduled restart job, restart counter is at 8.
Sep 23 11:32:37 systemd[1]: Stopped Advanced key-value store.
Sep 23 11:32:37 systemd[1]: redis-server.service: Start request repeated too quickly.
Sep 23 11:32:37 systemd[1]: redis-server.service: Failed with result ā€˜exit-codeā€™.
Sep 23 11:32:37 systemd[1]: Failed to start Advanced key-value store.

No luck.

If I manually run /usr/bin/redis-server /etc/redis/redis.conf, Redis starts up fine.
I ran nc-nextcloud (in ncp-config menu) and reinstalled NextCloud. Ran nc-init.
Nothing has changed :frowning:

what is the filesystem for /var? (lsblk -f)

ubuser@ncp:~$ lsblk -f
NAME        FSTYPE LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINT
sda
|-sda1      btrfs        205e751b-42a8-4e5c-8323-f457d2a52117  141.5G     1% /
`-sda2      ext4         5a341906-2513-4eca-9d6c-60363436d010    2.1G    46% /media/swap
mmcblk0
`-mmcblk0p1 ext4         374c768a-5616-4beb-9b10-5ba32c8e80c6    6.2G    13% /media/mmcboot
zram0                                                           33.6M    23% /var/log
zram1                                                                        [SWAP]
ubuser@ncp:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            938M     0  938M   0% /dev
tmpfs           202M   22M  180M  11% /run
/dev/sda1       145G  1.3G  142G   1% /
tmpfs          1006M     0 1006M   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs          1006M     0 1006M   0% /sys/fs/cgroup
tmpfs          1006M  4.0K 1006M   1% /tmp
/dev/mmcblk0p1  7.2G  950M  6.2G  14% /media/mmcboot
/dev/sda2       4.4G  2.1G  2.2G  49% /media/swap
/dev/zram0       49M   12M   34M  25% /var/log
tmpfs           202M     0  202M   0% /run/user/1000

ubuser@ncp:~$ df -h -T
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  938M     0  938M   0% /dev
tmpfs          tmpfs     202M   22M  180M  11% /run
/dev/sda1      btrfs     145G  1.3G  142G   1% /
tmpfs          tmpfs    1006M     0 1006M   0% /dev/shm
tmpfs          tmpfs     5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs    1006M     0 1006M   0% /sys/fs/cgroup
tmpfs          tmpfs    1006M  4.0K 1006M   1% /tmp
/dev/mmcblk0p1 ext4      7.2G  950M  6.2G  14% /media/mmcboot
/dev/sda2      ext4      4.4G  2.1G  2.2G  49% /media/swap
/dev/zram0     ext4       49M   12M   34M  25% /var/log
tmpfs          tmpfs     202M     0  202M   0% /run/user/1000

ubuser@ncp:~$ df -h -T /var
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/sda1      btrfs  145G  1.3G  142G   1% /

This problem lingers. I am trying to install nextcloudpi on an Odroid HC-2, both via the armbian-config and the curl method. Here follows the output from the curl method:

WARNING: existing mysqld configuration will be changed <<<
Getting build code...
Hit:2 http://httpredir.debian.org/debian buster InRelease                              
Hit:3 http://httpredir.debian.org/debian buster-updates InRelease                      
Hit:4 http://httpredir.debian.org/debian buster-backports InRelease                    
Hit:5 http://security.debian.org buster/updates InRelease                                                    
Hit:1 https://apt.armbian.com buster InRelease                                                               
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ca-certificates is already the newest version (20190110).
lsb-release is already the newest version (10.2019051400).
sudo is already the newest version (1.8.27-1+deb10u2).
wget is already the newest version (1.20.1-1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up dphys-swapfile (20100506-5) ...
Job for dphys-swapfile.service failed because the control process exited with error code.
See "systemctl status dphys-swapfile.service" and "journalctl -xe" for details.
invoke-rc.d: initscript dphys-swapfile, action "start" failed.
ā— dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file
   Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2020-03-03 10:14:58 UTC; 45ms ago
     Docs: man:dphys-swapfile(8)
  Process: 3361 ExecStart=/sbin/dphys-swapfile setup (code=exited, status=1/FAILURE)
 Main PID: 3361 (code=exited, status=1/FAILURE)

Mar 03 10:14:58 odroidxu4 systemd[1]: Starting dphys-swapfile - set up, mount/unmount, and delete a swap file...
Mar 03 10:14:58 odroidxu4 dphys-swapfile[3361]: computing size, want /media/swap=4006MByte, generating swapfile ...
Mar 03 10:14:58 odroidxu4 systemd[1]: dphys-swapfile.service: Main process exited, code=exited, status=1/FAILURE
Mar 03 10:14:58 odroidxu4 systemd[1]: dphys-swapfile.service: Failed with result 'exit-code'.
Mar 03 10:14:58 odroidxu4 systemd[1]: Failed to start dphys-swapfile - set up, mount/unmount, and delete a swap file.
dpkg: error processing package dphys-swapfile (--configure):
 installed dphys-swapfile package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 dphys-swapfile
E: Sub-process /usr/bin/dpkg returned an error code (1)

journalctl -xe gives about the same output as above. Here is the output from lsblk -f. I have tried to overcome the swap error by making a swap partition in addition to the zram.

NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
ā”œā”€sda1 btrfs c490d975-f758-41d9-b5f7-d30c71c2aafd 3.6T 0% /
ā””ā”€sda2 swap 82ca1009-7e3d-4bb8-bddc-f51d214b22ed [SWAP]
mmcblk0
ā””ā”€mmcblk0p1 ext4 289c15a6-61a0-405f-b66e-6b7b13c350ef 13.2G 5% /media/mmcboot
zram0 41.3M 8% /var/log
zram1 [SWAP]

This happened to me before,
I disabled swap, format the swap partition to ext4, mount it, use the space for a dphys-swapfile. Manually set and enable dphys, and run ncp installer again.

@OliverV Thanks, but no luck. I followed your tips, issued sudo swapoff -a and made a new ext4 partition mounted as /media/swap, and added it to /etc/fstab with its UUID. I issued sudo mount -a to confirm that it mounted. Then i edited /etc/dphys-swapfile to point to /media/swap and use it all (6GB). Output from dphys-swapfile setup as root:

dphys-swapfile setup
computing size, want /media/swap=6009MByte, generating swapfile ā€¦

Output from dphys-swapfile swapon as root:

dphys-swapfile swapon
/sbin/dphys-swapfile: ERROR: swap file /media/swap missing! you need to first run /sbin/dphys-swapfile setup to generate one

So here it complains that there is no swap file after I just tried to generate it. The generation process is very fast, so I suspect nothing has happened, but canā€™t find any log or indication of it.

edit
/etc/dphys-swapfile

CONF_SWAPFILE=/media/swap/swap

and run dphys-swap setup again
/media/swap being the mountpoint, the swap file will be inside it.

1 Like

@OliverV You are right, thank you. dphys-swap setup generated a swap file of half the size of the partition. I was able to start the Nextcloudpi installation again, this time (so far) without errors.

Again, thank you for your help. Of course, this error should never have been there in the first place, so I hope itā€™s possible to avoid it for future users. However, itā€™s good to get competent help when things do go wrong.

1 Like

Hi,
The same dphys-swapfile-error occurs for me at my Odroid-N2+. However, in contrast to other Odroids mentioned in this topic before, I only have a zram (swap-)partition. Would it be necessary to create an additional (ext4) swap-partition (to mount to /media/swap)? Seems a bit of a workaround to make the installation succeed in this case. Perhaps thereā€™s another solution? Looking forward to your ideas :slight_smile:

Edit: Iā€™ve also created an ext4 swap partition on my external HDD, mounted it on /media/swap and used dphys-swapfile setup to generate a swapfile on the right location. Itā€™s an ok solution for now. However, Is this issue already reported somewhere?