Giter Site home page Giter Site logo

hassio-addons / addon-log-viewer Goto Github PK

View Code? Open in Web Editor NEW
63.0 6.0 7.0 6.92 MB

Log Viewer - Home Assistant Community Add-ons

Home Page: https://addons.community

License: MIT License

Shell 15.39% Dockerfile 26.75% Groovy 21.29% Jinja 36.57%
logviewer log logs home-assistant homeassistant addon addons

addon-log-viewer's Introduction

Home Assistant Community Add-on: Log Viewer

GitHub Release Project Stage License

Supports aarch64 Architecture Supports amd64 Architecture Supports armhf Architecture Supports armv7 Architecture Supports i386 Architecture

Github Actions Project Maintenance GitHub Activity

Discord Community Forum

Buy me a coffee

Browser-based log utility for Home Assistant.

Log Viewer Screenshot

About

Easily monitor your Home Assistant logs in your web browser. Custom filtering is available to make it simple to differentiate different types of logs.

📚 Read the full add-on documentation

Support

Got questions?

You have several options to get them answered:

You could also open an issue here GitHub.

Contributing

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! 😍

Authors & contributors

The original setup of this repository is by Dale Higgs.

For a full list of all authors and contributors, check the contributor's page.

We have got some Home Assistant add-ons for you

Want some more functionality to your Home Assistant instance?

We have created multiple add-ons for Home Assistant. For a full list, check out our GitHub Repository.

License

MIT License

Copyright (c) 2018-2024 Dale Higgs <@dale3h>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

addon-log-viewer's People

Contributors

allanpersson avatar dale3h avatar dependabot[bot] avatar frenck avatar glmnet avatar renovate[bot] avatar sinclairpaul avatar timmo001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

addon-log-viewer's Issues

Log viewer does not start

Problem/Motivation

(Why the issue was filed)

Add on does not start on a raspi 4. Error message from the sidebar: “add-on is not running. Please start first”

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun logviewer (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[22:48:36] INFO: Starting Log Viewer...
[22:48:37] INFO: Starting NGINX...
2023-04-02T20:48:37.308Z logview:debug start tailing /config/home-assistant.log
2023-04-02T20:48:37.325Z logview:info listening on port 4277 (HTTP)

Expected behavior

(What you expected to happen)

Start of the add on

Actual behavior

(What actually happened)

add on fails to start

Steps to reproduce

(How can someone else make/see it happen)

Uninstalled and reinstalled. As well as several restarts.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

configuration not located in /config/

Problem/Motivation

Log Viewer is not working for me. It can't find the log file.

Expected behavior

Logs are able to be found

Actual behavior

I've installed hass.io using the method described here: https://github.com/home-assistant/hassio-installer
By default the installer puts the homeassistant configuration in this directory: /usr/share/hassio/homeassistant

See lines here: https://github.com/home-assistant/hassio-installer/blob/master/hassio_install.sh#L67-L70

Steps to reproduce

Install hass.io using hassio-installer
note that configuration is not in /config/

Proposed changes

I propose adding a configuration parameter that specifies the location of the configuration directory

GitHub
Installer for a generic Linux system. Contribute to home-assistant/hassio-installer development by creating an account on GitHub.
GitHub
Installer for a generic Linux system. Contribute to home-assistant/hassio-installer development by creating an account on GitHub.

Repostitory structure for 0.12.0 is not compliant

Problem/Motivation

When I try and add the custom repository it throws an error

Expected behavior

The repository added

Actual behavior

Error message of:
Repostitory structure for 0.12.0 is not compliant

Steps to reproduce

Try to add the custom repository via the HACS menu.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

v0.10.1 does not appear as an update

Problem/Motivation

My HAAS is fully up to date, other add-ons update fine, but this one seems to be stuck on v0.9.1

Expected behavior

Update to 0.10.1 is available

Actual behavior

image

Syslog export

Problem/Motivation

It would be interesting if this addon could also have a configuration section for sending lots out to an external syslog server. Different types of syslog servers exists so tcp/udp and port numbers would have to be settable. Maybe just using 'nc' to stream them out when tailing the logs?

Expected behavior

Be able to see homeassistant logs on a remote syslog server

Actual behavior

Homeassitant logs are only on the homeassitant server

Steps to reproduce

n/a

Proposed changes

See above in motivation section

WEB UI not rendering on Safari

Problem/Motivation

The Log Viewer renders no log output or interface controls when using Safari.

Expected behavior

To be able to see log output and controls in Safari.

Actual behavior

Only the grey background and the blue bottom bar for controls are rendered.

Steps to reproduce

Run the add-on and open the WEB UI in Safari

Screenshots

Safari

screen shot 2018-06-19 at 10 38 42

Chrome

screen shot 2018-06-19 at 10 42 19

user details

Does someone know the logviewer standard user details?

Logviewer keeps clearing screen and losing history

Problem/Motivation

Log viewer Current version: 0.15.1 keeps clearing the screen, and I lose viewing previous logs

Expected behavior

for example, on HA boot, I would like to see the whole log since boot. this way, I can see any errors and correct them.

Actual behavior

On HA boot it keeps clearing the screen and I cant see previous log entries

Steps to reproduce

Just run it on HA boot and watch. it will clear the screen and you cannot scroll up anymore to view logs

Proposed changes

Just run and allow the whole log to be viewed. like a tail -f logfile.

No show logs in addon....

Problem/Motivation

I installed your addon and now show me still black screen with no logs... why. Addon is run and show in side bar...

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Running this on a port (for direct non-ingress access) results in SSL error

Problem/Motivation

I want to view logs outside of HA

Expected behavior

Log viewer on a port

Actual behavior

Doesn't even start

Steps to reproduce

Followed the advice here: https://community.home-assistant.io/t/community-hass-io-add-on-log-viewer/64377/25

i.e. " you can enable this again by going into the add-on configuration. A new section show is visible: “Network”. Enter port 4277 (or anything else if you want) in the disabled field. Hit the “SAVE” followed by the “RESTART” button to make your iframe work as before."

The following error happens:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Log Viewer
 Browser-based log utility for Hass.io
-----------------------------------------------------------
 Add-on version: 0.7.0
 You are running the latest version of this add-on.
 System: HassOS 3.8  (amd64 / qemux86-64)
 Home Assistant version: 0.104.3
 Supervisor version: 195
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[22:18:32] FATAL: 
[22:18:32] FATAL: SSL has been enabled using the 'ssl' option,
[22:18:32] FATAL: this requires a SSL certificate file which is
[22:18:32] FATAL: configured using the 'certfile' option in the
[22:18:32] FATAL: add-on configuration.
[22:18:32] FATAL: 
[22:18:32] FATAL: Unfortunately, the file specified in the
[22:18:32] FATAL: 'certfile' option does not exists.
[22:18:32] FATAL: 
[22:18:32] FATAL: Please ensure the certificate file exists and
[22:18:32] FATAL: is placed in the Hass.io '/ssl/' directory.
[22:18:32] FATAL: 
[22:18:32] FATAL: In case you don't have SSL yet, consider getting
[22:18:32] FATAL: a SSL certificate or setting the 'ssl' option
[22:18:32] FATAL: to 'false' in case you are not planning on using
[22:18:32] FATAL: SSL with this add-on.
[22:18:32] FATAL: 
[22:18:32] FATAL: Check the add-on manual for more information.
[22:18:32] FATAL: 
[cont-init.d] nginx.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
-----------------------------------------------------------
                Oops! Something went wrong.

 We are so sorry, but something went terribly wrong when
 starting or running this add-on.
 
 Be sure to check the log above, line by line, for hints.
-----------------------------------------------------------
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
Home Assistant Community
I love this add-on it makes log viewing so easy. If i haven’t made a mistake in the setup (which i have checked multiple times) i have a request to make it more easy to toogle between log level. Right now the setting in logger is overwriting the setting i log viewer, so if i set the level to info in logger and warn in log viewer it shows log level info. It would be awesome to be able to set the log level in logger to debug, and in log viewer be able to change what the log viewer actually show...

Feature Request: Syslog forwarding

Problem/Motivation

The syslog capability in HA only provides for notifications. The lack of ability to log events to SEIM or similar platforms, is often sighted as hurdle to using HA in business environments. Creating a separate dedicate addon seems unnecessary and such a feature in this addon would enhance it usefulness.

Proposed changes

Add options to specify a syslog forwarding address and port, with a toggle enable .

Revise/improve all log messages

Problem/Motivation

There are several reasons for this:

  • Not all log messages are consistent across all add-ons.
  • Some messages are unclear to the novice user.

Log level set to info, but still seeing debug log entries

Problem/Motivation

Started up the addon with log level set to info, but still seeing all of the debug log entries.

Expected behavior

I expect to only see INFO or higher log entries when log level is set to info

Actual behavior

I am seeing DEBUG entries when log level is set to info

Steps to reproduce

All I did was start up the addon, and this is the behavior I am seeing

Proposed changes

None

Feature Request: Ability to add test entry to log file (so you know for sure that you're viewing the live log)

It's very handy to be able to view the log in the UI sometimes, but when the log is empty it's hard to know for sure if the log file has actually loaded, or if HA or the add-on are having issues and the log just isn't displaying.

For me personally, if I go to the Log Viewer and there are no messages, it makes me think that it might not actually be opening the log file, and I then have to open a terminal so I can to view the log file manually and confirm that it is in fact empty.

I think it might be helpful to some users if in addition to the existing buttons in the bottom right-hand corner of the screen, that there was also a button to add a test line to the log file, so you can confirm that you are in fact viewing the log file.

Backup Filesare empty after uploading to Nextcloud

Problem/Motivation

The files copied to Nextcloud can not be used for restoring

Expected behavior

Backup is generated in either mode -manual and automated. Then these files are uploaded to my nextcloud

Actual behavior

Snapshots are generated and fully OK within home assistent. Files are then copied to Nextcloud, but here they have zero length and content. On HassIO these files are still OK.

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
log-viewer/Dockerfile
  • ghcr.io/hassio-addons/base-nodejs 0.2.0
github-actions
.github/workflows/ci.yaml
.github/workflows/deploy.yaml
.github/workflows/labels.yaml
.github/workflows/lock.yaml
.github/workflows/pr-labels.yaml
.github/workflows/release-drafter.yaml
.github/workflows/stale.yaml
regex
log-viewer/Dockerfile
  • ghcr.io/hassio-addons/base-nodejs 0.2.0
log-viewer/build.yaml
  • ghcr.io/hassio-addons/base-nodejs 0.2.0
  • ghcr.io/hassio-addons/base-nodejs 0.2.0
  • ghcr.io/hassio-addons/base-nodejs 0.2.0
log-viewer/Dockerfile
  • alpine_3_19/nginx 1.24.0-r16
  • alpine_3_19/git 2.43.4-r0

  • Check this box to trigger a request for Renovate to run again on this repository

logviewer not starting

Since I have the UDM firewall up and running, logviewer is no longer running.
I have installed Home Assistant on a Proxmox VM (192.168.1.222), which is currently still in the
LAN network 192.168.1.0/24. The UDM itself has the IP 192.168.1.1
For port 4277 for 192.168.1.222 I have set up portfowarding.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------
 Add-on: Log Viewer
 Browser-based log utility for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.15.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.5  (amd64 / qemux86-64)
 Home Assistant Core: 2023.9.2
 Home Assistant Supervisor: 2023.09.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun logviewer (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
[08:46:33] INFO: Starting Log Viewer...
s6-rc: info: service legacy-services successfully started
2023-09-19T06:46:33.699Z logview:debug start tailing /config/home-assistant.log
2023-09-19T06:46:33.705Z logview:info listening on port 4277 (HTTP)
[08:46:34] INFO: Starting NGINX...

Log Viewer doesn't connect reliably after transition to Ingress

Problem/Motivation

After being updated to support Ingress, I'm finding the Log Viewer addon to be not very reliable.
Sometimes it starts properly and shows a few lines of history as expected, but quite often it just shows a blank page and doesn't update as new log messages come in. It doesn't seem to matter if it's going through Nabu Casa, through OpenVPN to my house, or on my local wifi network. There are no errors or interesting log messages in the Home Assistant log, nor anything other than GET requests like the following in the addon logs, even with log-level set to debug:

[30/Apr/2019:15:07:55 -0700] 200 127.0.0.1, 172.30.32.1(172.30.32.2) GET /js/commands.js HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36)
Overall, it just seems very flaky. Opening and closing it a few times might eventually get it to work, but most often it doesn't.

Expected behavior

I expect the log viewer to reliably open, display a few lines of historical logs, and display new log messages in real time. This was the earlier behavior.

Actual behavior

I often just get a blank screen and no logs are ever shown.

Steps to reproduce

Install the addon and start using the default configuration.

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Error in "Log Viewer" opening

Problem/Motivation

When I open Log Viewer, I usually encounter this error:

File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 189, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable

I can see at the top of the Log viewer page (not in logs page)

Expected behavior

(What you expected to happen)

Actual behavior

Look above at Problem/Motivation

Steps to reproduce

Open Log Viewer

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Feature Request: Ability to add test entry to log file (so you know for sure that you're viewing the live log)

NOTE: This has been submitted in the past but the bot keeps closing it automatically because it sees it as a stale issue due to lack of response. The last time it was submitted I noticed it was added to the project tracking and marked as done, however the feature doesn't seem to be implemented.


It's very handy to be able to view the log in the UI sometimes, but when the log is empty it's hard to know for sure if the log file has actually loaded, or if HA or the add-on are having issues and the log just isn't displaying.

For me personally, if I go to the Log Viewer and there are no messages, it makes me think that it might not actually be opening the log file, and I then have to open a terminal so I can to view the log file manually and confirm that it is in fact empty.

I think it might be helpful to some users if in addition to the existing buttons in the bottom right-hand corner of the screen, that there was also a button to add a test line to the log file, so you can confirm that you are in fact viewing the log file.

Only seeing an error in the log viewer: KeyError: 'uuid'

Problem/Motivation

Would like to figure out how to properly use this addon.

Expected behavior

open log viewer and see lgos

Actual behavior

All I see in the log viewer is this:

  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 204, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/kodi/config_flow.py", line 107, in async_step_zeroconf
    uuid = discovery_info["properties"]["uuid"]
KeyError: 'uuid'

Steps to reproduce

  • Install log viewer addon
  • change config tho this:
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
log_level: info

  • Save and restart addon
  • access log viewer
  • see above error

Proposed changes

no idea what I am doing wrong but here is the log of log viewer itself:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Add-on: Log Viewer
 Browser-based log utility for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.9.0
 You are running the latest version of this add-on.
 System: HassOS 4.13  (amd64 / qemux86-64)
 Home Assistant Core: 0.115.6
 Home Assistant Supervisor: 245
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[22:07:07] INFO: Starting Log Viewer...
2020-10-04T20:07:08.075Z logview:debug start tailing /config/home-assistant.log
2020-10-04T20:07:08.078Z logview:info listening on port 4277 (HTTP)
[22:07:08] INFO: Starting NGinx...
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
[04/Oct/2020:22:07:19 +0200] 200 192.168.178.141, 172.30.32.1(172.30.32.2) GET / HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36)

Odd interactions with scraper

Problem/Motivation

I'm running a scraper to pull some air quality sensors and it seems after a scrape the log viewer is doing "something"

And starts looking like this:
image

If i refresh its back to normal.

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Accessing Log Viewer through Ingress fails and throughs an Invalid HTTP Response

Problem/Motivation

I'm re-reporting the same issue that is described here #19 because it's happening again with 0.96.5 with exactly the same symptoms. The only ways to use the log viewer addon reliably are these:

  • Disable the cache for the page through the browser dev tools
  • Refresh the page and bypass cache every time the page is opened after the first time
  • Set up a local port in the addon and get to the log viewer that way

Expected behavior

I expect the log viewer to open properly and display realtime log content.

Actual behavior

After opening the log viewer page once (which works), successive attempts to open it result in a blank page and an "invalid HTTP response" in the browser dev console.

Steps to reproduce

Open the log viewer from the addon page, hit the back arrow or refresh the page. Sometimes it works, but do it enough and it will eventually stop working. Sometimes it stops working immediately after the first attempt and sometimes it takes a few tries.

This is what the Chrome dev console shows when I try to refresh the page when the issue is happening:

Screen Shot 2019-08-04 at 7 42 36 AM

Proposed changes

Side bar icon has been renamed

Problem/Motivation

Running 0.113b0 an error is logged "Icon mdi:file-document-box-outline was renamed to mdi:text-box-outline"

Expected behavior

No issue at the moment, hopefully icon gets renamed before 0.115 :)

Actual behavior

No issue at the moment

Steps to reproduce

run 0.113b0

Proposed changes

Icon needs to be renamed in line with update to MDI icons in 0.113.

Connection refused on default port

Problem/Motivation

It's not working; at least, the UI is not usable

Expected behavior

I'd expect it to work, or throw an error in the log

Actual behavior

Browser produces: connection refused. This is my log:

'[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Log Viewer v0.3.0
 Browser-based log utility for Hass.io
 From: Community Hass.io Add-ons
 By: Franck Nijhof <[email protected]>
-----------------------------------------------------------
 armhf / HassOS 1.12 / HA 0.84.6 / SU 141 / stable
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to INFO
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 02-updates.sh: executing... 
INFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
INFO: Password is NOT in the Have I Been Pwned database! Nice!
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2019-01-07T19:00:04.595Z logview:debug start tailing /config/home-assistant.log
2019-01-07T19:00:04.614Z logview:info listening on port 4277 (HTTP)'

Steps to reproduce

Install Hass.io o RPI3. Install Log Viewer Addon. Supply credentials in config. Start the addon. Open Web UI.

Proposed changes

How to use filtering

Problem/Motivation

The documentation says "Custom filtering is available to make it simple to differentiate different types of logs."
How do I use this? I want to filter my logs for certain services, like it's possible in any other log viewer. The only UI elements I see are for disconnecting and autoscrolling.
Are there any shortcuts for filtering?

Expected behavior

UI to allow Filtering

Actual behavior

UI does not support filtering

Steps to reproduce

Start it

Proposed changes

Allow filtering in UI

Log Viewer shows a lot, regardless of log_level configuration

I use Log Viewer to keep an eye on the Home Assistant log file for errors. It seems the Log Viewer shows every new line added to this log, regardless of what the config file is set to. This does not seem correct.

I expected the amount of updates to change when the settings were re-configured from "log_level: INFO" to "log_level: FATAL".

However it continues to show every update from various sensors and other messages, and neither setting seems to show a difference.

I can reproduce this by changing the setting back to INFO, or ERROR, or FATAL. Regardless of what the setting is, it always seems to scroll with the same amount of data displayed.

Is this a bug or misconfigured somewhere?

Problem with addon for HA

Hello
from a some days when I open log viewer I see error as attached
(after restart HA for some time work perfectly and after i see attach)

any idea ?

mex :
File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

Doesn't start on aarch64 `unprotected error in call to Lua API (bad light userdata pointer)`

Problem/Motivation

I can't use this addon as it won't load

Expected behavior

Addon loads as normal

Actual behavior

Addon stops loading with below error:

INFO: Starting NGinx... PANIC: unprotected error in call to Lua API (bad light userdata pointer)

Steps to reproduce

Install addon on new isntall of Hassos on Odroid C2 (aarch64), try and start addon, review logs

Proposed changes

I have had the same error before with other addons and they have been fixed by an update; I'm not sure exactly what otherwise I would change it myself

Wont start after upgrading to 0.4.1

Problem/Motivation

Upgrading to 0.4.1 and now it fails to start.

Expected behavior

Older version starts, and is fine if I restore from snapshot.

Actual behavior

I get this log output...

`[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...

Hass.io Add-on: Log Viewer
Browser-based log utility for Hass.io

Add-on version: 0.4.1
You are running the latest version of this add-on.
System: HassOS 2.11 (armv7 / raspberrypi3)
Home Assistant version: 0.90.2
Supervisor version: 152

Please, share the above information when looking for help
or support in e.g, GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing...
[19:47:16] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[19:47:16] INFO: Starting Log Viewer...
/usr/lib/node_modules/ws-log/node_modules/statuses/index.js:1
(function (exports, require, module, __filename, __dirname) { ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
SyntaxError: Invalid or unexpected token
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
[19:47:20] INFO: Starting Log Viewer...`

Steps to reproduce

Not sure, I'm using hass.io on a raspberry pi, I don't think there is anything unusual or special about my install.

Proposed changes

I can only make it work by downgrading to an old snapshot (version 0.3.1)

Can't use viewer on iOS in app or safari or chrome

Problem/Motivation

As per title - logviewer addon not working on iOS

(Why the issue was filed)

Expected behavior

Expect it to work. Works on Windows 10 PC with chrome perfectly

(What you expected to happen)

Actual behavior

Displays 'reconnecting' in bottom left and cycles to Retry in 3s counts down connecting etc

(What actually happened)

Steps to reproduce

Open chrome or ios app or safar1 on iOS

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

I installed Hass.io on a USB stick on Raspbian Stretch lite via dale3h's script. Works flawlessly. I am using a Pi3B (not a plus). Stretch is fully up-to-date (Used June image and updated everything before using the script)
Also running iOS 12 beta on latest public beta.

NFO: You are running the latest version of this add-on
[cont-init.d] 02-updates.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
INFO: Password is NOT in the Have I Been Pwned database! Nice!
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2018-08-16T23:24:55.147Z logview:debug start tailing /config/home-assistant.log
2018-08-16T23:24:55.163Z logview:info listening on port 4277 (HTTP)
2018-08-16T23:30:50.822Z logview:info client connected from ::ffff:172.30.32.1
2018-08-16T23:35:35.051Z logview:info client connected from ::ffff:172.30.32.1
2018-08-16T23:49:24.876Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T01:56:45.878Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T02:04:43.315Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T03:49:06.434Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T03:49:36.380Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T05:01:59.974Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T07:33:53.994Z logview:info client connected from ::ffff:172.30.32.1
2018-08-17T07:36:09.655Z logview:info client connected from ::ffff:172.30.32.1
2018-08-18T00:30:25.730Z logview:info client connected from ::ffff:172.30.32.1
2018-08-18T01:36:46.873Z logview:info client connected from ::ffff:172.30.32.1

Also I don't know if this is related but I see this error in the HA log..

Log Details (ERROR)
Sat Aug 18 2018 11:35:45 GMT+1000 (Australian Eastern Standard Time)

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 230, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp/_http_parser.pyx", line 297, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

I tried this using the add-on in an iFrame as well as direct.
I am also using caddy as a reverse proxy.
Tried via my duckdns as well as direct ipaddress

All methods accept the login username and password I set.

How to filter logs for certain words/domains/entities/etc.?

Problem/Motivation

I need to trace certain logs from a certain logger.

Expected behavior

Specify log filtering based on grep(?) expression

Actual behavior

There's no documentation or setting which would allow me to do that.

Steps to reproduce

  1. Install addon

Proposed changes

Add documentation, or explicit configuration

Auth integration

Please integrate with the Auth integration so we don't have to specify a name and password in the config.
As an example you can look at the IDE add-on.

Proposal to improve the appearance

Proposed changes

I have a suggestion to improve the appearance a bit.

I played a little with CSS-styles. Displaying log lines without indentation bothered me. I also tried to make the scrollbar look like the look of Hassio itself.

Try adding my lines, I will be glad if they are included in the next release.

.log-line {
margin: 0px 5px 1px 5px; }
.log-line:first-child {
margin-top: 3px; }
.log .spacer {
height: 3px; }

div.log::-webkit-scrollbar {
width: 0.8rem; }
div.log::-webkit-scrollbar-thumb {
border-radius: 6px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8); }
div.log::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 8px rgb(210, 210, 210); }

No log black windows

Problem/Motivation

My windows is black and no log.
Wath ia have to specifiyng in networking?

(Why the issue was filed)

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Ingress error upon loading Log viewer

Problem/Motivation

(Why the issue was filed)

every time I open the Log viewer in a Mac Safari browser, (HA 2021.5b5 now, Home Assistant OS) these errors are logged (note this is for 1 click... and Chrome and Firefox are fine):

2021-05-02 14:16:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 57, in _handle
    return await self._handle_request(request, token, path)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 187, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable
2021-05-02 14:16:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 57, in _handle
    return await self._handle_request(request, token, path)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 187, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable
2021-05-02 14:16:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 57, in _handle
    return await self._handle_request(request, token, path)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 187, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable
2021-05-02 14:16:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 57, in _handle
    return await self._handle_request(request, token, path)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 187, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable
2021-05-02 14:16:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 57, in _handle
    return await self._handle_request(request, token, path)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 121, in _handle_request
    source_header = _init_header(request, token)
  File "/usr/src/homeassistant/homeassistant/components/hassio/ingress.py", line 187, in _init_header
    connected_ip = ip_address(request.transport.get_extra_info("peername")[0])
TypeError: 'NoneType' object is not subscriptable

Expected behavior

(What you expected to happen)

No error

Actual behavior

(What actually happened)

Steps to reproduce

A mere click in the left side menu on Log viewer

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Log Viewer will not start

Problem/Motivation

(Why the issue was filed)
Log viewer add-on will not start
Uninstalled, reinstalled
Restarted Home Assistant

Expected behavior

(What you expected to happen)

Actual behavior

(What actually happened)

Steps to reproduce

(How can someone else make/see it happen)

Proposed changes

(If you have a proposed change, workaround or fix,
describe the rationale behind it)

Info from the log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh

Add-on: Log Viewer
Browser-based log utility for Home Assistant

Add-on version: 0.14.0
You are running the latest version of this add-on.
System: Home Assistant OS 8.5 (amd64 / generic-x86-64)
Home Assistant Core: 2022.8.7
Home Assistant Supervisor: 2022.08.6

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/nginx.sh
cont-init: info: /etc/cont-init.d/nginx.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun logviewer (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
s6-rc: info: service legacy-services successfully started
[08:36:37] INFO: Starting Log Viewer...
2022-09-09T12:36:37.696Z logview:debug start tailing /config/home-assistant.log
2022-09-09T12:36:37.699Z logview:info listening on port 4277 (HTTP)
[08:36:37] INFO: Starting NGINX...

Feature Request: Ability to add test entry to log file (so you know for sure that you're viewing the live log)

It's very handy to be able to view the log in the UI sometimes, but when the log is empty it's hard to know for sure if the log file has actually loaded, or if HA or the add-on are having issues and the log just isn't displaying.

For me personally, if I go to the Log Viewer and there are no messages, it makes me think that it might not actually be opening the log file, and I then have to open a terminal so I can to view the log file manually and confirm that it is in fact empty.

I think it might be helpful to some users if in addition to the existing buttons in the bottom right-hand corner of the screen, that there was also a button to add a test line to the log file, so you can confirm that you are in fact viewing the log file.

Disconnected/Retry Loop using any browser on a Mac

I installed v3.0 of Log Viewer on Hass v0.80.3. The install seemed to go without issue, and I can connect to the defined port using any current browser (Safari/Firefox/Chrome). However in all cases, I get a 'Disconnected" then a “Retry in 3s…” count down before looping back to “Disconnected” and “Retry” again. Restarting either the Log Viewer, or Home Assistant produces the same.

Any thoughts as to what I might be doing wrong, or how to debug the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.