kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.89k stars 488 forks source link

500 error after upgrade #286

Closed Ericktz closed 6 years ago

Ericktz commented 6 years ago
[Wed Aug 16 00:20:52.861333 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750] mod_wsgi (pid=18485): Target WSGI script '/var/www/mycodo/mycodo_flask.wsgi' cannot be loaded as Python module.
[Wed Aug 16 00:20:52.861452 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750] mod_wsgi (pid=18485): Exception occurred processing WSGI script '/var/www/mycodo/mycodo_flask.wsgi'.
[Wed Aug 16 00:20:52.861618 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750] Traceback (most recent call last):
[Wed Aug 16 00:20:52.861696 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/mycodo_flask.wsgi", line 8, in <module>
[Wed Aug 16 00:20:52.861810 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     from mycodo.start_flask_ui import app as application
[Wed Aug 16 00:20:52.861851 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/mycodo/start_flask_ui.py", line 11, in <module>
[Wed Aug 16 00:20:52.861918 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     app = create_app()  # required by the wsgi config and main()
[Wed Aug 16 00:20:52.861956 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/mycodo/mycodo_flask/app.py", line 67, in create_app
[Wed Aug 16 00:20:52.862019 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     register_extensions(app)
[Wed Aug 16 00:20:52.862057 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/mycodo/mycodo_flask/app.py", line 106, in register_extensions
[Wed Aug 16 00:20:52.862118 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     populate_db()
[Wed Aug 16 00:20:52.862154 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/mycodo/databases/models/__init__.py", line 138, in populate_db
[Wed Aug 16 00:20:52.862219 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     if not Misc.query.count():
[Wed Aug 16 00:20:52.862255 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2980, in count
[Wed Aug 16 00:20:52.862323 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     """
[Wed Aug 16 00:20:52.862359 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2749, in scalar
[Wed Aug 16 00:20:52.862422 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     raise sa_exc.ArgumentError(
[Wed Aug 16 00:20:52.862458 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2718, in one
[Wed Aug 16 00:20:52.862521 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     def all(self):
[Wed Aug 16 00:20:52.862557 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2761, in __iter__
[Wed Aug 16 00:20:52.862619 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     (note this may consist of multiple result rows if join-loaded
[Wed Aug 16 00:20:52.862698 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2776, in _execute_and_instances
[Wed Aug 16 00:20:52.862761 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     ret = list(self[0:1])
[Wed Aug 16 00:20:52.862797 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
[Wed Aug 16 00:20:52.862863 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     In the case that a plain SQL string is passed, and the underlying
[Wed Aug 16 00:20:52.862900 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
[Wed Aug 16 00:20:52.862964 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     """
[Wed Aug 16 00:20:52.863000 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
[Wed Aug 16 00:20:52.863063 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     """Execute a sql.ClauseElement object."""
[Wed Aug 16 00:20:52.863100 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
[Wed Aug 16 00:20:52.863161 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     evt_handled = False
[Wed Aug 16 00:20:52.863197 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
[Wed Aug 16 00:20:52.863259 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     else:
[Wed Aug 16 00:20:52.863295 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 202, in raise_from_cause
[Wed Aug 16 00:20:52.863359 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     cause = exc_value if exc_value is not exception else None
[Wed Aug 16 00:20:52.863395 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
[Wed Aug 16 00:20:52.863457 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     if self._echo:
[Wed Aug 16 00:20:52.863492 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]   File "/var/www/mycodo/env/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
[Wed Aug 16 00:20:52.863556 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750]     def do_begin(self, dbapi_connection):
[Wed Aug 16 00:20:52.863735 2017] [wsgi:error] [pid 18485] [remote 192.168.20.101:5750] OperationalError: (sqlite3.OperationalError) no such column: misc.max_amps [SQL: u'SELECT count(*) AS count_1 \\nFROM (SELECT misc.id AS misc_id, misc.dismiss_notification AS misc_dismiss_notification, misc.force_https AS misc_force_https, misc.hide_alert_info AS misc_hide_alert_info, misc.hide_alert_success AS misc_hide_alert_success, misc.hide_alert_warning AS misc_hide_alert_warning, misc.hide_tooltips AS misc_hide_tooltips, misc.language AS misc_language, misc.login_message AS misc_login_message, misc.max_amps AS misc_max_amps, misc.relay_usage_cost AS misc_relay_usage_cost, misc.relay_usage_currency AS misc_relay_usage_currency, misc.relay_usage_dayofmonth AS misc_relay_usage_dayofmonth, misc.relay_usage_volts AS misc_relay_usage_volts, misc.relay_usage_report_gen AS misc_relay_usage_report_gen, misc.relay_usage_report_span AS misc_relay_usage_report_span, misc.relay_usage_report_day AS misc_relay_usage_report_day, misc.relay_usage_report_hour AS misc_relay_usage_report_hour, misc.stats_opt_out AS misc_stats_opt_out \\nFROM misc) AS anon_1']

ocurr after reboot , after upgrade 5.1.6

kizniche commented 6 years ago

What version did you upgrade from? Can you please attach the upgrade log?

Ericktz commented 6 years ago

Apparently it was an error caused by an incomplete update.

Installed version: 5.0.49
Latest version: 5.1.6

#### Upgrade to v5.1.6 initiated 2017-08-11_23-53-00 ####

#### Beginning Upgrade: Stage 1 of 2 ####
Stopping the Mycodo daemon...Done.
Downloading latest Mycodo version to /home/pi/mycodo-5.1.6.tar.gz...Done.
Creating /tmp/Mycodo-5.1.6...Done.
Extracting /home/pi/mycodo-5.1.6.tar.gz to /tmp/Mycodo-5.1.6...Done.
The archive directory /tmp/Mycodo-5.1.6/old exists. Removing...Done.
Removing /home/pi/mycodo-5.1.6.tar.gz...Done.
Copying /tmp/Mycodo-5.1.6/.upgrade status file to /tmp/Mycodo-5.1.6...Done.
Moving env directory...Done.
Copying databases from /home/pi/Mycodo/databases/ to /tmp/Mycodo-5.1.6/databases...Done.
Copying flask_secret_key from /home/pi/Mycodo/databases/ to /tmp/Mycodo-5.1.6/databases...Done.
Copying statistics ID...Done.
Copying SSL certificates...Done.
Moving cameras directory...Done.
#### Stage 1 of 2 Complete ####
#### Continuing Upgrade: Stage 2 of 2 ####

Moving old Mycodo from /home/pi/Mycodo to /var/Mycodo-backups/Mycodo-backup-2017-08-11_23-53-00-5.0.49...Done.
Moving new Mycodo from /tmp/Mycodo-5.1.6 to /home/pi/Mycodo...Done.

#### Compiling mycodo_wrapper

#### Creating users and directories
useradd: user 'mycodo' already exists
The user `mycodo' is already a member of `gpio'.
The user `mycodo' is already a member of `adm'.
The user `mycodo' is already a member of `video'.
The user `mycodo' is already a member of `dialout'.

#### Setting permissions

#### Setting permissions

Running post-upgrade script...

#### Removing statistics file
rm: cannot remove '/home/pi/Mycodo/databases/statistics.csv': No such file or directory

#### Checking if swap size is 100 MB and needs to be changed to 512 MB
#### Swap not currently set to 100 MB. Not changing.
#### Virtualenv already exists, skipping creation

#### Installing gpiod
Archive:  pigpio.zip
   creating: PIGPIO/
  inflating: PIGPIO/setup.py         
  inflating: PIGPIO/command.h        
  inflating: PIGPIO/pigpiod.c        
  inflating: PIGPIO/pigpiod_if2.3    
  inflating: PIGPIO/pigs.c           
  inflating: PIGPIO/x_pigpiod_if.c   
  inflating: PIGPIO/pigpiod_if2.c    
  inflating: PIGPIO/pigpiod.1        
  inflating: PIGPIO/README           
  inflating: PIGPIO/command.c        
  inflating: PIGPIO/pigpio.h         
  inflating: PIGPIO/custom.cext      
  inflating: PIGPIO/pigpiod_if.h     
  inflating: PIGPIO/Makefile         
  inflating: PIGPIO/pig2vcd.c        
  inflating: PIGPIO/pigpio.py        
  inflating: PIGPIO/pigs.1           
  inflating: PIGPIO/pigpio.c         
  inflating: PIGPIO/x_pipe           
  inflating: PIGPIO/pigpiod_if.c     
  inflating: PIGPIO/UNLICENCE        
  inflating: PIGPIO/pigpio.3         
  inflating: PIGPIO/pigpiod_if2.h    
  inflating: PIGPIO/pigpiod_if.3     
  inflating: PIGPIO/pig2vcd.1        
  inflating: PIGPIO/x_pigpio.py      
  inflating: PIGPIO/MakeRemote       
  inflating: PIGPIO/x_pigpio.c       
  inflating: PIGPIO/x_pigpiod_if2.c  
  inflating: PIGPIO/x_pigs           
gcc -O3 -Wall -pthread -fpic -c -o pigpio.o pigpio.c
gcc -O3 -Wall -pthread -fpic -c -o command.o command.c
gcc -O3 -Wall -pthread -fpic -c -o pigpiod_if.o pigpiod_if.c
gcc -O3 -Wall -pthread -fpic -c -o pigpiod_if2.o pigpiod_if2.c
gcc -O3 -Wall -pthread   -c -o x_pigpio.o x_pigpio.c
gcc -O3 -Wall -pthread   -c -o x_pigpiod_if.o x_pigpiod_if.c
gcc -O3 -Wall -pthread   -c -o x_pigpiod_if2.o x_pigpiod_if2.c
gcc -O3 -Wall -pthread   -c -o pig2vcd.o pig2vcd.c
gcc -O3 -Wall -pthread   -c -o pigpiod.o pigpiod.c
gcc -O3 -Wall -pthread   -c -o pigs.o pigs.c
gcc -shared -o libpigpiod_if.so pigpiod_if.o command.o
gcc -shared -o libpigpiod_if2.so pigpiod_if2.o command.o
strip --strip-unneeded libpigpiod_if.so
size     libpigpiod_if.so
   text    data     bss     dec     hex filename
  59271    4292   49244  112807   1b8a7 libpigpiod_if.so
gcc -o pig2vcd pig2vcd.o
strip --strip-unneeded libpigpiod_if2.so
size     libpigpiod_if2.so
   text    data     bss     dec     hex filename
  69770    4292    1984   76046   1290e libpigpiod_if2.so
gcc -o pigs pigs.o command.o
strip pig2vcd
gcc -o x_pigpiod_if x_pigpiod_if.o -L. -lpigpiod_if -pthread -lrt
strip pigs
gcc -o x_pigpiod_if2 x_pigpiod_if2.o -L. -lpigpiod_if2 -pthread -lrt
gcc -shared -o libpigpio.so pigpio.o command.o
strip --strip-unneeded libpigpio.so
size     libpigpio.so
   text    data     bss     dec     hex filename
 248501    5336  598344  852181   d00d5 libpigpio.so
gcc -o x_pigpio x_pigpio.o -L. -lpigpio -pthread -lrt
gcc -o pigpiod pigpiod.o -L. -lpigpio -pthread -lrt
strip pigpiod
install -m 0755 -d                /opt/pigpio/cgi
install -m 0755 -d                /usr/local/include
install -m 0644 pigpio.h          /usr/local/include
install -m 0644 pigpiod_if.h      /usr/local/include
install -m 0644 pigpiod_if2.h     /usr/local/include
install -m 0755 -d                /usr/local/lib
install -m 0755 libpigpio.so      /usr/local/lib
install -m 0755 libpigpiod_if.so  /usr/local/lib
install -m 0755 libpigpiod_if2.so /usr/local/lib
install -m 0755 -d                /usr/local/bin
install -m 0755 pig2vcd           /usr/local/bin
install -m 0755 pigpiod           /usr/local/bin
install -m 0755 pigs              /usr/local/bin
if which python2; then python2 setup.py install; fi
/var/www/mycodo/env/bin/python2
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-2.7
copying pigpio.py -> build/lib.linux-armv7l-2.7
running install_lib
running install_egg_info
Removing /var/www/mycodo/env/lib/python2.7/site-packages/pigpio-1.38-py2.7.egg-info
Writing /var/www/mycodo/env/lib/python2.7/site-packages/pigpio-1.38-py2.7.egg-info
if which python3; then python3 setup.py install; fi
/usr/bin/python3
running install
running build
running build_py
creating build/lib
copying pigpio.py -> build/lib
running install_lib
running install_egg_info
Removing /usr/local/lib/python3.4/dist-packages/pigpio-1.38.egg-info
Writing /usr/local/lib/python3.4/dist-packages/pigpio-1.38.egg-info
install -m 0755 -d                /usr/local/man/man1
install -m 0644 *.1               /usr/local/man/man1
install -m 0755 -d                /usr/local/man/man3
install -m 0644 *.3               /usr/local/man/man3
ldconfig
2017-08-11 23:55:08 initInitialise: Can't lock /var/run/pigpio.pid
Can't initialise pigpio library

#### Installing wiringpi
Cloning into '/home/pi/Mycodo/install/wiringPi'...
wiringPi Build script
=====================

WiringPi Library
[UnInstall]
[Compile] wiringPi.c
[Compile] wiringShift.c
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] wiringSerial.c
[Compile] wiringPiSPI.c
[Compile] wiringPiI2C.c
[Compile] softPwm.c
wiringPi.c:1247:21: warning: 'digitalRead8Dummy' defined but not used [-Wunused-function]
 static unsigned int digitalRead8Dummy        (UNU struct wiringPiNodeStruct *node, UNU int UNU pin)            { return 0 ; }
                     ^
wiringPi.c:1248:21: warning: 'digitalWrite8Dummy' defined but not used [-Wunused-function]
 static         void digitalWrite8Dummy       (UNU struct wiringPiNodeStruct *node, UNU int pin, UNU int value) { return ; }
                     ^
[Compile] softTone.c
[Compile] mcp23016.c
[Compile] mcp23008.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] ads1115.c
[Compile] sn3218.c
[Compile] bmp180.c
[Compile] htu21d.c
[Compile] ds18b20.c
[Compile] rht03.c
[Compile] drcSerial.c
[Compile] drcNet.c
[Compile] pseudoPins.c
[Compile] wpiExtensions.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

WiringPi Devices Library
[UnInstall]
[Compile] ds1302.c
[Compile] maxdetect.c
[Compile] piNes.c
[Compile] gertboard.c
[Compile] piFace.c
[Compile] lcd128x64.c
[Compile] lcd.c
[Compile] scrollPhat.c
[Compile] piGlow.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]

GPIO Utility
[Compile] gpio.c
[Compile] readall.c
[Compile] pins.c
[Link]
[Install]

All Done.

NOTE: To compile programs with wiringPi, you need to add:
    -lwiringPi
  to your compile line(s) To use the Gertboard, MaxDetect, etc.
  code (the devLib), you need to also add:
    -lwiringPiDev
  to your compile line(s).

#### Installing and configuring apache2 web server
Module wsgi already enabled
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Module socache_shmcb already enabled
Module ssl already enabled

#### Updating apt repositories
Get:1 http://archive.raspberrypi.org jessie InRelease [22.9 kB]
Get:2 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Hit http://apt.adafruit.com jessie InRelease
Hit https://deb.nodesource.com jessie InRelease
Get:3 https://deb.nodesource.com jessie/main Sources [763 B]
Get:4 http://mirrordirector.raspbian.org jessie/main armhf Packages [9535 kB]
Get:5 https://deb.nodesource.com jessie/main armhf Packages [976 B]
Get:6 http://archive.raspberrypi.org jessie/main armhf Packages [170 kB]
Hit http://apt.adafruit.com jessie/main armhf Packages
Get:7 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:8 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:9 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:10 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:11 https://deb.nodesource.com jessie/main Translation-en [162 B]
Ign https://deb.nodesource.com jessie/main Translation-en
Get:12 http://linux.teamviewer.com stable InRelease [14.6 kB]
Ign http://linux.teamviewer.com stable InRelease
Ign http://apt.adafruit.com jessie/main Translation-en
Get:13 http://linux.teamviewer.com preview InRelease [14.6 kB]
Ign http://linux.teamviewer.com preview InRelease
Get:14 http://linux.teamviewer.com stable Release.gpg [836 B]
Get:15 http://linux.teamviewer.com preview Release.gpg [836 B]
Get:16 http://linux.teamviewer.com stable Release [6064 B]
Err http://linux.teamviewer.com stable Release

Get:17 http://linux.teamviewer.com preview Release [6014 B]
Err http://linux.teamviewer.com preview Release

Get:18 http://archive.raspberrypi.org jessie/ui armhf Packages [58.9 kB]
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Get:19 http://mirrordirector.raspbian.org jessie/contrib armhf Packages [43.3 kB]
Get:20 http://mirrordirector.raspbian.org jessie/non-free armhf Packages [84.2 kB]
Get:21 http://mirrordirector.raspbian.org jessie/rpi armhf Packages [1356 B]
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Fetched 9946 kB in 38s (257 kB/s)
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://linux.teamviewer.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E224500C1289C0

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://linux.teamviewer.com preview Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E224500C1289C0

W: Failed to fetch http://linux.teamviewer.com/deb/dists/stable/Release  

W: Failed to fetch http://linux.teamviewer.com/deb/dists/preview/Release  

W: Some index files failed to download. They have been ignored, or old ones used instead.

#### Installing prerequisite apt packages and update pip
Hit http://apt.adafruit.com jessie InRelease
Hit http://mirrordirector.raspbian.org jessie InRelease
Hit https://deb.nodesource.com jessie InRelease
Hit http://apt.adafruit.com jessie/main armhf Packages
Get:1 https://deb.nodesource.com jessie/main Sources [763 B]
Get:2 https://deb.nodesource.com jessie/main armhf Packages [976 B]
Hit http://archive.raspberrypi.org jessie InRelease
Get:3 http://linux.teamviewer.com stable InRelease [14.6 kB]
Ign http://linux.teamviewer.com stable InRelease
Get:4 http://linux.teamviewer.com preview InRelease [14.6 kB]
Ign http://linux.teamviewer.com preview InRelease
Get:5 http://linux.teamviewer.com stable Release.gpg [836 B]
Get:6 https://deb.nodesource.com jessie/main Translation-en [162 B]
Ign http://apt.adafruit.com jessie/main Translation-en
Get:7 http://linux.teamviewer.com preview Release.gpg [836 B]
Get:8 http://linux.teamviewer.com stable Release [6064 B]
Err http://linux.teamviewer.com stable Release

Get:9 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:10 http://linux.teamviewer.com preview Release [6014 B]
Err http://linux.teamviewer.com preview Release

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://archive.raspberrypi.org jessie/main armhf Packages
Get:11 https://deb.nodesource.com jessie/main Translation-en [162 B]
Hit http://mirrordirector.raspbian.org jessie/rpi armhf Packages
Hit http://archive.raspberrypi.org jessie/ui armhf Packages
Get:12 https://deb.nodesource.com jessie/main Translation-en [162 B]
Get:13 https://deb.nodesource.com jessie/main Translation-en [162 B]
Ign https://deb.nodesource.com jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en
Ign http://archive.raspberrypi.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/main Translation-en
Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en
Ign http://archive.raspberrypi.org jessie/ui Translation-en
Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en
Fetched 15.5 kB in 9s (1637 B/s)
Reading package lists...
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://linux.teamviewer.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E224500C1289C0

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://linux.teamviewer.com preview Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C5E224500C1289C0

W: Failed to fetch http://linux.teamviewer.com/deb/dists/stable/Release  

W: Failed to fetch http://linux.teamviewer.com/deb/dists/preview/Release  

W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
gawk is already the newest version.
gcc is already the newest version.
git is already the newest version.
libapache2-mod-wsgi is already the newest version.
libav-tools is already the newest version.
libboost-python-dev is already the newest version.
libffi-dev is already the newest version.
python-dev is already the newest version.
python-numpy is already the newest version.
python-opencv is already the newest version.
python-setuptools is already the newest version.
sqlite3 is already the newest version.
libi2c-dev is already the newest version.
python-smbus is already the newest version.
The following packages were automatically installed and are no longer required:
  libc-ares2 libv8-3.14.5 python-chardet python-colorama python-distlib
  python-html5lib python-ndg-httpsclient python-pyasn1 python-requests
  python-urllib3 python-wheel
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  apache2-bin apache2-data
Suggested packages:
  apache2-doc apache2-suexec-pristine apache2-suexec-custom
The following packages will be upgraded:
  apache2 apache2-bin apache2-data wget
4 upgraded, 0 newly installed, 0 to remove and 203 not upgraded.
Need to get 1747 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2 armhf 2.4.10-10+deb8u10 [208 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-bin armhf 2.4.10-10+deb8u10 [902 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-data all 2.4.10-10+deb8u10 [163 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main wget armhf 1.16-1+deb8u2 [475 kB]
Reading changelogs...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
Fetched 1747 kB in 10s (165 kB/s)
(Reading database ... 154349 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.10-10+deb8u10_armhf.deb ...
Unpacking apache2 (2.4.10-10+deb8u10) over (2.4.10-10+deb8u9) ...
Preparing to unpack .../apache2-bin_2.4.10-10+deb8u10_armhf.deb ...
Unpacking apache2-bin (2.4.10-10+deb8u10) over (2.4.10-10+deb8u9) ...
Preparing to unpack .../apache2-data_2.4.10-10+deb8u10_all.deb ...
Unpacking apache2-data (2.4.10-10+deb8u10) over (2.4.10-10+deb8u9) ...
Preparing to unpack .../wget_1.16-1+deb8u2_armhf.deb ...
Unpacking wget (1.16-1+deb8u2) over (1.16-1+deb8u1) ...
Processing triggers for systemd (215-17+deb8u5) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for install-info (5.2.0.dfsg.1-6) ...
Setting up apache2-bin (2.4.10-10+deb8u10) ...
Setting up apache2-data (2.4.10-10+deb8u10) ...
Setting up apache2 (2.4.10-10+deb8u10) ...`

Was fixed with a manual update:

sudo ~/Mycodo/mycodo/scripts/upgrade_post.sh