Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
This repository was archived by the owner on Dec 31, 2025. It is now read-only.

The start dates "Not available" does not seem to be supported #487

Description

@Tr4ncer

Operating System

Windows

Java Runtime

Java

Java Version

24

Release Version

3.4.3

Issue

When calling the getStartDate() method in the AnimePreview class, an error can be thrown.

Class exception name: class dev.katsute.mal4j.exception.JsonSyntaxException
Cause: null
Localized message: Unexpected starting character: '<', expected '{' or '['
Stack trace: dev.katsute.mal4j.Json.parse(Json.java:107)
dev.katsute.mal4j.Json.parse(Json.java:47)
dev.katsute.mal4j.APICall.call(APICall.java:446)
dev.katsute.mal4j.APICall$InterfaceInvocation.invoke(APICall.java:529)
dev.katsute.mal4j.$Proxy6.getAnime(null:-1)
dev.katsute.mal4j.MyAnimeListImpl.lambda$getAnimeSchema$0(MyAnimeListImpl.java:188)
dev.katsute.mal4j.MyAnimeListImpl.handleResponseCodes(MyAnimeListImpl.java:931)
dev.katsute.mal4j.MyAnimeListImpl.handleResponse(MyAnimeListImpl.java:925)
dev.katsute.mal4j.MyAnimeListImpl.getAnimeSchema(MyAnimeListImpl.java:187)
dev.katsute.mal4j.MyAnimeListSchema_Anime$8.populate(MyAnimeListSchema_Anime.java:384)
dev.katsute.mal4j.MyAnimeListSchema_Anime$8.getStartDate(MyAnimeListSchema_Anime.java:462)
Image
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>307 Temporary Redirect</title>
</head><body>
<h1>Temporary Redirect</h1>
<p>The document has moved <a href="https://api.myanimelist.net/error.json?fields=id,title,main_picture,alternative_titles,start_date,end_date,synopsis,mean,rank,popularity,num_list_users,num_scoring_users,nsfw,created_at,updated_at,media_type,status,genres,pictures,background,related_anime,related_manga,recommendations,num_episodes,start_season,broadcast,source,average_episode_duration,rating,studios,statistics,opening_themes,ending_themes,videos,list_status%7Bstart_date,finish_date,priority,tags,comments,num_times_rewatched,rewatch_value%7D,my_list_status%7Bstart_date,finish_date,priority,tags,comments,num_times_rewatched,rewatch_value%7D">here</a>.</p>
</body></html>

How to replicate

You have to search for an anime with a date "Not available".

Image

For example:

Anime id=62289, title='Buchigire Reijou wa Houfuku wo Chikaimashita. Madousho no Chikara de Sokoku wo Tatakitsubushimasu'

or

https://myanimelist.net/anime/59467/Chiyu_Mahou_no_Machigatta_Tsukaikata_2nd_Season

or

https://myanimelist.net/anime/59068/Dungeon_Meshi_2nd_Season

AnimePreview anime ...

try {
            anime.getStartDate()
        } catch (Exception e) {
        }

Activity

  1. Katsute commented on Sep 29, 2025

    @Katsute
    Member

    That seems to be a temporary server issue as I was not able to reproduce the exception, please try running the code again and let me know if it still occurs.

    final Anime a = mal.getAnime(59068);
    System.out.println(a);
    System.out.println(a.getStartDate());

    >

    1 | Anime{id=59068, title='Dungeon Meshi 2nd Season', mainPicture=Picture{medium='https://cdn.myanimelist.net/images/anime/1796/143572.jpg', large='https://cdn.myanimelist.net/images/anime/1796/143572l.jpg'}, alternativeTitles=AlternativeTitles{synonyms=[Dungeon Food], english='Delicious in Dungeon Season 2', japanese='?????? ?2?'}, startDate=null, endDate=null, synopsis='Second season of Dungeon Meshi.', meanRating=null, rank=null, popularity=2461, usersListing=90443, usersScoring=2, nsfw=white, genres=[Genre{id=2, name='Adventure', isAnimeGenre=true}, Genre{id=4, name='Comedy', isAnimeGenre=true}, Genre{id=10, name='Fantasy', isAnimeGenre=true}, Genre{id=47, name='Gourmet', isAnimeGenre=true}, Genre{id=42, name='Seinen', isAnimeGenre=true}], createdAt=1718288340000, updatedAt=1718315385000, type=tv, status=not_yet_aired, listStatus=AnimeListStatus{id=59068, status=null, score=null, startDate=null, finishDate=null, priority=null, tags=null, comments='null', updatedAt=null, watchedEpisodes=null, rewatching=null, timesRewatched=null, rewatchValue=null}, episodes=0, startSeason=StartSeason{year=null, season=null}, broadcast=Broadcast{dayOfWeek=null, time=null}, source=manga, episodeLength=0, rating=r, studios=[], pictures=[Picture{medium='https://cdn.myanimelist.net/images/anime/1796/143572.jpg', large='https://cdn.myanimelist.net/images/anime/1796/143572l.jpg'}], background='', relatedAnime=[RelatedAnime{anime=Anime{id=52701, title='Dungeon Meshi', mainPicture=Picture{medium='https://cdn.myanimelist.net/images/anime/1711/142478.jpg', large='https://cdn.myanimelist.net/images/anime/1711/142478l.jpg'}, alternativeTitles=AlternativeTitles{synonyms=null, english='null', japanese='null'}, startDate=null, endDate=null, synopsis='null', meanRating=null, rank=null, popularity=null, usersListing=null, usersScoring=null, nsfw=null, genres=null, createdAt=null, updatedAt=null, type=null, status=null, listStatus=AnimeListStatus{id=52701, status=null, score=null, startDate=null, finishDate=null, priority=null, tags=null, comments='null', updatedAt=null, watchedEpisodes=null, rewatching=null, timesRewatched=null, rewatchValue=null}, episodes=null, startSeason=StartSeason{year=null, season=null}, broadcast=Broadcast{dayOfWeek=null, time=null}, source=null, episodeLength=null, rating=null, studios=null, pictures=null, background='null', relatedAnime=null, relatedManga=null, recommendations=null, statistics=AnimeStatistics{watching=null, completed=null, onHold=null, dropped=null, planToWatch=null, userCount=null}, openingThemes=null, endingThemes=null, videos=null}, relationType=prequel, relationTypeFormatted='Prequel'}], relatedManga=[], recommendations=[], statistics=AnimeStatistics{watching=1, completed=1, onHold=3, dropped=0, planToWatch=90438, userCount=90443}, openingThemes=null, endingThemes=null, videos=[Video{id=15269, title='PV (Teaser 1)', url='https://youtu.be/qRrXciq7-88', thumbnail='https://i.ytimg.com/vi/qRrXciq7-88/mqdefault.jpg', createdAt=1718288438000, updatedAt=1718291648000}]}
    2 | null
    
  2. Tr4ncer commented on Oct 4, 2025

    @Tr4ncer
    Author

    After investigation of my log, the error can actually happen randomly (get information, update, etc.).

    This makes the use of the API very unstable because it can crash anywhere.
    It's very frustrating :(

    To make my code more reliable, I added retry everywhere with time delay.
    I wonder if there could be an implementation directly in your API to intercept this error "Temporary Redirect" and allow a retry.
    ❓

  3. Katsute commented on Oct 8, 2025

    @Katsute
    Member

    It's generally a bad idea to have retries included as part of a library as it is expected that APIs will only be hit once and throw an error otherwise. Using the 'Temporary Redirect' as an indicator to retry is also not ideal cause the universal web standard is to process the redirection; however, the MAL API is not following the standard correctly because it points to an error page. This error falls on the responsibility of MAL to fix cause it's a server-side issue.

  4. Tr4ncer commented on Oct 8, 2025

    @Tr4ncer
    Author

    Thank you for your answers. Yes I understand.
    Currently I have added in several places a pseudo mechanism of try/waiting
    This is not ideal and in some cases it should not work.

    Example with my logs:

    2025-10-07 21:31:59 [INFO] MalSync: Update anime Chitose-kun wa Ramune Bin no Naka with status OnHold
    2025-10-07 21:31:59 [WARNING] MalTransactionResult: Update anime: Unexpected starting character: '<', expected '{' or '['
    2025-10-07 21:31:59 [INFO] MalTransactionResult: Waiting before continue... (1/4)
    2025-10-07 21:32:04 [WARNING] MalTransactionResult: Update anime: Unexpected starting character: '<', expected '{' or '['
    2025-10-07 21:32:04 [INFO] MalTransactionResult: Waiting before continue... (2/4)
    2025-10-07 21:32:09 [INFO] MalSync: Waiting before update...
    2025-10-07 21:32:11 [WARNING] MalTransactionResult: Update anime: Unexpected starting character: '<', expected '{' or '['
    2025-10-07 21:32:11 [INFO] MalTransactionResult: Waiting before continue... (3/4)
    2025-10-07 21:32:17 [WARNING] MalTransactionResult: Update anime: Unexpected starting character: '<', expected '{' or '['
    2025-10-07 21:32:17 [INFO] MalTransactionResult: Waiting before continue... (4/4)
    2025-10-07 21:32:22 [WARNING] MalTransactionResult: Start soon checking error. ID: 56837 Title:Cencoroll 3: Unexpected starting character: '<', expected '{' or '['
    2025-10-07 21:32:22 [INFO] MalTransactionResult: Waiting before continue... (1/4)
    2025-10-07 21:32:27 [INFO] MalTransactionResult: Transaction successful after 1 attempts
    

    The Exception being generic, I can't really differentiate a "Temporary Redirect" error with something else.
    In this example, I have this error in a transaction requesting an anime update and even after try/waiting it doesn't work.

    I have not had the opportunity to further research but perhaps it is a limitation of the number of possible requests to MAL.

  5. Katsute commented on Oct 9, 2025

    @Katsute
    Member

    Using a retry with a longer delay is all I can recommend at this point cause it is something MAL needs to resolve; you can try asking others using the MAL API to see if they have encountered this issue as it is related to the API itself and not this library's implementation of the API > https://myanimelist.net/clubs.php?cid=13727

  6. locked and limited conversation to collaborators on Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions