Raspberry Pi - 503 Service Unavailable

ncp
#1

After trying it several times I just cant get my Raspberry Pi running nextcloud. I followed the official instructions and everything worked fine except the using via browser.

I succsessfully installed the image on the SD-card
I succsessfully was able to connect via ssh and make ncp-update
I changed the settings in the config to show web panel

But now, when I connect to my Pi via browser (Ip-adress and port 4443) It says:
" Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later."

Obviously I googled this case first,

BUT

If I want to deactivate maintenance mode with following command:
pi@nextcloudpi:~ $ sudo nextcloud.occ maintenance:mode --off

There is following error message:
sudo: nextcloud.occ: command not found

I dont know where the problem is and I tried many diffrent installation instructions but no one worked. Can anybody help me? Its a little frustrating…

#3

It is enabled by default, so maybe you disabled it by changing the setting?

If you first run

sudo ncp-update

As of v1.8.1, under TOOLS, you can enable/disable maintenance mode with

nc-maintenance

#4

I can only update to v1.7.0…?

Edit:
Ok I try to setup everything fresh with this image…

#5

Oops, sorry, it still being tested, will be available shortly.

Untill then a lot easier to use ncc

sudo ncc maintenance:mode --off

Or if you want to test v1.8.1 and nc-maintenance you can run

sudo ncp-update devel

1 Like
#6

Doesnt work:

pi@nextcloudpi:~ $ sudo ncc maintenance:mode --off
/usr/local/bin/ncc: line 2: 3227 Illegal instruction sudo -u www-data php /var/www/nextcloud/occ "$@"

Im sorry to bother you with this boring questions, but I am not really into this stuff and have tried allot…

When I try it on the v1.8.1 then this error happens: (changing maintenance to no)

Running nc-maintenance
/usr/local/bin/ncc: line 2: 5124 Illegal instruction sudo -u www-data php /var/www/nextcloud/occ "$@"
Done. Press any key…

How can I turn it of without getting an “Illegal Instruction” Error?

#7

What does following mean (the error at Nextcloudcheck)

Running nc-info
Gathering information…
NextCloudPi version v1.8.4
NextCloudPi image NextCloudPi_01-14-19
distribution Raspbian GNU/Linux 9 \n \l
automount yes
USB devices sda
datadir (doesn’t exist)
rootfs usage 1.9G/7.3G
swapfile /var/swap
dbdir /var/lib/mysql
Nextcloud check error
HTTPD service up
PHP service down
MariaDB service up
Redis service up
Postfix service down
internet check ok
port check 80 closed
port check 443 closed
IP ******************
gateway ********************
interface eth0
certificates none
NAT loopback no
uptime 7min

#8

Sorry that this is not resolved yet.

This does not tell what you actually did, nor what options you chose, nor what might have gone wrong!

On my v1.8.4 output is:

pi@rpi:~ $ sudo ncc maintenance:mode --on
Maintenance mode enabled
pi@rpi:~ $ sudo ncc maintenance:mode --off
Maintenance mode disabled

Means ports are closed, which is why, if you want help, you need to provide more specific information, ncp-report.

Again, this does not give any useful in formation. What result made you decide you needed the occ to disable maintenance mode?

If you need further assist, please share output via link/pastebin of

sudo ncp-report

#9

Ok, I understand it was a lack of information from my side, here hopefully some useful data:

<–! Paste this in GitHub report -->

NextCloudPi diagnostics

NextCloudPi version  v1.8.4
NextCloudPi image    NextCloudPi_01-14-19
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda 
datadir               (doesn't exist)
rootfs usage         1.9G/7.3G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      error
HTTPD service        up
PHP service          down
MariaDB service      up
Redis service        up
Postfix service      down
internet check       ok
port check 80        closed
port check 443       closed
IP                   ***REMOVED SENSITIVE VALUE***
gateway              ***REMOVED SENSITIVE VALUE***
interface            eth0
certificates         ***REMOVED SENSITIVE VALUE***
NAT loopback         no
uptime               43min

Nextcloud configuration

/usr/local/bin/ncp-report: line 48: 18798 Illegal instruction     sudo -u www-data php /var/www/nextcloud/occ config:list system

HTTPd logs

[Mon Feb 25 14:10:45.741545 2019] [ssl:error] [pid 438:tid 3070160448] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Mon Feb 25 14:10:45.741762 2019] [ssl:error] [pid 438:tid 3070160448] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Mon Feb 25 14:10:46.535010 2019] [ssl:warn] [pid 556:tid 3070160448] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 25 14:10:46.536682 2019] [ssl:error] [pid 556:tid 3070160448] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Mon Feb 25 14:10:46.536872 2019] [ssl:error] [pid 556:tid 3070160448] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Mon Feb 25 14:10:47.008258 2019] [mpm_event:notice] [pid 556:tid 3070160448] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Mon Feb 25 14:10:47.059076 2019] [core:notice] [pid 556:tid 3070160448] AH00094: Command line: '/usr/sbin/apache2'
[Mon Feb 25 14:12:34.454604 2019] [proxy:error] [pid 620:tid 2756863024] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.sock (*) failed
[Mon Feb 25 14:12:34.455106 2019] [proxy_fcgi:error] [pid 620:tid 2756863024] [client 192.168.178.21:55251] AH01079: failed to make connection to backend: httpd-UDS
[Mon Feb 25 14:13:10.152205 2019] [proxy:error] [pid 620:tid 2756863024] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.sock (*) failed
[Mon Feb 25 14:13:10.152538 2019] [proxy_fcgi:error] [pid 620:tid 2756863024] [client 192.168.178.21:55254] AH01079: failed to make connection to backend: httpd-UDS
[Mon Feb 25 14:34:24.759628 2019] [mpm_event:notice] [pid 556:tid 3070160448] AH00491: caught SIGTERM, shutting down
[Mon Feb 25 14:34:50.116826 2019] [ssl:warn] [pid 435:tid 3069386304] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 25 14:34:50.133627 2019] [ssl:error] [pid 435:tid 3069386304] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Mon Feb 25 14:34:50.133843 2019] [ssl:error] [pid 435:tid 3069386304] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Mon Feb 25 14:34:51.844320 2019] [ssl:warn] [pid 606:tid 3069386304] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Mon Feb 25 14:34:51.846277 2019] [ssl:error] [pid 606:tid 3069386304] AH02217: ssl_stapling_init_cert: can't retrieve issuer certificate! [subject: CN=archlinux / issuer: CN=archlinux / serial: 8DC01C299534EC96 / notbefore: Jan 13 23:56:49 2019 GMT / notafter: Jan 10 23:56:49 2029 GMT]
[Mon Feb 25 14:34:51.846459 2019] [ssl:error] [pid 606:tid 3069386304] AH02604: Unable to configure certificate localhost:4443:0 for stapling
[Mon Feb 25 14:34:52.064955 2019] [mpm_event:notice] [pid 606:tid 3069386304] AH00489: Apache/2.4.25 (Raspbian) OpenSSL/1.0.2l configured -- resuming normal operations
[Mon Feb 25 14:34:52.065353 2019] [core:notice] [pid 606:tid 3069386304] AH00094: Command line: '/usr/sbin/apache2'

Database logs

2019-02-25 14:34:23 2689569600 [Note] /usr/sbin/mysqld: Shutdown complete

2019-02-25 14:35:46 3062381856 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2019-02-25 14:35:46 3062381856 [Note] InnoDB: The InnoDB memory heap is disabled
2019-02-25 14:35:46 3062381856 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-02-25 14:35:46 3062381856 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2019-02-25 14:35:46 3062381856 [Note] InnoDB: Compressed tables use zlib 1.2.8
2019-02-25 14:35:46 3062381856 [Note] InnoDB: Using Linux native AIO
2019-02-25 14:35:46 3062381856 [Note] InnoDB: Using generic crc32 instructions
2019-02-25 14:35:46 3062381856 [Note] InnoDB: Initializing buffer pool, size = 173.0M
2019-02-25 14:35:47 3062381856 [Note] InnoDB: Completed initialization of buffer pool
2019-02-25 14:35:47 3062381856 [Note] InnoDB: Highest supported file format is Barracuda.
2019-02-25 14:35:48 3062381856 [Note] InnoDB: 128 rollback segment(s) are active.
2019-02-25 14:35:48 3062381856 [Note] InnoDB: Waiting for purge to start
2019-02-25 14:35:48 3062381856 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.41-84.1 started; log sequence number 4478135
2019-02-25 14:35:48 2466247488 [Note] InnoDB: Dumping buffer pool(s) not yet started
2019-02-25 14:35:48 3062381856 [Note] Plugin 'FEEDBACK' is disabled.
2019-02-25 14:35:48 3062381856 [Note] Server socket created on IP: '127.0.0.1'.
2019-02-25 14:35:48 3062381856 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.37-MariaDB-0+deb9u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Raspbian 9.0

Nextcloud logs

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

I even cant reset it, I think maybe the sd-card is the problem (log:

Running nc-init
Setting up a clean Nextcloud instance… wait until message ‘NC init done’
Setting up database…
Setting up Nextcloud…
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19276 Illegal instruction sudo -u www-data php occ maintenance:install --database “mysql” --database-name “nextcloud” --database-user “$DBADMIN” --database-pass “$DBPASSWD” --admin-user “$ADMINUSER” --admin-pass “$ADMINPASS”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19284 Illegal instruction sudo -u www-data php occ background:cron
sed**: can’t read config/config.php: No such file or directory**
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19302 Illegal instruction sudo -u www-data php occ config:system:set tempdirectory --value “$UPLOADTMPDIR”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19327 Illegal instruction sudo -u www-data php occ config:system:set mysql.utf8mb4 --type boolean --value=“true”
/usr/local/bin/ncc: line 2: 19369 Illegal instruction sudo -u www-data php /var/www/nextcloud/occ “$@”
/usr/local/bin/ncc: line 2: 19378 Illegal instruction sudo -u www-data php /var/www/nextcloud/occ “$@”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19386 Illegal instruction sudo -u www-data php occ config:system:set trusted_domains 5 --value=“nextcloudpi.local”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19394 Illegal instruction sudo -u www-data php occ config:system:set trusted_domains 7 --value=“nextcloudpi”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19402 Illegal instruction sudo -u www-data php occ config:system:set trusted_domains 8 --value=“nextcloudpi.lan”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19410 Illegal instruction sudo -u www-data php occ config:system:set mail_smtpmode --value=“sendmail”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19418 Illegal instruction sudo -u www-data php occ config:system:set mail_smtpauthtype --value=“LOGIN”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19426 Illegal instruction sudo -u www-data php occ config:system:set mail_from_address --value=“admin”
/usr/local/bin/ncp/CONFIG/nc-init.sh: line 15: 19435 Illegal instruction sudo -u www-data php occ config:system:set mail_domain --value=“ownyourbits.com
failed to get ID
Done. Press any key…

#10

So, I now did following:

Installed the Image on a different SD-card and put it into a different raspberry pi.
Updatet it and got the same problem.

sudo ncc maintenance:mode --off
/usr/local/bin/ncc: line 2: 1718 Illegal instruction sudo -u www-data php /var/www/nextcloud/occ “$@”

I really dont no where the problem could be…

When I connect to the Ipadress in the browser without port 4443, i get a php-file with following text:

<?php /** * * Your webserver seems to be not configured to use PHP or PHP is not installed. * Please contact your administrator or follow our documentation: * https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html * * @copyright Copyright (c) 2016, ownCloud, Inc. * * @author Georg Ehrke * @author Joas Schilling * @author Jörn Friedrich Dreyer * @author Lukas Reschke * @author Morris Jobke * @author Robin Appelman * @author Sergio Bertolín * @author Thomas Müller * @author Vincent Petry * * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see * */ require_once __DIR__ . '/lib/versioncheck.php'; try { require_once __DIR__ . '/lib/base.php'; OC::handleRequest(); } catch(\OC\ServiceUnavailableException $ex) { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); //show the user a detailed error page OC_Template::printExceptionErrorPage($ex, 503); } catch (\OC\HintException $ex) { try { OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503); } catch (Exception $ex2) { try { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); \OC::$server->getLogger()->logException($ex2, array('app' => 'index')); } catch (Throwable $e) { // no way to log it properly - but to avoid a white page of death we try harder and ignore this one here } //show the user a detailed error page OC_Template::printExceptionErrorPage($ex, 500); } } catch (\OC\User\LoginException $ex) { OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 403); } catch (Exception $ex) { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); //show the user a detailed error page OC_Template::printExceptionErrorPage($ex, 500); } catch (Error $ex) { try { \OC::$server->getLogger()->logException($ex, array('app' => 'index')); } catch (Error $e) { http_response_code(500); header('Content-Type: text/plain; charset=utf-8'); print("Internal Server Error\n\n"); print("The server encountered an internal error and was unable to complete your request.\n"); print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n"); print("More details can be found in the webserver log.\n"); throw $ex; } OC_Template::printExceptionErrorPage($ex, 500); }
#11

I am honestly frustrated how bad this at standard conditions works, I was really fascinated when I heared from nextcloud the first time, but it just dont works for not supernerds… :confused:

I even tried different imaging software like Etcher and WinDiskManager, as well as two different raspberry pis and to different sd-cards, it works by default not (fist boot without any settings or with some settings like web panel enabled)

#12

I did a completly fresh process again with berry boot this time. I didnt change a thing but still get the Message:

pi@nextcloudpi:~ $

sudo ncc maintenance:mode --off

/usr/local/bin/ncc: line 2: 1989 Illegal instruction sudo -u www-data php /var/www/nextcloud/occ "$@"

I have the Raspberry Pi Modell B, I gues it should work normally

#13

now related to Bitcoins for the one who solves my problem

#14

i’d like to stay in this thread because

  • you have @OliverV already taking care of your problem
  • you already have given out more information about what you want and what you need.

so here are my questions for you:

  • how is your rp3b powered?
  • how do you burn the image to your sd-card (pls in detail)
  • how do you access your rp3b afterwards?
#15

ok, understand this argument.

First of all I have a older modell (cpu-info):
processor : 0
model name : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2835
Revision : 000e
Serial : 00000000f5b16ba7

Powered via usb plug.
I burned the Image the first times as following:

-inserted SD-card into pc
-windows-X - disk management
-all old volumes deleted, 1 new created (fat32)
-formated and named nextclourpi
-opened Etcher as admin
-downloaded the image here
-unpacked with 7 zip and winRar
-selected the image in etcher, selected the sd-card
-klicked “flash”

some trys I created after this a file without extensions with the name “ssh”.

After a few trys I used Windiskmanager32 instead of etcher to flash the image to the sd-card.

I also went trough the completeinstallation with berryboot

After connecting successfully via ssh I cant get further.

Should I delete the other thread?

#16

I only now see that my raspberry has the old ARMv6,
I read the Please NOTE: only armv7 is supported, armv6 is no longer supported by NCP, due to incompatible php version. warning at the Installation of Berryboot. Does this means the Raspberry is to old?

Because on the Main Website it says:

Raspberry Pi (all models)

The most popular board around! You can convert it into your home cloud now.

There are Berryboot images available in order to run NextCloudPi directly from an external hard drive.

#17

i’d suggest so… since it wouldn’t bring you any further. you can edit the title of THIS thread at any time as well as the keywords… and so you could put “bounty” in as well… if that’s your wish.

i thought you were referring to “Raspberry 3 Model B” but you’re trying to run it on a Raspberry 1 Model B?
Well this one could be too old (outdated) for the use of nextcloud on it.

I’m not sure about the USB-PowerPlug. Afaik a rpi should have an exteral powerplug. if it’s connected to yet another USB-Slot to gain it’s power from, it could fail.

#18

raspberry one - yes. too old.

not updated. needs update.

#19

ok thank you for you help. So there is no older version of php I could run?

I cant delete the other thread, dont have permissions, but I want.()

#20

well changing php versions wouldn’t neccessarily help since nc (15) requires a minimum of php7.0 (i guess, maybe even 7.1)… plus installing php and changing versions isn’t as obvious and easy as you might expect it to be. at least that was my impression i got from dealing with php.

so maybe you’d be luckier with an older version of ncp… i dunno if they’re featuring any archive. but keep in mind that old versions would contain old security-holes, which even are published to the internet. so using these would only make sense in a closed intranet-like situation (definitly not reachable from the outside and thus cutting nextcloud from a good part of usage)

a different solution for you could be setting up NC as a VM which would run under windows as well. if you want to get to know about the possibilities you have by using nextcloud. afaik there’s even a ncp-version for VM (virtual machine).

if you’d be ok with NC then it might be either a good idea to host it with a hosting provider oder investing some bucks for a new hardware (though raspi, even rpi3 would stay a bit slow… and I personally wouldn’t recommend it for groups of more than - say - 10 ppl)

you can delete all postings under the inital starting thread and you need to mark the starting thread as “please delete” - since only moderators are able to delete threads.

#21

ok, I agree with that. I am looking to buy some hardware, but I dont want to invest that much. The rock64 board isnt really available in Germany, and the sync cloud devices are to expensive for private use. I think, I might get a Rp3b+ , because it is mostly for private use and not for a company or large groups.

Thank you @JimmyKater for you friendly help and the detailed answers to my boring questions!
Thanks also to @OliverV for you fast response at the beginning of this thread.

1 Like