How do I recover HA from the Recovery mode ? I have back ups but they are not visible in recovery mode.
Received this error code.
Log details (ERROR)
Logger: annotatedyaml.loader
Source: util/yaml/loader.py:61
First occurred: 11:43:34 (6 occurrences)
Last logged: 11:44:48
while parsing a block collection in “/config/automations.yaml”, line 1, column 1 expected , but found ‘?’ in “/config/automations.yaml”, line 3, column 1
Hi, as I can no longer log in to HA, is this what you asked for?
in “/config/automations.yaml”, line 1, column 1
expected , but found ‘?’
in “/config/automations.yaml”, line 3, column 1[0m
[31m2025-04-03 11:17:17.968 ERROR (MainThread) [homeassistant.bootstrap] Failed to parse configuration.yaml: while parsing a block collection
in “/config/automations.yaml”, line 1, column 1
expected , but found ‘?’
in “/config/automations.yaml”, line 3, column 1. Activating recovery mode[0m
Looks like you may have an errant question mark character (?) at the beginning of your /config/automations.yaml. Use vi or nano or whatever text editor you prefer and remove that question mark (possibly along with some other errant characters following the question mark), save, reboot, should be good.
BTW i am just some random person. I may be 100% wrong, but what I wrote here is suggested by the error mesage posted here
As I can no longer login to HA via homeassistant.local:8123 has the URL changed? I am currently in the HA CLI but not having much luck there either, but it does confirm that the URL is correct.
IP. 192.168.1.107/24
OS Version. 15.1
HA Core. 2025.4.0
Managed to get back into HA and attempted to restart in Safe Mode but still get the same error message, Failed to restart Home Assistant
The system cannot restart because the configuration is not valid: Error loading /config/configuration.yaml: while parsing a block collection in “/config/automations.yaml”, line 1, column 1 expected , but found ‘?’ in “/config/automations.yaml”, line 3, column 1
I have searched in File Editor for these Yaml errors but found nothing. Any thoughts?
If you got into HA, go to add-on and add a new add-on from the add-on store (or whatever it’s called). You want to add the File Editor add-on. After you’ve added the File Editor add-on, start the File Editor addon. You need to find the file named “automations.yaml” which is described in your error message above as residing inside a folder named “config” but you likely won’t see this folder named “config.” File Editor will show you that you’re in a folder called “/homeassisant”
If you are not in folder “/homeassistant” when you start file editor, use the left arrow (circled in red in my screenshot on here) next to whatever folder name you see where my screenshot shows “/ homeassistant” (also circled in red.)
Viewing folder “/homeassistant” you’ll see “configuration.yaml” (again, circled in red). Click on configuation.yaml and your file contents will load in the text area to the right. My screenshot indicates a pair of brackets below, a heading of /homeassistant/automations.yaml, circled in red. I had file automations.yaml open when i did my screenshot. Having zero automations, the file contains just the emptry brackets .
My brackets are on line 1 (of 1) of my automations.yaml. You’ll be looking at your coniguration.yaml. You’ll have more than 1 line, meaning more than 1 line number (1).
Your error message indicates that on line number 3 you have a question mark character ? that is not where it should be (or perhaps is not formatted is it should be). Maybe you used a UI for some automation and did not know what to put an input box so you typed a “?” to remind yourself to come back later? (i mean probably not, but you get the idea, that’s how it could have got in there. You typing a ? plus also whoever wrote the automation UI you used didn’t hanlde the ? correctly such that it could be saved into automations.yaml as a ? that is data (meaning you, the user, typed it) rather than schema (meaning it’s part of the yaml structure / file setup markers / has special meaning to the thing that read YAML files)
If you’re not real sure about things such as this YAML, you can use “dev tools” which i believe are also an “Add On.” In “dev tools” there’s a button you can press to test your configuration which, when pressed, tells you if your configuration is valid and HA can reload okay or if your configuration is broken (like your apparent “?” is breaking it) and HA won’t be able to read it and thus won’t reload. This would allow you to try getting rid of your errant “?” from configuration.yaml file and then pushing a button to see if it’s fixed (versus reloading to find out it still won’t reload)
Suggestion to HA folks: Maybe check config for all users prior to reload/restart and tell them it’s broke and HA isn’t going to restart, so don’t restart it and seek help.
My pairs of brackets in the post above look like squares. I guess pair-of-brackets means “make a square” on this bulletin board. My pair of brackets are a [ and a ]
Hi Chris, thank you for your detailed response to my problem. It was really appreciated.
I have checked the /homeassistant/automations.yaml but could not find any ?.
I have attached a copy of the code which is in that folder.
id: ‘1737217250654’
alias: Import Energy Tariff Change - Intelligent Octopus Go
description: “”
trigger:
platform: state
entity_id:
binary_sensor.octopus_energy_intelligent_dispatching
from: “off”
to: “on”
variables:
tariff: offpeak
platform: state
entity_id:
binary_sensor.octopus_energy_intelligent_dispatching
from: “on”
to: “off”
variables:
tariff: peak
condition:
action:
YW. Ok so semi-wild guess here but it could be the Mircosoft Word looking double quotation marks, unless those are somehow markup added by and/or coming from this bulletin board.
On your first line, id, there are single tick quotation marks around 1737217250654. Those can’t hurt but tick marks (quotations) aren’t normally needed around numbers. They’re needed around strings
Strings such as Import Energy Tariff Change - Intelligent Octopus Go
You could try placing single tick quote marks around Import Energy Tariff Change - Intelligent Octopus Go such that the alias line becomes alias: 'Import Energy Tariff Change - Intelligent Octopus Go'
After that, the double-tick quotation marks (as I see them on here) for description (which is an empty string), from, to, another from, another to, and option fields are the kind of quotation marks where the first, opening mark(s) kind of point downard and the other, closing marks kind of point up. Those quote marks are normally not appreciated by computers. You could try replacing all of those with single tick quote marks ’ or plain double-tick " marks. Probably either kind, single of plain double (plain vs up & down looking ones), would probably work as long as you keep with it for open and close marks and for all five places.
I’d say first thing, add quote marks around the string on line 2 and see if that fixes it.
It’s (unlikely but) possible HA doesn’t care about which kind of double-tick quote marks are used.
But on line 2 that string needs to be inside quote marks in every format i’ve user seen computers consume
Platform: state may or may not require quote marks, but I bet not. state is probably defined special to represent some value, so it’s probably not really a string even though it looks like a string at a glance
Francis point about it possibly being indentation is true. Indentation looks okay to me as I see it, but yeah it’s got formatting/styling by this bulletin board so we can’t be certain indentation is okay. (Their post shows how to add your config without this board styling/formatting it.) Plus the HA code would have to be super messed up to do intentation incorrectly *within * one block of settings. Typically with this config/data, indentation wouldn’t be done incorrectly (by any HA code / coder) prior to where indentation is first used which is platform: state being the first piece of the trigger
Yeah, aliascould be a piece of id, and descriptioncould be a piece of alias and that would necessitate identation, but that doesnt pass the smell test. id, alias and description are typically 3 different things.
I guess also there’s some chance that description being empty could an issue. Unlikely, but possible. Might as well add some description (a string of your own invention) in the quote marks.
Hi Chris, I had recently changed my Octopus tariff from Flux to Intelligent Go, this appears to have been the root cause. I went back to the original Octopus code and re-installed it, everything is now back up and running. Thank you so much for your assistance and pointing me in the right direction, I thought I was going to lose the last 2 years of data.
I now realise that I shall have to save my backups outside of HA.