Skip to content

Crash after TTRSS update past commit 2adf364c2c: Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 84 path $.content.config #451

Closed
@aruberutsu

Description

After upgrading TTRSS instance to commit 2adf364c2c or newer, TTRSS-Reader will crash on login with the following error:

2021-05-21 16:10:44.256 6613-6662/org.ttrssreader E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
    Process: org.ttrssreader, PID: 6613
    java.lang.RuntimeException: An error occurred while executing doInBackground()
        at org.ttrssreader.utils.AsyncTask$4.done(AsyncTask.java:218)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
        at java.util.concurrent.FutureTask.run(FutureTask.java:271)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 84 path $.content.config
        at com.google.gson.stream.JsonReader.nextString(JsonReader.java:826)
        at org.ttrssreader.net.JSONConnector.readResult(JSONConnector.java:319)
        at org.ttrssreader.net.JSONConnector.internalLogin(JSONConnector.java:526)
        at org.ttrssreader.net.JSONConnector.sessionNotAlive(JSONConnector.java:451)
        at org.ttrssreader.net.JSONConnector.getHeadlines(JSONConnector.java:978)
        at org.ttrssreader.controllers.Data.cacheArticles(Data.java:168)
        at org.ttrssreader.gui.CategoryActivity$CategoryUpdater.doInBackground(CategoryActivity.java:254)
        at org.ttrssreader.gui.CategoryActivity$CategoryUpdater.doInBackground(CategoryActivity.java:227)
        at org.ttrssreader.utils.AsyncTask$3.call(AsyncTask.java:199)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 

Indeed, after applying this update, TTRSS returns a "config" object in the login message that TTRSS-Reader is not expecting:

# Version: 2adf364c2c
$ curl -X POST https://example.com/ttrss/api/index.php -H "Content-Type: text/json;charset=UTF-8" -d '{"op":"login","user":"debug","password":"mysecretpass"}'
{"seq":0,"status":0,"content":{"session_id":"n7k9z32g5us1980i2kms9284jm","config":{"icons_dir":"feed-icons","icons_url":"feed-icons","daemon_is_running":false,"custom_sort_types":[],"num_feeds":1},"api_level":16}}

# Version: 9f6237a1b8
$ curl -X POST https://example.com/ttrss/api/index.php -H "Content-Type: text/json;charset=UTF-8" -d '{"op":"login","user":"debug","password":"mysecretpass"}'
{"seq":0,"status":0,"content":{"session_id":"fpf54n7k9z38llpr5n5vg4ura3","api_level":16}}

As a workaround, one can keep the server (or go back if accidentaly updated with git checkout) at 9f6237a1b8.

Activity

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

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions