Several days ago my system crashed due to a bad SD card. (Running Hass.io on RPi4)
Unfortunately when I attempted to recover from a recent snapshot I found that the snapshot had failed to backup the homeassistant core area (not sure why this happened and I have not found the right log to look in yet). I will address that problem sometime in the future.
I was successful in making a new install on a fresh SD card. I was able to restore what was in the snapshot. I was still able to read the homeassistant folder on the old SD card and had copied it. I then manually copied files from the old homeassistant folder to the new system via Samba.
The good news: Everything is up and running and I did not loose all of my front end configuration work.
The bad news: The only thing that is not working is the âCore Configuratorâ add-on. When I open it, it returns a 401 Unauthorized error.
I stopped and restarted it - no change.
I uninstalled and reinstalled - no change.
I rebooted the host - no change.
The log from HA CLI add on logs are as follows:
The xxxxxxx in the last line of the log looks like it is a secret of some kind so I did not include. Any ideas on next steps to fix this? I believe something I did with copying the files with SAMBA is the cause, but I donât know what.
Also, Configurator shows no files available to edit. So it looks like it does not have the right permissions to access the config folder.
Can you try it with a different browser or in whatever private mode your browser has? The configurator memorizes the last location that it has accessed. If this location isnât present anymore after your crash that could be a problem. Using a fresh browser will result in accessing the base directory.
Thanks for the suggestion. I am typically a Chrome user. I tried in an Incognito window with same result. I also tried with Safari with the same result. Later today I will reboot my iMac (it has been weeks since I rebooted it) and check but I doubt it will make a difference.
I finally had a chance to do a cold restart of my iMac that I use to interact with HA. No change to the file configurator. Still get the 401 error. I have restarted HA Core and Supervisor multiple times with no change. Note, I can edit all of my config files via SAMBA with no issue. Being able to use the File Editor is a convenience not a necessity. My biggest desire is to find what is broken in my configuration so I can clean it up so it does not cause problems with a future update.
Iâm not sure where to get it. The 401 error shows up on the âFile Editorâ page itself with many pages of what looks like JSON or XML. What I shared is all that was in the supervisor logs. I can increase logging if the would help but I am not sure what to change to get increased logging on an Add-On.
Please make a screenshot and post it here so we can see what kind of error youâre actually getting. Because from what youâre saying the configurator works just fine, it just does not have access to open files, which might be due to different file permissions compared to before.
A screen shot is attached. I also believe it is a permissions issue. The logs indicate that the permissions are checked and passed but I donât think so.
Since I donât use hassio I canât exactly say where to look at. But the configurator requires an Access-Token to query the HASS API. With a standalone installation it would be this option, where you would configure a long-lived access token you can create in HASS. I believe hassio automates this under the hood to some degree, but I donât know about the details. In any case, thatâs the direction where you have to look I think.
When I use the external_url with SSL, I get this error. When I use the internal_url also with SSL (but invalid certificate), I donât get this error. I suspect this is a feature to prevent editing of the configuration file by external urls.
Iâm having the same issue. I thought installing the next version of supervisor would rectify the concern. Recently upgraded from 114 to 115.2, but am still having the result of 401: unauthorized when using the the task bar icon core configurator. I am successful with opening the file editor directly in the file editor add on open Web UI link. I am also successful when using a different web interface (Firefox). I cleared my cache in Chromium, uninstalled/reinstalled the add on, but this did not correct the problem. I donât see anything in my logs with respect to this issue. There appears to be some setting retained, as described by danielperna84, but Iâm not savvy enough to create long lived tokens, etc. Any insights appreciated.
I was able to get mine to work after the original failure but then it failed again the next time I upgraded core. I never did figure out the source of the problem but believe it may have something to do with http vs https. Ultimately I shifted to the Visual Studio Add-on. No issues with unauthorized access and a better IDE, so a much better solution. I am running on a x86 install now rather than an RPi4 like before but my understanding is that the Visual Studio Add-on now runs on the RPi4 so you may want to give it a try.
Iâve been running into the same problem after switching back from https to http due to lack of support for the Android mobile app of self-signed https.
To resolve this, I had to do all of the following:
ensure that no internal or external URLs are set in the configuration
remove File Editor using Supervisor
restart HA server
remove all related cookies from my browser
install File Editor using Supervisor
restart HA server
Not all steps might be crucial - I didnât experiment enough to find out what to leave out. However, together they did solve the 401 problem for me.
I set up local and remote access to my RPi4 Home Assistant using the instructions here and was getting the 401 error instead of the editor screen on my local laptop. I found simply clearing my cookies fixed the problem.
Note using this approach for local/remote access means I donât get the invalid certificate errors as I access locally using http, not https.