Skip to content
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

Multiple (>800) syntax errors found in working code after installation of HA addon code server 4.1.0 #1866

Closed
SirGoodenough opened this issue Jan 17, 2022 · 18 comments · Fixed by #1985
Labels

Comments

@SirGoodenough
Copy link

SirGoodenough commented Jan 17, 2022

Screenshot_2022-01-17_00-22-53

I updated The home assistant community addon and after this repo loads, I have ~800 lines of code that it says is not fitting the schema, like the pictures attached. All this yaml was fine with the prior version of the addon. I have rebooted and restarted the addon. I will be re-instaling it next, but it appears to be a problem that I think is here (not sure). The 4.1.0 version of the addon looked to be mainly an update to this software to add templates highlighting (which works in every file, btw...)
Opening all the yaml files, it showed over 800 syntax problems. My system restarts without error and the config checker passes with no errors, and none of this was there before the addon update, I'm informing you in case it a missed issue. I run Home Assistant Supervised Debian bullseye all patched up to date.

Removing and re-installing the the code server addon did not help.

Screenshot_2022-01-17_00-32-23

@kubawolanin
Copy link
Contributor

At a glance, it looks like a schema being out of sync, described in Troubleshooting wiki:

I get errors on my configuration but they're wrong
Fix this schema or logic yourself (read more) or create an Issue in this repository

https://github.com/keesschollaart81/vscode-home-assistant/wiki/HowTo:-Update-the-schema's

@frenck
Copy link
Collaborator

frenck commented Jan 18, 2022

For the release it is force built (so it cannot be out of sync):

https://github.com/keesschollaart81/vscode-home-assistant/blob/dev/.github/workflows/github-actions-vscode-extension.yml#L25-L26

This is an actual schema issue, however, I have not been able to pin-point the issue with it.
It seems like it is using the template integration schema at these places, although I do not understand why.

@SirGoodenough
Copy link
Author

This is really messing people up out there. I'm getting folks asking why all their code doesn't work because they don't understand where the magic is coming from.
I am telling them to override the home assistant extension with a YAML extension at present.

@tomlut
Copy link
Contributor

tomlut commented Jan 22, 2022

Interestingly this is not an issue using the Home Assistant Config Helper extension when using VSCode to edit files using the SAMBA Share addon (i.e. on a desktop PC editing the files remotely). Only when using the VSCode addon.

Don't know if that data point helps but thought I'd mention it.

@frenck
Copy link
Collaborator

frenck commented Jan 22, 2022

Interestingly this is not an issue using the Home Assistant Config Helper extension when using VSCode to edit files using the SAMBA Share addon (i.e. on a desktop PC editing the files remotely). Only when using the VSCode addon.

That is interesting though! Thanks!

This is really messing people up out there. I'm getting folks asking why all their code doesn't work because they don't understand where the magic is coming from.

I know, I've been returning to the issue a couple of times now to investigate, I fail to understand the source of the problem until now.

@tomlut
Copy link
Contributor

tomlut commented Jan 22, 2022

until now.

Sounds like you've had a eureka moment. Noice.

@schumi2309
Copy link

I hope you find the solution, because this is really annoying.
Courage to you.

@rrlevy
Copy link

rrlevy commented Feb 3, 2022

I have the same problem with the update:

image

@tomlut
Copy link
Contributor

tomlut commented Feb 3, 2022

"Me too" comments do not help. If you have the issue but have nothing new to add, then just thumb up the first post.

@drthanwho
Copy link
Contributor

Interestingly this is not an issue using the Home Assistant Config Helper extension when using VSCode to edit files using the SAMBA Share addon (i.e. on a desktop PC editing the files remotely). Only when using the VSCode addon.

I'm seeeing the same too using the Remote VSCODE addon from the Edge repo.

I can say for sure it's literally all my sensors, regadless if it's template integration or not. system_monitor, command_line, etc.

I have them as sensor: !include_dir_merge_list sensors/. If I instead remove this and add a couple of those sensors under sensor: in configuration.yaml then it doesn't complain for those anymore.

@tomlut
Copy link
Contributor

tomlut commented Feb 5, 2022

I'm seeeing the same too using the Remote VSCODE addon from the Edge repo.

"The same" as in you are not seeing the errors using edge repo?

@drthanwho
Copy link
Contributor

Hmm this is why I shouldn't be writing about github issues at these hours.

My bad. Meant to say that I'm instead seeing the same error as everyone else in the edge repo. (Was thinking in my head oh that's also technically another way to connect).

@SirGoodenough
Copy link
Author

It's been a month. At this point can we roll this back until there is a fix?

@OscarHanzely
Copy link

OscarHanzely commented Feb 25, 2022

Hmm, is this HA helper issue being addressed?

Maybe can I turn off the check somehow in meanwhile? it is annoying and hard to use as it is broken and completely not useful anymore.

@frenck
Copy link
Collaborator

frenck commented Feb 26, 2022

Feel free to join in to help fix this!

If this causes unusable problems, tab. Downgrading a version will do the trick.

@OscarHanzely
Copy link

OscarHanzely commented Feb 28, 2022

Unfortunately, I cannot be much help on typescript addons, if it would be python I would be looking through the PRs, even revived some old projects in my forks.

For anybody having big issues with this addon since upgrade like I did, downgrading the version solves the issue.

  1. Turn off any future automatic updates
  2. on supervised host just go to the location of the addons definition (in my case /usr/share/hassio/addons.json) find the vscode addon definition and there is version of the image. Just change it to "4.0.0"
  3. restart
  4. never upgrade again manually even if prompted that new release 4.1.0 is available

@frenck
Copy link
Collaborator

frenck commented Mar 23, 2022

I've been able to locate the source of the issue, which is a single line.
It seems that the schema generator mixed up Template Items from other Items.

Template is special, as it is used both as an integration but also as a platform. When generating the schema for the platforms (e.g., light) the loading of the template integration causes two Item definitions. Template wins. This looks like an upstream issue. I'm trying to work around it.

@frenck
Copy link
Collaborator

frenck commented Mar 23, 2022

Fixed, will get it shipped asap

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants