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% /