trying to update appdaemon to latest version and getting tons of errors
and appdaemon not started.
I saved previous appdaemon image so when i change the image to old one
so when i downgrade back - all is working.
I’d like to update appdaemon to latest version but not sure
what to change in my configuration :
You need to correct your appdaemon.yaml, the configuration change quite a bit from 3 to 4. Check out my settings in another topic where I post a working appdaemon.yaml + docker-compose
2020-02-13 16:59:24.390235 INFO HASS: Connected to Home Assistant 0.104.3
2020-02-13 16:59:25.506390 INFO HASS: Evaluating startup conditions
2020-02-13 16:59:25.619084 INFO AppDaemon: Got initial state from namespace hass
2020-02-13 16:59:26.685269 INFO AppDaemon: Scheduler running in realtime
2020-02-13 16:59:26.693511 INFO AppDaemon: Adding /conf/apps to module import path
2020-02-13 16:59:26.701070 INFO AppDaemon: Loading App Module: /conf/apps/dahua_mqtt.py
2020-02-13 16:59:26.718158 WARNING AppDaemon: Unexpected error loading module: /conf/apps/dahua_mqtt.py:
2020-02-13 16:59:26.718658 WARNING AppDaemon: Removing associated apps:
2020-02-13 16:59:26.719152 WARNING AppDaemon: Dahua
2020-02-13 16:59:26.720614 INFO AppDaemon: App initialization complete
But not able to run the application i have in the config/apps,
from error.log:
2020-02-13 16:59:26.717624 WARNING Error: ------------------------------------------------------------
ModuleNotFoundError: No module named 'pycurl'
import pycurl
File "/conf/apps/dahua_mqtt.py", line 51, in
File "", line 219, in _call_with_frames_removed
File "", line 783, in exec_module
File "", line 671, in _load_unlocked
File "", line 975, in _find_and_load_unlocked
File "", line 991, in _find_and_load
File "", line 1014, in _gcd_import
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
self.modules[module_name] = importlib.import_module(module_name)
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 580, in read_app
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
response = future.result()
File "/usr/local/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 788, in check_app_updates
2020-02-13 16:59:26.716987 WARNING Error: Traceback (most recent call last):
2020-02-13 16:59:26.714239 WARNING Error: ------------------------------------------------------------
2020-02-13 16:59:26.713758 WARNING Error: Unexpected error loading module: /conf/apps/dahua_mqtt.py:
2020-02-13 16:59:26.713064 WARNING Error: ------------------------------------------------------------
2020-02-13 16:44:05.105237 WARNING Error: ------------------------------------------------------------
Something with this pycurl?
This coming from dahua_mqtt.py
which was working perfectly on AD3:
I thought it might be this one - I added it inside the AD container itself:
/usr/src/app/requirements.txt
Also create the requirements.txt as u suggest added the pycurl
with no change:
2020-02-13 17:35:18.990230 WARNING Error: ------------------------------------------------------------
2020-02-13 17:35:19.015446 WARNING Error: Unexpected error loading module: /conf/apps/dahua_mqtt.py:
2020-02-13 17:35:19.016081 WARNING Error: ------------------------------------------------------------
2020-02-13 17:35:19.019771 WARNING Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 788, in check_app_updates
await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
File "/usr/local/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
response = future.result()
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 580, in read_app
self.modules[module_name] = importlib.import_module(module_name)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/conf/apps/dahua_mqtt.py", line 51, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
Please note ,
Under the apps folder
I have another requirements.txt (which was originally in AD 3) with the content of:
Can you please try this? I’m also not sure whether it should be in the “apps” directory or in the same directory as “appdaemon.yaml”, try in both locations.
is there a different requirement for requirements.txt under config/apps
or under config?(right beside the appdaeomond.yaml)
or it actually doesn’t matter?
anyway , i copy the configuration as u suggest in both place ,
unfortunately no change:
2020-02-13 18:47:01.170525 WARNING Error: ------------------------------------------------------------
2020-02-13 18:47:01.169725 WARNING Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 788, in check_app_updates
await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
File "/usr/local/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
response = future.result()
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 580, in read_app
self.modules[module_name] = importlib.import_module(module_name)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/conf/apps/dahua_mqtt.py", line 51, in
import pycurl
ModuleNotFoundError: No module named 'pycurl'
only was i manage to overcome this annoying thing
is by install on appdaemond docker:
so if anyone else will face same issue ,
You need to enter the AD docker and do the installemet manually:
#get docker image by docker ls
docker exec -it 900b0167f8e9 sh
apk add curl-dev
pip3 install pycurl
I guess something with requiments.txt is not correct or missing…
Hopefully some1 can suggest better solution.
It is working now ,
but honestly got little tired of the AD,
I see 2 issues - the requirment.txt which suppose to simplify
the process - doesn’t work well .
(it doesn’t matter if the pycurl need more libraries or not- it just doesn’t work well)
Second ,what those namespace which added in AD v4?
I would expect it work with mqtt with minimum configuration … or at least see
it not able to publish to mqtt .
I wonder if there’s other option to work with dahua_mqtt.py without the appdemond …
hope some1 can make it work more natively.
@Avi_Cohen it looks like you have a requirements.txt which holds a config for a Homeassistant (former hass.io) Addon.
The content of your requirements.txt should just be
pycurl
Without any JSON markup or system_packages and so on.
Although I already solved by install the pycurl inside the AD container,
i remove it and tried u suggestion :
create requirements.txt inside the app folder with pycurl
no other requirements.txt.
boot the AD ended with error:
2020-02-27 20:57:22.504789 WARNING Error: ------------------------------------------------------------
2020-02-27 20:57:22.503758 WARNING Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 788, in check_app_updates
await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
File "/usr/local/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
response = future.result()
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 580, in read_app
self.modules[module_name] = importlib.import_module(module_name)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/conf/apps/dahua_mqtt.py", line 51, in
import pycurl
**ModuleNotFoundError: No module named 'pycurl'**
I was doing a clean HA installation and thought for updating this threads ,
nothing was run - all dockers were down ,
remove appdaemond docker + all appdaemond images ,
i place pycurl string in the
/Dockers/appdaemon4/config/apps/requirements.txt
start the docker-container - new image download and install:
log show error remain:
2020-03-28 23:30:56.588462 WARNING Error: Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 788, in check_app_updates
await utils.run_in_executor(self, self.read_app, mod["name"], mod["reload"])
File "/usr/local/lib/python3.8/site-packages/appdaemon/utils.py", line 276, in run_in_executor
response = future.result()
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/site-packages/appdaemon/app_management.py", line 580, in read_app
self.modules[module_name] = importlib.import_module(module_name)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/conf/apps/dahua_mqtt.py", line 51, in <module>
import pycurl
ModuleNotFoundError: No module named 'pycurl'
after installing the pycurl manually as explain few post above - it solved.