Comments (7)
The Error comes from ifaddresses(interface)[AF_INET]
and AF_INET is a constant with the value of 2.
This looks like the system has no ipv4 address.
Does it happen directly after a system start and the ip stack is not completely initialized?
Can it be, that no dhcp address is assigned to the system yet?
If we just catch the error, should the function just return an empty list?
from smarthome.
Hm. No. The basic system ist running for some weeks now and I do have an IP4 adress. Yesterday the error occurred twice while using the admin interface (looking at logics, logs and items)
from smarthome.
I caught the exception and log a warning. Could you elaborate on your environment (os, python version, ...)?
from smarthome.
This is the log entry:
2024-04-24 19:14:23 WARNING lib.utils get_all_local_ipv4_addresses: Exception 2 - {17: [{'addr': '06:af:73:fe:f7:11', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]}
Running Python 3.9.2 on Linux (5.10.0-27-amd64 #1 SMP Debian 5.10.205-2 (2023-12-31) x86_64 GNU/Linux)
from smarthome.
Ok, there seems to be an interface that has no ipv4 address (AF_INET, which is 2) and no ipv6 address (AF_INET6, which is 10)
I added further info to the logging. Could you test again and post the (multiline) log entry?
from smarthome.
This results in:
2024-04-26 06:54:56 WARNING lib.utils get_all_local_ipv4_addresses: Exception 2
- interfaces=['lo', 'eno1', 'wlo2']
-act. interface=wlo2
-act. interface data={'lo': {17: [{'addr': '00:00:00:00:00:00', 'peer': '00:00:00:00:00:00'}], 2: [{'addr': '127.0.0.1', 'netmask': '255.0.0.0', 'peer': '127.0.0.1'}], 10: [{'addr': '::1', 'netmask': 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'}]}, 'eno1': {17: [{'addr': '1c:69:7a:a4:9c:0d', 'broadcast': 'ff:ff:ff:ff:ff:ff'}], 2: [{'addr': '192.168.20.13', 'netmask': '255.255.255.0', 'broadcast': '192.168.20.255'}], 10: [{'addr': 'fe80::1e69:7aff:fea4:9c0d%eno1', 'netmask': 'ffff:ffff:ffff:ffff::/64'}]}, 'wlo2': {17: [{'addr': 'da:81:02:8b:0d:37', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]}}
- {17: [{'addr': 'da:81:02:8b:0d:37', 'broadcast': 'ff:ff:ff:ff:ff:ff'}]}
from smarthome.
I have pushed a fix (and removed the logging)
from smarthome.
Related Issues (20)
- structs not checked for wrong configurations? HOT 1
- Issue with smartdeviceplugin with UTF-8 response HOT 1
- Requirements von Logiken und Userfunctions installieren beim Start? HOT 7
- Websocket crashed HOT 4
- Vorschlag zum besseren Handling von Items mit Datentyp 'dict' oder 'list' HOT 25
- Websocket Exceptions HOT 4
- struct names are applied to items including the struct
- Visu subscription of a memory log activates sending of env.core.log HOT 5
- smarthome/doc/user/source/beispiele/eval.rst Beispiel "Enumeration über Liste" funktioniert nicht HOT 1
- Log configuration: allow placeholders for filename and rotate correctly HOT 1
- Delay in scenes HOT 4
- Problem when Item has the same name as a class Item method HOT 5
- Http module cannot bind on all interfaces
- Incompability to paho-mqtt-2.0.0 HOT 1
- Usage of logging.default.yaml HOT 7
- Problem bei max python Version zum Start? HOT 5
- Item Funktionen in der plugin.yaml? HOT 14
- Darstellung von Paketversion falsch mit Paketen für die ``<`` gilt - Beispiel paho-mqtt HOT 2
- Subscribed item properties should be updated on the websocket HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarthome.