-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to save configuration with protocol V1 & V2 #209
Comments
I'm not understand why you got one more question:
|
@wuwentao
|
Little update: reverting back to v0.4.0 no problem in saving the configuration. Maybe an issue with |
could you answer previous question? it's only both different python path lib, and HA install ENV should be a important part from the error message. |
I have a similar permission issue, logs below. The error only happens when using Linuxserver's version of Homeassistant, it does not happen with Homeassistant's official docker image.
|
I did not edit any permissions on HA or my OS. Is it maybe due to the fact that I am using Homeassistant Core in a venv? The fact that HA tries to write to / instead to /tmp is maybe due to that empty string (looking at
@wuwentao Which kind of Homeassistant do you have? HA supervised, OS or Core? From @PandaDriver156 issue, the Linuxserver version uses also HA Core like me. Edit: maybe found the bug. In:
passing |
Thx a lot for your help. |
Just saw that also in |
thanks, just checked with it, it's not the same func, save_json using |
It seems to be an issue since an exception is thrown, but it is not if Edit: not a fatal error; the plugin loads correctly and works, but still an error while deleting and adding again a device for which the configuration has been already saved on |
This is a different error message and needs a new issues. |
yes, from the error log, this is a event loop warning....
as it not support blocking call to open file, and it's a known issue, but may not impact feature with WARNING now, and still need to fix, but not a urgent issue, we may need to track it with new issue in future |
HA core version
2024.7.1
Integration version
0.4.3
Device type and model
Ariston DEOS 16s
Used App
MSmartHome
The description of problem
Dear all,
when trying to save the manual configuration for appliance, it cannot save it. It seems that a temporary file is saved at root location before saving the effective configuration file. The device authentication phase is successful. I provide the log of the issue (debug log enabled)
The logs
2024-07-07 17:21:33.032 DEBUG (MainThread) [midealocal.device] [31885837206704] Connecting to 192.168.1.240:6444
2024-07-07 17:21:33.038 DEBUG (MainThread) [midealocal.device] [31885837206704] Connected
2024-07-07 17:21:33.038 DEBUG (MainThread) [midealocal.device] [31885837206704] Authentication success
2024-07-07 17:21:33.038 DEBUG (MainThread) [midealocal.device] [31885837206704] Status update: {'available': True}
2024-07-07 17:21:33.040 ERROR (MainThread) [homeassistant.util.file] Saving file failed: 31885837206704.json
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/file.py", line 56, in write_utf8_file
with tempfile.NamedTemporaryFile(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/tempfile.py", line 582, in NamedTemporaryFile
file = _io.open(dir, mode, buffering=buffering,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/tempfile.py", line 579, in opener
fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/tempfile.py", line 256, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/tmpt1mx85_k'
2024-07-07 17:21:33.041 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/file.py", line 56, in write_utf8_file
with tempfile.NamedTemporaryFile(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/tempfile.py", line 582, in NamedTemporaryFile
file = _io.open(dir, mode, buffering=buffering,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/tempfile.py", line 579, in opener
fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/tempfile.py", line 256, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/tmpt1mx85_k'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
resp = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/ban.py", line 85, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/data_entry_flow.py", line 368, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/data_entry_flow.py", line 415, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/data_entry_flow.py", line 518, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/homeassistant/.homeassistant/custom_components/midea_ac_lan/config_flow.py", line 467, in async_step_manually
# save device json config when adding new device
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/homeassistant/.homeassistant/custom_components/midea_ac_lan/config_flow.py", line 126, in _save_device_config
record_file = storage_path.joinpath(f"{data[CONF_DEVICE_ID]!s}.json")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/helpers/json.py", line 198, in save_json
method(filename, json_data, private, mode=mode)
File "/srv/homeassistant/lib/python3.12/site-packages/homeassistant/util/file.py", line 66, in write_utf8_file
raise WriteError(error) from error
homeassistant.util.file.WriteError: [Errno 13] Permission denied: '/tmpt1mx85_k'
The text was updated successfully, but these errors were encountered: