Hi, I have Raspberry Pi 2 connected to Arduino Uno. Just set everything up a few days ago and the brewpi had been running without any problem until I unplugged it for a few hours and then plugged it back in. Afterwards there is no website to interact with, I just get “Unable to connect” in my browser.
I checked my router and I can see the raspberry pi on the network (it connects through a wifi usb stick). I can ping the pi and even SSH into it. I tried starting brewpi from within the pi and it said brewpi was already running. Still no website.
Here is what happened when I tried restarting apache:
pi@raspberrypi:~ $ sudo service apache2 restart
Warning: Unit file of apache2.service changed on disk, ‘systemctl daemon-reload’ recommended.
Job for apache2.service failed. See ‘systemctl status apache2.service’ and ‘jour nalctl -xn’ for details.
pi@raspberrypi:~ $ ^C
pi@raspberrypi:~ $ systemctl daemon-reload
Failed to execute operation: Access denied
pi@raspberrypi:~ $ sudo systemctl daemon-reload
pi@raspberrypi:~ $ sudo service apache2 restart
Job for apache2.service failed. See ‘systemctl status apache2.service’ and ‘jour nalctl -xn’ for details.
pi@raspberrypi:~ $ systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2)
Drop-In: /lib/systemd/system/apache2.service.d
└─forking.conf
Active: failed (Result: exit-code) since Sun 2016-10-30 12:17:28 GMT; 22s ago
Process: 3427 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)
pi@raspberrypi:~ $ journalctl -xn
No journal files were found.
pi@raspberrypi:~ $ sudo apt-get update
Hit http://archive.raspberrypi.org jessie InRelease
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie/main armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Hit http://mirrordirector.raspbian.org jessie/main armhf Packages
Hit http://mirrordirector.raspbian.org jessie/contrib armhf Packages
Hit http://mirrordirector.raspbian.org jessie/non-free armhf Packages
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Ign http://archive.raspberrypi.org jessie/main Translation-en_GB
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Reading package lists… Done
pi@raspberrypi:~ $ sudo apt-get dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
gdb gdbserver libapache2-mod-php5 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 php5 php5-cgi php5-cli php5-common php5-readline
raspberrypi-bootloader raspberrypi-kernel
14 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/74.7 MB of archives.
After this operation, 255 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Segmentation fault
debconf: Perl may be unconfigured (Can’t load ‘/usr/lib/arm-linux-gnueabihf/perl/5.20/auto/POSIX/POSIX.so’ for module POSIX: /usr/lib/arm-linux-gnueabihf/perl/5.20/auto/POSIX/POSIX.so: nonzero padding in e_ident at /usr/share/perl/5.20/XSLoader.pm line 93.
at /usr/lib/arm-linux-gnueabihf/perl/5.20/POSIX.pm line 36.
Compilation failed in require at /usr/share/perl5/Debconf/Template.pm line 7.
BEGIN failed–compilation aborted at /usr/share/perl5/Debconf/Template.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/Question.pm line 8.
BEGIN failed–compilation aborted at /usr/share/perl5/Debconf/Question.pm line 8.
Compilation failed in require at /usr/share/perl5/Debconf/Config.pm line 7.
BEGIN failed–compilation aborted at /usr/share/perl5/Debconf/Config.pm line 7.
Compilation failed in require at /usr/share/perl5/Debconf/Log.pm line 10.
Compilation failed in require at (eval 1) line 4.
BEGIN failed–compilation aborted at (eval 1) line 4.
) – aborting
dpkg: unrecoverable fatal error, aborting:
files list file for package ‘libpython2.7-dev:armhf’ is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
pi@raspberrypi:~ $
I found that uncontrolled shutdown’s corrupted my SD card on the Pi on a regular basis. I always do a proper shutdown but on the occasions that it lost power, it would result in segmentation faults when starting services and causing panics. I would have to to a complete re-format / re-install to get it working again.
I also got segmentation faults when trying apt-get requests too. It was always a corrupted SD card.
My solution in the end was to connect a USB hard drive to the Pi and run the root filesystem from there. I’ve had no problems since (fingers crossed!).