10000 Python_script and config errors in 0.65 · Issue #13015 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Python_script and config errors in 0.65 #13015

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

Closed
point-4ward opened this issue Mar 9, 2018 · 18 comments · Fixed by #13024
Closed

Python_script and config errors in 0.65 #13015

point-4ward opened this issue Mar 9, 2018 · 18 comments · Fixed by #13024

Comments

@point-4ward
Copy link
Contributor
point-4ward commented Mar 9, 2018

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.65

Python release (python3 --version):
3.6.4

Component/platform:
Python_script:
Config:

Description of problem:
Since upgrade I get the following two errors, can't see any changes to either platform noted in the release notes, nor any changes in the documentation.

Interestingly, as far as I can see, config: is working, but python_script is not.

Expected:
No errors and working python_script

Problem-relevant configuration.yaml entries and steps to reproduce:

python_script:
config:

Traceback (if applicable):

2018-03-09 20:06:56 ERROR (MainThread) [homeassistant.config] Invalid config for [python_script]: expected dict for dictionary value @ data['python_script']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/python_script/

2018-03-09 20:06:56 ERROR (MainThread) [homeassistant.setup] Setup failed for python_script: Invalid config.

2018-03-09 20:06:56 ERROR (MainThread) [homeassistant.setup] Error during setup of component config
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/config/__init__.py", line 31, in async_setup
    for key, value in config.get(DOMAIN, {}).items():
AttributeError: 'NoneType' object has no attribute 'items'

Additional info:

Obviously the error for python script suggests it is now expecting a configuration option, but I don't know what? (or maybe the first error is because I have an automation with a python script in it, but that can't be parsed because the component isn't loaded?)

As I say, config seems to be working in spite of the error.

@kellerza
Copy link
Member
kellerza commented Mar 9, 2018

You are not running dev? Most likely your python_script component did not initialize...

It seems related to changes in #12792 where load was converted to return [] iso doing it in the config.

@point-4ward
Copy link
Contributor Author

No, not dev, just upgraded to the latest version after I got the new release notification.

I don't understand the rest of your message.

@kellerza
Copy link
Member
kellerza commented Mar 9, 2018

I don't understand the rest of your message.

Sorry, that was very cryptic! I thought the error was related to a change I made, but I cannot reproduce it on that part of the code. Will keep looking

kellerza added a commit to kellerza/home-assistant that referenced this issue Mar 9, 2018
kellerza added a commit to kellerza/home-assistant that referenced this issue Mar 9, 2018
@point-4ward
Copy link
Contributor Author

@kellerza - ha, probably not that cryptic, but way over my head. Thanks for the input and attempts at fixes, I'll let you know once they're merged 👍

balloob pushed a commit that referenced this issue Mar 9, 2018
balloob pushed a commit that referenced this issue Mar 10, 2018
@point-4ward
Copy link
Contributor Author

@kellerza & @balloob - 65.1 didn't fix this, still got the identical same errors.

@point-4ward
Copy link
Contributor Author
point-4ward commented Mar 10, 2018

... Just FYI (having looked at the comments in the PR), removing config: I still get the error on python_script: that it expected a dict, even though there are no configuration options for that component.

I have several other components that don't have any configuration options (ios and sun for a start), but these don't cause any errors.

@kellerza
Copy link
Member
kellerza commented Mar 10, 2018

Same Traceback? (as in the original issus comment)

@kellerza
Copy link
Member
kellerza commented Mar 10, 2018

Do you have either of these in "packages"? (specifically python_script)

@point-4ward
Copy link
Contributor Author
point-4ward commented Mar 10, 2018

Pasting the most recent reboot just to be sure, but I think it's identical...

2018-03-10 05:48:31 ERROR (MainThread) [homeassistant.config] Invalid config for [python_script]: expected dict for dictionary value @ data['python_script']. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/python_script/

2018-03-10 05:48:31 ERROR (MainThread) [homeassistant.setup] Setup failed for python_script: Invalid config.

2018-03-10 05:48:31 ERROR (MainThread) [homeassistant.setup] Error during setup of component config
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/setup.py", line 142, in _async_setup_component
    result = await component.async_setup(hass, processed_config)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/config/__init__.py", line 31, in async_setup
    for key, value in config.get(DOMAIN, {}).items():
AttributeError: 'NoneType' object has no attribute 'items'

And just to confirm, I have definitely upgraded to 65.1 😀

@point-4ward
Copy link
Contributor Author

Yeah, I have EVERYTHING in packages except ios: as that just gets ignored if I put it anywhere but configuration.yaml .

@point-4ward
Copy link
Contributor Author

... My whole config is on my GitHub if you need a look-see.

@kellerza
Copy link
Member

Ok, then I know what your error is. You can try 2 fixes for now:
Try add {} after python_packages like python_packages: {}
Move it out of packages for now

@kellerza kellerza reopened this Mar 10, 2018
@point-4ward
Copy link
Contributor Author

I take it you mean python_script: {} ?

Should I do the same with config: ?

@kellerza
Copy link
Member

If config: is in a package yes

You have some serious package use in your config!

@point-4ward
Copy link
Contributor Author

Ha, packages are how my brain works for configuring things 😂😂

Any idea why I can't put ios: in a package whilst I've got you? It's ruining my lovely clean configuration.yaml 😉

Adding the braces has fixed the errors, as always you guys are amazing!

I take it I can remove the braces next update after you've done some magic?

@kellerza
Copy link
Member

I can look into ios: for you, not sure. It's nice to see some of the work we do in action!

You should be able to remove braces after the merge of #13038

@point-4ward
Copy link
Contributor Author

Yeah, it's not a major issue, but basically if I put ios anywhere other than directly in to configuration.yaml it just gets ignored, no errors, just like it's not there.

Thanks for your prompt response and fixes to this 😊😊

And yeah, love the work on packages as you can tell, glad you got to see the fruits of your labours 👍

@kellerza
Copy link
Member

Try adding a {} to ios as well and moving it to a package, also: try hass --script check_config it should show you merge errors before and after the {}

If this works I'll try update #13038. This case is not covered for atm

balloob pushed a commit that referenced this issue Mar 10, 2018
* Ensure we have valid config AFTER merging packages #13015

* also fix packages
balloob pushed a commit that referenced this issue Mar 10, 2018
* Ensure we have valid config AFTER merging packages #13015

* also fix packages
@balloob balloob mentioned this issue Mar 10, 2018
@balloob balloob closed this as completed Mar 11, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants
0