Started seeing Unknown Error: time data '2009-01-23 16:34:44 UT' does not match format '%Y-%m-%dT%H:%M:%S'
Closed this issue ยท 25 comments
Version Number
docker container latest
What branch are you on?
master
Describe the Bug
Starting seeing this error happen with collections.
Has something changed?
Critically Acclaimed Movies:
mdblist_list: https://mdblist.com/lists/stevezau/movies-critically-acclaimed
summary: "A collection of critically acclaimed movies."
template:
- name: shared
collection_section: "020"
visible_library: false
visible_home: false
visible_shared: false
| Critically Acclaimed Movies Collection | ? | Bright Leaves (2004) (TMDb: 41475) |
| Critically Acclaimed Movies Collection | ? | My Voyage to Italy (1999) (TMDb: 53198) |
| Traceback (most recent call last): |
| File "//kometa.py", line 842, in run_collection |
| radarr_add, sonarr_add = builder.run_missing() |
| ^^^^^^^^^^^^^^^^^^^^^ |
| File "/modules/builder.py", line 3033, in run_missing |
| movie = self.config.TMDb.get_movie(missing_id) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/modules/tmdb.py", line 267, in get_movie |
| return TMDbMovie(self, tmdb_id, ignore_cache=ignore_cache) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/modules/tmdb.py", line 115, in __init__ |
| super()._load(data) |
| File "/modules/tmdb.py", line 103, in _load |
| self.keywords = [k for k in data["keywords"].split("|") if k] if isinstance(data, dict) else [k.name for k in data.keywords if k] |
| ^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/objs/base.py", line 63, in __getattribute__ |
| self._load(None) |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/objs/reload.py", line 600, in _load |
| self.videos = self._parse(attrs=["videos", "results"], value_type="video", is_list=True) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/objs/base.py", line 92, in _parse |
| return self._tmdb._parse(data=self._data if data is None else data, attrs=attrs, value_type=value_type, |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py", line 169, in _parse |
| return [self._parse(data=v, value_type=value_type, default_is_none=default_is_none, key=key) for v in value] |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py", line 169, in <listcomp> |
| return [self._parse(data=v, value_type=value_type, default_is_none=default_is_none, key=key) for v in value] |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py", line 226, in _parse |
| return Video(self, value) |
| ^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/objs/base.py", line 20, in __init__ |
| self._load(data) |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/objs/simple.py", line 371, in _load |
| self.published_at = self._parse(attrs="published_at", value_type="date") |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/objs/base.py", line 92, in _parse |
| return self._tmdb._parse(data=self._data if data is None else data, attrs=attrs, value_type=value_type, |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py", line 190, in _parse |
| return datetime.strptime(value[:-1].split(".")[0], "%Y-%m-%dT%H:%M:%S") |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/_strptime.py", line 568, in _strptime_datetime |
| tt, fraction, gmtoff_fraction = _strptime(data_string, format) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/local/lib/python3.11/_strptime.py", line 349, in _strptime |
| raise ValueError("time data %r does not match format %r" % |
| ValueError: time data '2009-01-23 16:34:44 UT' does not match format '%Y-%m-%dT%H:%M:%S' |
| |
| Unknown Error: time data '2009-01-23 16:34:44 UT' does not match format '%Y-%m-%dT%H:%M:%S' |
| |```
### Relevant Collection/Overlay/Playlist Definition
_No response_
### Logs
_No response_
Same issue except '2014-02-13 15:55:44 UT' does not match format '%Y-%m-%dT%H:%M:%S'.
TMDB changed something this afternoon. There's a fix in progress and a workaround on the discord.
Would someone mind posting the workaround on here? Not everyone uses Discord
TMDB apparently made a change yesterday afternoon in their date format, causing Kometa runs to fail with:
[CRITICAL] | time data '2023-02-14 01:31:39 UT' does not match format '%Y-%m-%dT%H:%M:%S' |
Until the fix is incorporated in Kometa's TMDBAPI library, you can work around it in a couple ways.
Step 1: Download the python file which contains the fix:
<https://raw.githubusercontent.com/Kometa-Team/TMDbAPIs/refs/heads/date-format-change/tmdbapis/tmdb.py >
What you do next depends on whether you are runing in Docker or not.
If you are not running Docker:
Step 2: find the location of your copy of that file. You can find this is the log, next to the error:
| File "/THIS/WILL/BE/THE/LOCAL/PATH/TO/tmdb.py", line 190, in _parse |
| return datetime.strptime(value[:-1].split(".")[0], "%Y-%m-%dT%H:%M:%S") |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
...
| ValueError: time data '2023-02-14 01:31:39 UT' does not match format '%Y-%m-%dT%H:%M:%S' |
| |
[CRITICAL] | time data '2023-02-14 01:31:39 UT' does not match format '%Y-%m-%dT%H:%M:%S' |
Note the first line in that snippet. Your specific path to the file will be found there; in this example:
/THIS/WILL/BE/THE/LOCAL/PATH/TO/tmdb.py
In your specific case, it might be something like
/home/chaz/kometa/.direnv/python-3.12.6/lib/python3.12/site-packages/tmdbapis/tmdb.py
Copy the file you downloaded a moment ago to that path, overwriting the file that is there when asked.
That's it.
If you are running Docker:
Step 2: copy that file you downloaded into your config directory [this is just to ensure that your docker container can see it].
Step 3: Add a volume map which will override this file, inside the container, with the modified version you downloaded. You'll do this right next to the existing volume map you have created for /config.
The path inside the container [ASSUMING YOU ARE USING THE OFFICIAL IMAGE] is:
/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py
IMPORTANT: If you are using a different image to the official image, the internal path [/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py
] may vary.
For example, on at least one LSIO image that path appears to be /lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py
.
Examples:
Docker-compose:
services:
kometa:
image: kometateam/kometa # < THIS EXAMPLE IS SPECIFIC TO THIS IMAGE
container_name: kometa
environment:
- TZ=TIMEZONE #optional
volumes:
- /path/to/config:/config
- /path/to/config/tmdb.py:/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py
# THIS PATH ^^^^^ IS SPECIFIC TO THE kometateam/kometa IMAGE
Docker run:
THIS EXAMPLE IS SPECIFIC TO THE kometateam/kometa
IMAGE
docker run -v "/path/to/config/":"/config/" -v "/path/to/config/tmdb.py":"/usr/local/lib/python3.11/site-packages/tmdbapis/tmdb.py" kometateam/kometa --config /config/test-config.yml --run
In UNRaid or other NAS, you will do this in some GUI, next to the existing volume map you have defined for /config
.
workaround doesnt work for me
workaround doesnt work for me>
TMDb have recently deployed a fix, it may take up to 24 hours for it to fully roll out. This fix nullifies the workaround
If in 24 hours you are still experiencing the above error, we suggest renaming your config.cache file which will force Kometa to create a new cache.
We will continue to monitor this.
20 hour after the fix, this still isn't working for me. The posted fix replacing the tmdb.py file with a newer version doesn't work either, including creating a new cache file.
20 hour after the fix, this still isn't working for me. The posted fix replacing the tmdb.py file with a newer version doesn't work either, including creating a new cache file.
As per previous post, the TMDb fix nullifies the workaround. The workaround will no longer work (or at best will be flakey depending upon the TMDb API cache situation).
I'd suggest maybe deleting/renaming your config.cache file to see if that helps
Yes, I have tried all the posted options individually.
- do nothing and use the TMDb fix - didnt work
- replace the tmdb.py file - didnt work
- do nothing and rename config.cache - didnt work
- replace tmdb.py and rename config.cache - didnt work
all result in various versions of the following
<snip> | File "/usr/local/lib/python3.11/_strptime.py", line 349, in _strptime | | raise ValueError("time data %r does not match format %r" % | | ValueError: time data '2020-08-26 03:17:42 UT' does not match format '%Y-%m-%dT%H:%M:%S' | | | | Unknown Error: time data '2020-08-26 03:17:42 UT' does not match format '%Y-%m-%dT%H:%M:%S' | | | |====================================================================================================|
Yes, I have tried all the posted options individually.
- do nothing and use the TMDb fix - didnt work
- replace the tmdb.py file - didnt work
- do nothing and rename config.cache - didnt work
- replace tmdb.py and rename config.cache - didnt work
all result in various versions of the following
<snip> | File "/usr/local/lib/python3.11/_strptime.py", line 349, in _strptime | | raise ValueError("time data %r does not match format %r" % | | ValueError: time data '2020-08-26 03:17:42 UT' does not match format '%Y-%m-%dT%H:%M:%S' | | | | Unknown Error: time data '2020-08-26 03:17:42 UT' does not match format '%Y-%m-%dT%H:%M:%S' | | | |====================================================================================================|
It's probably a waiting game at this point.
Tracking this issue on TMDb forums: https://www.themoviedb.org/talk/675427102a0e9c79f19b8d0e
nothing works for me
- deleting the cache
- editing the tmdb.py
got this error every time:
| File "/app/kometa/kometa.py", line 748, in run_libraries |
| library_status[library.name]["Library Operations"] = library.Operations.run_operations() |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/app/kometa/modules/operations.py", line 371, in run_operations |
| found_rating = tmdb_obj().vote_average # noqa |
| ^^^^^^^^^^ |
| File "/app/kometa/modules/operations.py", line 199, in tmdb_obj |
| _item = self.config.TMDb.get_item(item, tmdb_id, tvdb_id, imdb_id, is_movie=self.library.is_movie) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/app/kometa/modules/tmdb.py", line 446, in get_item |
| tmdb_item = self.get_movie(tmdb_id) if is_movie else self.get_show(tmdb_id) |
| ^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/app/kometa/modules/tmdb.py", line 267, in get_movie |
| return TMDbMovie(self, tmdb_id, ignore_cache=ignore_cache) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/app/kometa/modules/tmdb.py", line 120, in __init__ |
| self.collection_id = data["collection_id"] if isinstance(data, dict) else data.collection.id if data.collection else None |
| ^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/base.py", line 63, in __getattribute__ |
| self._load(None) |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/reload.py", line 589, in _load |
| self.reviews = self._parse(attrs="reviews", value_type="movie_reviews", key=self.id) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/base.py", line 92, in _parse |
| return self._tmdb._parse(data=self._data if data is None else data, attrs=attrs, value_type=value_type, |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 297, in _parse |
| return MovieReviews(self, value, key) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/pagination.py", line 313, in __init__ |
| super().__init__(tmdb, data, "review", "MovieReviews") |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/pagination.py", line 33, in __init__ |
| super().__init__(tmdb=tmdb, data=data) |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/base.py", line 20, in __init__ |
| self._load(data) |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/pagination.py", line 49, in _load |
| self.results = self._parse(attrs="results", value_type=self._value_type, is_list=True) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/base.py", line 92, in _parse |
| return self._tmdb._parse(data=self._data if data is None else data, attrs=attrs, value_type=value_type, |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 169, in _parse |
| return [self._parse(data=v, value_type=value_type, default_is_none=default_is_none, key=key) for v in value] |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 278, in _parse |
| return Review(self, value) |
| ^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/reload.py", line 10, in __init__ |
| super().__init__(tmdb, data) |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/base.py", line 20, in __init__ |
| self._load(data) |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/reload.py", line 775, in _load |
| self.created_at = self._parse(attrs="created_at", value_type="date") |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/objs/base.py", line 92, in _parse |
| return self._tmdb._parse(data=self._data if data is None else data, attrs=attrs, value_type=value_type, |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 190, in _parse |
| return datetime.strptime(value[:-1].split(".")[0], "%Y-%m-%dT%H:%M:%S") |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/lib/python3.12/_strptime.py", line 554, in _strptime_datetime |
| tt, fraction, gmtoff_fraction = _strptime(data_string, format) |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| File "/usr/lib/python3.12/_strptime.py", line 333, in _strptime |
| raise ValueError("time data %r does not match format %r" % |
| ValueError: time data '2021-01-28 14:37:04 UT' does not match format '%Y-%m-%dT%H:%M:%S' |
| |
| time data '2021-01-28 14:37:04 UT' does not match format '%Y-%m-%dT%H:%M:%S' ```
nothing works for me
- deleting the cache
- editing the tmdb.py
got this error every time:
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 190, in _parse | | return datetime.strptime(value[:-1].split(".")[0], "%Y-%m-%dT%H:%M:%S") | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
You are apparently using the LSIO docker image, not the official docker image, so as mentioned above you will have to map that file into the container at a different path; looks like this path:
/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py
Not the path mentioned above.
Something like:
services:
kometa:
image: LINUXSERVER_IMAGE
container_name: kometa
environment:
- TZ=TIMEZONE #optional
volumes:
- /path/to/config:/config
- /path/to/config/tmdb.py:/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py
Hmm.. weird; I'm using the official one in my docker-compose
services: kometa: image: kometateam/kometa:latest container_name: kometa
Can't speak to that, but the error you paste above is clearly referring to a file that doesn't exist in the official image.
File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 190, in _parse
What does docker ps -a
show for the container that generated this log?
What's at the top of the log?
| Version: 2.1.0 (Linuxserver: master) |
or
| Version: 2.1.0 (Docker: master) |
Also, if you were using the updated tmdb.py
, this error wouldn't be pointed at line 190. In the modified file, that's line 192.
| File "/lsiopy/lib/python3.12/site-packages/tmdbapis/tmdb.py", line 190, in _parse |
| return datetime.strptime(value[:-1].split(".")[0], "%Y-%m-%dT%H:%M:%S") |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
After clearing the config.cache file the error goes away, but none of the movies in any of my plex libraries are found on TMDb.
[2024-12-09 15:43:01,135] [tmdb.py:454] [INFO] | Venom: The Last Dance | No TMDb ID for Guid: plex://movie/61b7469227e5f877e29df627
It seems the symptoms of this issue have progressed as this is leading to no posters, overlays, collections or other configured settings being applied for any movie.
For anyone still experiencing the time data error AFTER deleting config.cache, can you please do a run with --log-requests
in the run command and then provide that log?
After clearing the config.cache file the error goes away, but none of the movies in any of my plex libraries are found on TMDb.
[2024-12-09 15:43:01,135] [tmdb.py:454] [INFO] | Venom: The Last Dance | No TMDb ID for Guid: plex://movie/61b7469227e5f877e29df627
It seems the symptoms of this issue have progressed as this is leading to no posters, overlays, collections or other configured settings being applied for any movie.
Unrelated, this error generally means that the item is either:
- Not matched in Plex
- Matched to an item which does not have a TMDB ID
- Bad XML
In any case, doing a Fix Match and Refresh Metadata should resolve that particular error for the most part.
I've just starting investigating here. For me, simply updating the TMDb API Python library fixes this for me:
pip install --upgrade tmdbapis==1.2.26
My config.cache
was good, I validated it. I'd prefer to keep my config.cache
as I have a very large collection. Something about TMDb changing their time format, which they undid already? I'll SQL out any bad timestamps from the SQLite config.cache
-- is this what has happened?
FYI The linked file above produces this when I overwrite my checkout of git@github.com:Kometa-Team/Kometa.git
< https://raw.githubusercontent.com/Kometa-Team/TMDbAPIs/refs/heads/date-format-change/tmdbapis/tmdb.py >
(kometa-venv) PS Z:\Kometa> python kometa.py --run-libraries "Films" --nice
Traceback (most recent call last):
File "Z:\Kometa\kometa.py", line 206, in <module>
from modules.builder import CollectionBuilder
File "Z:\Kometa\modules\builder.py", line 21, in <module>
tmdb.builders + trakt.builders + tvdb.builders + mdblist.builders + radarr.builders + sonarr.builders
^^^^^^^^^^^^^
AttributeError: module 'modules.tmdb' has no attribute 'builders'
Well, that's not an error I've seen before.
This change is now available in the nightly branch of Kometa; it may be better to move to that than to copy files in at this point.
The issue is that the JSON returned by TMDB contained a new date format that the Kometa TMDB library was not prepared to accept. I'm not sure anything got cached at all on the Kometa side, since it was falling down while parsing the JSON response from TMDB, and I can't imagine it would cache anything prior to successfully parsing it.
@chazlarson I have a nightly checkout already :)
BUT, just a simple update of TMDb API in the master
branch fixes everything for me tmdbapis==1.2.26
pip install --upgrade tmdbapis==1.2.26
Sure, or that.
fixed for my on windows server powershell with the update of the TMDB Api
@chazlarson I have a nightly checkout already :)
BUT, just a simple update of TMDb API in the
master
branch fixes everything for metmdbapis==1.2.26
pip install --upgrade tmdbapis==1.2.26
Just came here to say that after many many many attempted fixes this totally worked. Thank you!!!
should i revert the fix i made that you stated above now , or should i wait for a new docker image release ?
The fix is in nightly, so you can use that docker image
Closing as resolved