frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Error when adding new events from web interface (works from App)

Open Gordontgopher opened this issue 2 years ago • 10 comments

The problem

When I try to add an event to my local calendar I get an error; 2022-12-09 11:19:51.976 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547538714528] Error handling message: Could not parse date for dictionary value @ data['event']['dtend']. Got 'Invalid DateTInvalid Date' Could not parse date for dictionary value @ data['event']['dtstart']. Got 'Invalid DateTInvalid Date' (invalid_format) from 192.168.1.106 (Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36)

Adding events from the Android app (logged on as same user) is successful. App is beta-2982-956b2cc-full

What version of Home Assistant Core has the issue?

2022.12.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Local Calendar

Link to integration documentation on our website

https://www.home-assistant.io/integrations/local_calendar/

Diagnostics information

No response

Example YAML snippet

N/A

Anything in the logs that might be useful for us?

2022-12-09 11:19:51.976 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547538714528] Error handling message: Could not parse date for dictionary value @ data['event']['dtend']. Got 'Invalid DateTInvalid Date'
Could not parse date for dictionary value @ data['event']['dtstart']. Got 'Invalid DateTInvalid Date' (invalid_format) from 192.168.1.106 (Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36)

Additional information

System configured for GMT, Language is English (GB) and time format is Auto (use language setting). Error also occurs with all other options for user time format.

Gordontgopher avatar Dec 09 '22 11:12 Gordontgopher

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (local_calendar) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of local_calendar can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign local_calendar Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


local_calendar documentation local_calendar source (message by IssueLinks)

home-assistant[bot] avatar Dec 09 '22 11:12 home-assistant[bot]

@Gordontgopher You stated it works with the Android app, so that means where does it not work for you (browser and OS)? What are the inputs that you've put into the creation dialog form?

spacegaier avatar Dec 09 '22 15:12 spacegaier

Same issue. Date controls doesn't show up due to error.

Browser: Firefox 107 OS: linux

Top stacktrace

Uncaught (in promise) RangeError: date value is not finite in DateTimeFormat.format()
    c a8b2ec7d.js:1
    value ha-date-input.ts:59
    update app.f8884e15.js:1366
    performUpdate app.f8884e15.js:1366
    scheduleUpdate app.f8884e15.js:1366
    _$EC app.f8884e15.js:1366
    requestUpdate app.f8884e15.js:1366
    o app.f8884e15.js:1366
    b app.f8884e15.js:1366
    w app.f8884e15.js:1366
    F ha-chip.ts:85

image

PS: Also in mobile date and time picker also buggy. It increases input values by 1. When time is edited, the date is increased by 1 day. If date is edited, then time is increased by 1 hour.

SkeLLLa avatar Dec 10 '22 08:12 SkeLLLa

@SkeLLLa Sound to me like yours is a separate topic, because OP did not mention anything about missing input fields. Also you posted a frontend browser stacktrace, while OP posted one from the backend.

Are you on the same version as OP because we had fixed some issues with the date selector in 2022.12.1.

spacegaier avatar Dec 10 '22 09:12 spacegaier

@spacegaier I'm also on 2022.12.1. Frontend 20221208.0 - latest. And also it's reproduced only on desktop and works in mobile app.

And it's likely same or at least connected issues, since if I try to click add button, I receive same error on backend

ec 10 12:02:44 pi 06e5213971a9[1078]: 2022-12-10 12:02:44.159 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [281469895159440] Error handling message: Could not parse date for dictionary value @ data['event']['dten>
Dec 10 12:02:44 pi 06e5213971a9[1078]: Could not parse date for dictionary value @ data['event']['dtstart']. Got '12/10/2022T12:00:00' (invalid_format) from 172.68.238.147 (Mozilla/5.0 (X11; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0)

image

SkeLLLa avatar Dec 10 '22 10:12 SkeLLLa

@Gordontgopher You stated it works with the Android app, so that means where does it not work for you (browser and OS)? What are the inputs that you've put into the creation dialog form?

This is from my Chrome browser (same error on a Chromebook or Windows 10 machine.)

Screenshot 2022-12-11 13 57 47

Gordontgopher avatar Dec 11 '22 14:12 Gordontgopher

Updated the HA to 2022.12.4 with frontend version 20221212.0 and the bug on Firefox desktop is gone for me.

SkeLLLa avatar Dec 13 '22 16:12 SkeLLLa

I'm assuming this is related to my change to ha-date to append a timestamp to the date to fix the off by 1 day issue.

allenporter avatar Dec 16 '22 16:12 allenporter

Questions:

  • Are you folks using any particular browser language or locale settings? I have not yet been able to reproduce this.
  • Related, does changing the locale work to fix? Not that this is the solution, but helps narrow down the root cause

allenporter avatar Dec 17 '22 18:12 allenporter

@allenporter In my case the issue was reproducible on Firefox browser on windows and linux. In both systems I have en-US locale set by default. However on linux for time formatting I have LC_TIME=C as default. On windows I guess there's a customized format for dates and time, which is based on en-US.

I've didn't change the locale, however if it helps. In the same time when issue was present I've checked it in chrome browser on same machines and I was unable to reproduce it. In particular I've checked that on 2 laptops, running different versions of Firefox and different OS: Windows11, Ubuntu and Gentoo linux. In all cases chrome worked, firefox not. But after update of frontend to 20221212.0 this issue gone for me on all devices.

SkeLLLa avatar Dec 18 '22 23:12 SkeLLLa

Edit: apologies I had confusion due to multiple separate issues being discussed here, having trouble following all the separate details.

allenporter avatar Dec 26 '22 02:12 allenporter

I was thinking perhaps #14623 has fixed the original Invalid Date issue, but realize that may not be the case.

allenporter avatar Dec 26 '22 02:12 allenporter

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Mar 26 '23 03:03 github-actions[bot]