Closed BJReplay closed 3 weeks ago
I think I have some good news, @BJReplay and @florie1706.
I changed the solcastapi.py to use /options/[filenames]... and the permission errors went away.
It is likely that the file "solcast.json" will be similarly affected for linuxserver instances.
Why? Maybe the change to use aiofiles. Of that I am not certain, but it seems the most likely explanation. 🤷
I cannot be certain, because I have well busted through my API limit for today, because other testing, so solcast.json will not get created for my linuxserver install. But I bet that fails, too.
I will craft a commit for crash-testing.
Pull request will be submitted after a successful test, @florie1706.
Commit https://github.com/BJReplay/ha-solcast-solar/commit/2e8d961ef16ca1f1e3a638ebf0e01bb06a0a2c39 adds the /config/ path.
There are two changed files. __init__.py
and solcastapi.py
.
Note that I appear to have crossed some streams here. Still trying to work out how it happened, but 2e8d961 contains some other fixes that I'm actively testing in other branches. They seem fine so far, so test away. I blame GitHub desktop...
@autoSteve that did the trick, working as expected now :) Thank you so much.
I'll almost certainly release this in 4.0.32-beta1, @florie1706.
Because why? Because I am an idiot and included it with other changes that got wrapped in the same pull request. Like adjustments to handle having multiple accounts (shouldn't be a thing because Solcast T&C, so shhh! don't ask...), and prevention of inadvertent frequent Solcast forecast calls (weird happenstance, don't ask...), and handling of "tally" variable issues (don't ask, I hope I've got that one...).
Ugh. It is what it is.
Watch out for that beta+, but given that you manual install it likely won't impact you unless you update in future. But by then there'll be a release that covers this corner case for Docker.
I may regret this, but closing. It seems sorted for now -ish, well in the next release...
This error was first reported by @florie1706 in https://github.com/BJReplay/ha-solcast-solar/issues/32 at https://github.com/BJReplay/ha-solcast-solar/issues/32#issuecomment-2173672386
It can be repro'd with a fresh pull of linuxserver/homeassistant and a fresh manual install of BJReplay/ha-solcast-solar (and also a HACS manual install of ha-solcast-solar).
chmod 777 config within the linuxserver/homeassistant container doesn't resolve the issue.
To repro:
Create a new container - this created a new container for me, and mapped the default port onto 8124, and the config onto a host folder that I had created (hals).
I logged into the container, checked the directories, pulled the repro, and moved the ha-solcast-solar folder into custom components, and restarted HA (from the GUI - not shown).
No.
On restart, after configuring the integration with my API key, the following errors - as reported in the earlier issue - are recorded.
What do we know?
A brand new pull and set up of linuxserver/homeassistant and a brand new manual install of solcast repros.
It looks like there is a permissions problems - possibly with aiofiles.open for write. I note that linuxserver notes that: Rebase to alpine 3.19, upgrade to python 3.12. Restructure python packages so all packages are internal (no more venv in /config). Use upstream project's wheels. Due to an upstream issue, on first start of the newly updated container, some custom integrations may be disabled in HA due to missing dependencies. A subsequent container restart should fix that and the integrations should be re-enabled.
@florie1706 - if you can list any other integrations that you're using that are successfully writing config files to your config folder, that might help so we can see what they're doing.