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

Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f55e8c720> #615

Closed
Snuffy2 opened this issue Feb 11, 2024 · 13 comments · Fixed by #617

Comments

@Snuffy2
Copy link

Snuffy2 commented Feb 11, 2024

What version of Spook are you using?

v2.2.1

What version of Home Assistant are you using?

2024.2.1

The problem

I was seeing this error more in 2.2.0, but it is still appearing in v2.2.1 albeit less so. Not sure if it is affecting any functionality.

2024-02-11 15:54:53.468 ERROR (MainThread) [custom_components.spook] Unexpected exception from <function AbstractSpookRepair.async_activate.<locals>._async_inspect at 0x7f55e8c720>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 114, in _handle_timer_finish
    await task
  File "/config/custom_components/spook/repairs.py", line 149, in _async_inspect
    await self.async_inspect()
  File "/config/custom_components/spook/ectoplasms/automation/repairs/unknown_service_references.py", line 47, in async_inspect
    services=async_find_services_in_sequence(entity.action_script.sequence),
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spook/util.py", line 260, in async_find_services_in_sequence
    called_services.add(step[CONF_SERVICE])
                        ~~~~^^^^^^^^^^^^^^
KeyError: 'service'

Anything in the logs? Paste it here!

spook_log.log

@codyc1515

This comment was marked as resolved.

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

@codyc1515 Yours isn't the same / isn't related, and was fixed in the latest version. Please update :)

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

Hmmm @Snuffy2 Do you happen to use service_template in any of your automations?

../Frenck

@DarwinData
Copy link

I am using spook and really like it. I am getting this same error even after updating to 2.2.1 and HA core at 2024.2.1
fyi, I AM using service_template.
thanks for all of your work!

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

Thanks, @DarwinData that confirms my suspicions. Will ship a bug fix later tonight.

../Frenck

@DarwinData
Copy link

Thanks for the quick fix!

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

No problem ❤️

@Snuffy2
Copy link
Author

Snuffy2 commented Feb 12, 2024

I don't see any remaining use of service_template in my automations, scripts, switches, etc. but there may be some I'm missing. I'll gladly give #617 a try to see if it fixes it though.

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

@Snuffy2 Let me know! Otherwise, we'll keep digging 😄

@Snuffy2
Copy link
Author

Snuffy2 commented Feb 12, 2024

I grep'd the directory and apparently service_template is still being used by https://github.com/FutureTense/keymaster which I do use.

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

If that is the root cause, upgrading to Spook v2.2.2 should resolve your issue.

@Snuffy2
Copy link
Author

Snuffy2 commented Feb 12, 2024

Yep, v2.2.2 is working and I am no longer seeing the error in the logs. Thanks for the quick fix!

@frenck
Copy link
Owner

frenck commented Feb 12, 2024

Awesome! Thanks for letting me know ❤️

(and for reporting this issue in the first place of course 😄 )

../Frenck

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

Successfully merging a pull request may close this issue.

4 participants