theyosh / TerrariumPI

Home automated terrarium/aquarium or other enclosed environment with a Raspberry Pi
https://terrarium.theyosh.nl
GNU General Public License v3.0
413 stars 100 forks source link

[BUG]: #463

Closed martynwheeler closed 4 years ago

martynwheeler commented 4 years ago

Describe the bug Having just upgraded using git pull and update the motd no longer appears in the console when I log in. Everything seems to be working okay.

Thanks in advance,

Martyn

theyosh commented 4 years ago

Is this still the case? I can take some time (1:30) before the first MOTD is generated.

And there are no errors in the screen session: https://github.com/theyosh/TerrariumPI/wiki/FAQ#how-to-debug-terrariumpi

martynwheeler commented 4 years ago

Thanks,

I will check later when I get home (I can't access from work).

martynwheeler commented 4 years ago

No, it is still missing. There are some errors in the screen session, does this help??

Traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 960, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 913, in _cast
    out = self.error_handler.get(out.status_code, self.default_error_handler)(out)
  File "/home/pi/TerrariumPI/terrariumWebserver.py", line 512, in error404
    return template('404',**variables)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3630, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3419, in render
    self.execute(stdout, env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/404.tpl", line 12, in <module>
    % include('inc/page_footer.tpl')
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3396, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/inc/page_footer.tpl", line 2, in <module>
    document.title = '{{page_title}} | {{title}} ({{version}})';
NameError: name 'version' is not defined

Critical error while processing request: /webcam//a94df035fc91a158c1f9d7a1c769ca66/stream.m3u8

Error:

NameError("name 'version' is not defined")

Traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 960, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 913, in _cast
    out = self.error_handler.get(out.status_code, self.default_error_handler)(out)
  File "/home/pi/TerrariumPI/terrariumWebserver.py", line 512, in error404
    return template('404',**variables)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3630, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3419, in render
    self.execute(stdout, env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/404.tpl", line 12, in <module>
    % include('inc/page_footer.tpl')
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3396, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/inc/page_footer.tpl", line 2, in <module>
    document.title = '{{page_title}} | {{title}} ({{version}})';
NameError: name 'version' is not defined

theyosh commented 4 years ago

This is a strange error. It looks like you settings.cfg file is missing the version setting in the [terrariumpi] section.

Could you post the first 20 lines of settings.cfg? Make sure you do not past passwords

martynwheeler commented 4 years ago

Hi,

Here it is:

[terrariumpi] host = :: port = 8090 version = 3.9.8 title = TerrariumPI %(version)s power_usage = 5 owfs_port = 4304 admin = *** password = ** language = en_US temperature_indicator = C distance_indicator = cm power_price = 0 water_price = 0 soundcard = bcm2835 ALSA always_authenticate = false windspeed_indicator = kmh volume_indicator = L sensor_gauge_overview = false hide_environment_on_dashboard = false graph_smooth_value = 0 external_calendar_url = graph_show_min_max_gauge = true horizontal_graph_legend = true meross_password = meross_username =

theyosh commented 4 years ago

Have you restarted it already? Because I have no clue at the moment....

martynwheeler commented 4 years ago

I have restarted it and still the same. All I did was to follow the instructions on updating the installation. I also note that the version is not displayed on the webpage? All the sensors and timers are working though.

image

Any suggestions would be welcomed? Thanks Martyn

theyosh commented 4 years ago

Ok, then for now, edit the settings.cfg and remove the %(version)s part from the title setting and restart... if that does not solve it... then I need a good night sleep to figure this out..

martynwheeler commented 4 years ago

Thanks, that has fixed the motd. Still getting the error in screen -r

you can see the name on the tab is not quite right either?

image

`NameError("name 'version' is not defined")

Traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 960, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 913, in _cast
    out = self.error_handler.get(out.status_code, self.default_error_handler)(out)
  File "/home/pi/TerrariumPI/terrariumWebserver.py", line 512, in error404
    return template('404',**variables)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3630, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3419, in render
    self.execute(stdout, env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/404.tpl", line 12, in <module>
    % include('inc/page_footer.tpl')
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3396, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/inc/page_footer.tpl", line 2, in <module>
    document.title = '{{page_title}} | {{title}} ({{version}})';
NameError: name 'version' is not defined

Critical error while processing request: /webcam//a94df035fc91a158c1f9d7a1c769ca66/stream.m3u8

Error:

NameError("name 'version' is not defined")

Traceback:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 960, in wsgi
    out = self._cast(self._handle(environ))
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 913, in _cast
    out = self.error_handler.get(out.status_code, self.default_error_handler)(out)
  File "/home/pi/TerrariumPI/terrariumWebserver.py", line 512, in error404
    return template('404',**variables)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3630, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3419, in render
    self.execute(stdout, env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/404.tpl", line 12, in <module>
    % include('inc/page_footer.tpl')
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3396, in _include
    return self.cache[_name].execute(env['_stdout'], env)
  File "/usr/local/lib/python3.7/dist-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/home/pi/TerrariumPI/views/inc/page_footer.tpl", line 2, in <module>
    document.title = '{{page_title}} | {{title}} ({{version}})';
NameError: name 'version' is not defined

`
martynwheeler commented 4 years ago

Do you think that it would be worth running the update again? I'd rather not reinstall as I have everything set up. However, if there is a way to reinstall and keep all my configuration that would be okay.

Thanks

theyosh commented 4 years ago

Hmm, you could always do a git pull and rerun the installer. In case of a reinstall: https://github.com/theyosh/TerrariumPI/wiki/FAQ#which-files-to-backup

martynwheeler commented 4 years ago

I will give it a try

On Fri, 9 Oct 2020, 16:53 TheYOSH, notifications@github.com wrote:

Hmm, you could always do a git pull and rerun the installer. In case of a reinstall: https://github.com/theyosh/TerrariumPI/wiki/FAQ#which-files-to-backup

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/theyosh/TerrariumPI/issues/463#issuecomment-706260725, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGVUFIPE6CSOAENOBNAK6LSJ4WVXANCNFSM4SDG2KFA .

martynwheeler commented 4 years ago

Hmm, an update has not solved it. Okay, so if I want to reinstall, I save the files you pointed to and remover the Terrariumpi directory and then reinstall by following the installation procedure? Just want to clarify before I start.

Thanks again for your help

theyosh commented 4 years ago

Do not remove, but just rename the old directory ;) Makes it easier to copy the files over. And before restarting after the end of the installation, copy the old settings and history files etc back.

martynwheeler commented 4 years ago

I don't know if this is related in any way but I am also seeing this error:

● owserver.service - Backend server for 1-wire control Loaded: loaded (/lib/systemd/system/owserver.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2020-10-09 19:33:10 BST; 45s ago Docs: man:owserver(1) Process: 481 ExecStart=/usr/bin/owserver -c /etc/owfs.conf (code=exited, status=1/FAILURE) Main PID: 481 (code=exited, status=1/FAILURE)

Oct 09 19:33:10 terrariumpi systemd[1]: owserver.service: Service RestartSec=100ms expired, scheduling restart. Oct 09 19:33:10 terrariumpi systemd[1]: owserver.service: Scheduled restart job, restart counter is at 5. Oct 09 19:33:10 terrariumpi systemd[1]: Stopped Backend server for 1-wire control. Oct 09 19:33:10 terrariumpi systemd[1]: owserver.service: Start request repeated too quickly. Oct 09 19:33:10 terrariumpi systemd[1]: owserver.service: Failed with result 'exit-code'. Oct 09 19:33:10 terrariumpi systemd[1]: Failed to start Backend server for 1-wire control.

theyosh commented 4 years ago

No this is not related. But this can be solved by editing:

edit /etc/owfs.conf and enable the line server: FAKE = DS2405 around line 16. My installed does remove this, but apparently this does not work with the newer versions.

martynwheeler commented 4 years ago

Mine says,

server: FAKE = DS18S20,DS2405

Should I remove the DS18S20 as I am using two DS18S20 sensors in my setup

theyosh commented 4 years ago

No, as this is a fake sensor, it will just generate random values. Only the DS2405 is needed. This will make OWFS work again, and fix the systemd status issue. So remove DS18S20 and remove the '#' in front of the line.

Then test it with service owfs restart and that should then work

martynwheeler commented 4 years ago

Okay, I have done a new installation and I seem to have got rid of the error. Thank you for all of your help!

theyosh commented 4 years ago

Nice and enjoy the new version!

theyosh commented 4 years ago

He, I found the bug. It has to do when you zoom in with the webcam or loading the favicon.ico file. That give a 404 error, which was missing the version number. So it should now be fixed for ever!

martynwheeler commented 4 years ago

Thanks

On Sat, 10 Oct 2020, 10:05 TheYOSH, notifications@github.com wrote:

He, I found the bug. It has to do when you zoom in with the webcam or loading the favicon.ico file. That give a 404 error, which was missing the version number. So it should now be fixed for ever!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/theyosh/TerrariumPI/issues/463#issuecomment-706516261, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGVUFPI522BVGCRNQY2VFLSKAPU7ANCNFSM4SDG2KFA .