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

NoneType object has no attribute split #83

Closed
mikejgray opened this issue Jun 7, 2023 · 10 comments
Closed

NoneType object has no attribute split #83

mikejgray opened this issue Jun 7, 2023 · 10 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@mikejgray
Copy link
Contributor

 09:55:26.668 - skills - ovos_utils.events:on_error:266 - ERROR - An error occurred executing the scheduled event 'NoneType' object has no attribute 'split'
Traceback (most recent call last):
  File "/home/neon/venv/lib/python3.7/site-packages/ovos_utils/events.py", line 100, in wrapper
    handler()
  File "/home/neon/venv/lib/python3.7/site-packages/skill_ovos_homescreen/__init__.py", line 233, in update_dt
    day_string, month_string = self._split_month_string(self.datetime_api.get_month_date())
  File "/home/neon/venv/lib/python3.7/site-packages/skill_ovos_homescreen/__init__.py", line 399, in _split_month_string
    month_string = month_date.split(" ")
AttributeError: 'NoneType' object has no attribute 'split'

Mark 2, Neon, v0.0.2

@JarbasAl JarbasAl added the bug Something isn't working label Jun 7, 2023
@mikejgray
Copy link
Contributor Author

Looks like here: https://github.com/OpenVoiceOS/skill-ovos-homescreen/blob/9bd6058cade10f88893fc6a9650797e3e476475d/__init__.py#L232

It doesn't handle the possibility that self.datetime_api.get_month_date() could return NoneType. I don't have enough understanding of the way these all interact to suggest where the handling should occur, though.

@JarbasAl
Copy link
Member

JarbasAl commented Jun 28, 2023

datetime api is for when a skill provides the date (eg, stardate skill)

if a skill returns None then that would be a bug in the skill providing the api

using the api is also not default behaviour of the skill, not sure why neon is doing it and what skill is providing the date?

@NeonDaniel
Copy link
Member

skill-date_time is providing the string in Neon since that was the original design for the homescreen. I do prefer the API since it puts all of the formatting in one skill config (AM/PM, 12/24-hour format, etc.).

@JarbasAl
Copy link
Member

skill-date_time is providing the string in Neon since that was the original design for the homescreen. I do prefer the API since it puts all of the formatting in one skill config (AM/PM, 12/24-hour format, etc.).

the same config should be passed to LF, if it isnt this is just masking another bug....

there is absolutely no reason to use a skill unless you want something like a stardate, it just introduces latency

checking the time should not need a third party app and an exchange of bus messages, just check the damn clock directly

the exact same code is supposed to be running in datetime skill, there should be no difference in behaviour and if there is please open an issue

@JarbasAl
Copy link
Member

side note: if it wasnt for the very specific easter egg of a stardate skill for fun, i would recommend removing support for a skill api in here completely, this choice never made sense to me, even the stardate use case is a justification i came up with after the fact to justify keeping it around, 0.000001% of users will care about this

@JarbasAl JarbasAl added the wontfix This will not be worked on label Jun 29, 2023
@mikejgray
Copy link
Contributor Author

mikejgray commented Jun 29, 2023

Well, before you shut this down entirely @JarbasAl , I removed the datetime_skill key and value from the skill's settings.json file and the clock is still not updating. Here's the registration with the last time the time updated:

2023-06-28 19:04:53.256 - skills - ovos_utils.gui:show_pages:821 - DEBUG - Updating gui data: {'wallpaper_path': '/home/neon/.local/share/neon/filesystem/skills/skill-ovos-homescreen.openvoiceos/wallpapers/', 'selected_wallpaper': 'neon_default.jpg', 'system_connectivity': 'offline', 'notification': {}, 'notification_model': [], 'applications_model': [{'name': 'Home Assistant', 'thumbnail': '/home/neon/.local/share/icons/ovos-phal-homeassistant.svg', 'action': 'ovos-PHAL-plugin-homeassistant.home'}, {'name': 'OCP', 'thumbnail': '/home/neon/.local/share/icons/OCP.png', 'action': 'ovos.common_play.home'}], 'dashboard_model': {'collection': [{'id': '20f1af76-edb8-472c-8e31-62800ac0e64c', 'url': 'file:///home/neon/.local/share/neon/filesystem/skills/skill-ovos-homescreen.openvoiceos/DemoCard.qml', 'cellHeight': 5, 'cellWidth': 5}]}, 'persistent_menu_hint': True, 'time_string': '9:04', 'date_string': '6/28/2023', 'weekday_string': 'Wednesday', 'day_string': '28', 'month_string': 'June', 'year_string': '2023', 'skill_examples': {'examples': ['What are you?', 'Permit transcriptions.', 'open the pod bay doors', 'Ask chat GPT what an LLM is', 'Talk to chat GPT', 'When is my next alarm?', 'My email address is...', 'Play Charles Mingus', 'Require wake words.', 'Use limited responses.', 'Snooze for 1 minute.', 'Tell me my name.', 'I want you to exit.', 'What can you do?', 'What is the stock price for Microsoft?', 'first law of robotics', 'Change my timezone to London.', 'Play music.', 'Random Wikipedia.', 'No secondary language.', 'Search for chocolate.', 'current stardate', 'Translate hello to Polish.', 'Play classical music.', 'Snooze.', 'Show me the demo.', 'Play the tv show Star Trek the Next Generation on Plex', 'Use imperial units.', 'Create a support ticket.', 'Remind me to take out the trash every thursday at 7 PM.', 'Disable audio recordings.', 'How do you spell bureacracy?', 'What are my reminders?', 'My name is...', 'Go to sleep.', 'How far away is the moon?', 'Tell me your IP address.', 'what would arnold say', 'Check for updates.', 'Send me the source for that.', 'I will speak to you in Spanish.', 'Who made you?', 'Set a 5 minute timer.', 'Remind me to go home at 6.', 'What is your name?', 'how many languages do you speak', 'When were you born?', 'Who are you?', 'Change my units to metric.', 'Set an alarm for 8 AM.', 'Who won best picture in 2006?', 'Disable transcriptions.', 'Translate thank you to Ukrainian.', "Repeat I can say anything you'd like!", 'Switch to beta releases.', 'Change my time format to twelve hour time.', 'Update my default configuration.', 'Enable audio recordings.', 'Talk to me slower.', 'Stop.', 'What time is it?', 'I want you to shut down.', 'do you like portal', 'Create a new boot drive.', 'Email me a copy of our conversation', 'What time is it in Paris?', 'Navigate to google.com', 'What did I miss?', 'Change to stable updates.', 'Tell me my email address.', 'Tell me about beans.', 'how to play rock_paper_scissors_lizard_spock', 'Play local music.', 'Play electronic music.', 'Take a picture.', 'What is the weather in Los Angeles?', 'Disable LLM fallback skill', 'How fast is my internet?', 'What is the forecast for Friday?', 'What is the share price for Amazon?', 'Explain quantum computing in simple terms', 'Delete my profile.', 'My birthday is...', 'Where are you?', 'Cancel all timers.', 'Browse to neon.ai', 'Disable hesitation.', 'Cancel my 8 AM alarm.', 'What is 2 + 2?', 'Change my first name to Daniel.', 'How do you spell aardvark?', 'Tell me my first name.', 'Tell me my language settings.', 'Change my location to Seattle.', 'Spell succotash.', 'Change my preferred name to Dan.', 'Tell me about the Pembroke Welsh Corgi.', 'Do you have any updates?', 'Create a troubleshooting package.', 'Use standard responses.', 'Wake up.', 'Talk to me faster.', "What's the date?", 'Speak to me in French.', 'what would duke nukem say', 'Check Wikipedia for beans.', 'Say Goodnight, Gracie.', 'Where am I?', 'Tell me my license.', 'Start quiet hours.', 'Change my secondary language to Ukrainian.', 'What is my public IP address?', 'Cancel all alarms.', 'Enable LLM fallback skill', 'How much time is left?', 'How are you?', 'Skip wake words.', 'Tell me my skills.', 'what would HAL 9000 say', 'Tell me my last name.', 'Did I miss anything?', 'Erase all pictures.', 'Where were you born?', "What's your IP address?", 'Play Mozart.', 'Play Jamie Cullum on Plex', 'Clear my user transcriptions.', 'Tell me the day of the week.', 'Change my primary language to German.', 'what would bender say', 'Talk to me normally.', 'what would glados say', 'Play the movie Ghostbusters', 'Spell omnipotence.', 'Play Star Trek the Next Generation on Plex', 'What is your email address?', 'Enable hesitation.', 'Tell me about Elon Musk.', 'Play the movie Ghostbusters on Plex', 'I want you to restart.', 'Cancel all reminders.', 'Change my time format to military time.', 'Run a speed test.', 'Play jazz.', 'Tell me my username.']}, 'skill_info_enabled': 1, 'skill_info_prefix': False, 'rtl_mode': 0, 'dateFormat': 'MDY', '__from': 'skill-ovos-homescreen.openvoiceos'}

I see a number of these, one per second right up until 9:04

2023-06-28 19:04:42.694 - skills - neon_utils.skills.neon_skill:schedule_event:386 - DEBUG - Made a datetime: 2023-06-29 19:04:42.690722-07:00

Then they stop entirely once the "Mycroft is ready" event is emitted.

If I'm not specifying datetime_skill then shouldn't it just work?

@mikejgray
Copy link
Contributor Author

The events from Neon may be a red herring btw, I don't know what the default behavior is supposed to be in this skill, I just see some kind of relationship between the two

@NeonDaniel
Copy link
Member

The events from Neon may be a red herring btw, I don't know what the default behavior is supposed to be in this skill, I just see some kind of relationship between the two

I think there are potentially 2 issues being discussed here.

  1. What happens when the Skill API times out and how is that handled.
  2. What might cause the scheduled clock updates from continuing.

@NeonDaniel
Copy link
Member

I believe the remaining issues are resolved by OpenVoiceOS/ovos-bus-client#45

@JarbasAl
Copy link
Member

i believe this one can be closed, if not please reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants