Hi,
Since yesterday I get this error message from Android:
com.squareup.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $
This happens whenever I try to do something:
HTH.
By popular demand (@Simounet ;)) here are additional information:
Cheers.
Same thing:
com.squareup.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $
My Android app hasn't been able to load articles for several days. It has worked fine in the past.\
Also, when I tried to re-run the Wizard, it wouldn't connect. Server: wallabag.it.
I'm not using NoRoot, so I doubt that's the problem. The problem seems to me to be with wallabag.it.
I think that we have a problem on wallabag.it. Do you know when did the first issue appear?
I can't be sure, but between 2 and 5 days ago.
Another thing: On my web interface, I noticed that one article I saved (I can't remember if it was via plugin or app) got replicated over and over鈥攁bout 20 times. It appears to still be getting replicated, even after I deleted earlier copies.
The issue may come from wallabag.it or from the android app.
We upgraded wallabag.it few days ago, but maybe the android app has issues (because we updated the android app few weeks ago with upcoming features).
@notabene @ntnsndr could you tell me if this bug appeared when you were offline or online please?
I wasn't able to reproduce it, so I only have some generic thoughts:
POST /api/entries.@nicosomb definitely happening while online, when other networked apps are working fine.
Thanks for your efforts to fix this. The problem persists.
@ntnsndr could you send me an email with the url and the date it happened please?
The JSON-in-Android bug appeared when I was online, seems to have disappeared though.
Like @ntnsndr the last article was duplicated a lot of time (40-something so far) on https://app.wallabag.it/unread/list/
The issue seems to have disappeared for me, too. Is it resolved at wallabag.it?
I pushed a fix today.
So this issue can be closed?
Not yet. I want to be sure that all is fine. And I pushed a fix but it鈥檚 not pushed on the repository
For information, I'm having the same issue on a self-hosted instance of wallabag 2.3.1
Android wallabag app version: 2.0.2
How I got it:
I have the same issue and @biva's workaround does not work for me. On every attempt to refresh the app, the last article gets added 2 more times. The server logs do not have any errors. The client throws the error as mentioned above.
However, when I opened the article and pressed the "refresh content" button, the browser refreshes and I can see a warning: DOMXPath::evaluate(): invalid expression in /[鈥wallabag-2.3.2/vendor/j0k3r/graby/src/Extractor/ContentExtractor.php on line 972. Redirecting to /view/1234 and the browser refreshes. I suppose that is the response the client gets as well.
I have 30 articles in the queue. Do you have a workaround for exporting the queued links so I can reset the app?
I do not know a way of exporting the queued links.
@schneefux there's no easy way, but it is totally doable.
/data/data/fr.gaulupeau.apps.InThePoche/databases/wallabag./sdcard/Android/data/fr.gaulupeau.apps.InThePoche.debug/files/wallabag.When you get the access to the database file, you will be able to open it with any SQLite browser. For example, something like that may work in a terminal on your phone: sqlite3 /sdcard/Android/data/fr.gaulupeau.apps.InThePoche.debug/files/wallabag.
After that you can run this query select EXTRA from QUEUE_ITEM where ACTION = 1; to see URLs queued for saving (you can also try select * from QUEUE_ITEM; to show all queued entries, in case I made a mistake in the first query).
Update: now available via UI: #915.
I have this issue with the Android app connected with my own Wallabag server (version 2.3.3).
I have this problem using wallabag.it :/
This is still an issue in 2.3.2.
A workaround is disabling PHP error messages with display_errors=off in the server's php.ini configuration.
I recently bought a new ebook reader (Likebook) installed Wallabag android app and can not sync at all. I also receive the same error as everyone else.
However Wallabag on my existing Android phones (3 of them) work and can sync with no errors at all.
I read something about null values, so removed all the items with less than 1min reading time (that was a real pain btw). But its still the same problem.
I'm also using the wallabag 2.3.0 app on all my Android devices and I'm using Wallabag.it (instead of self hosting). I'm lost at what to do as its seems to only be a problem with fresh devices connecting, as I restarted wallabag app on my Nokia 8 and got the exact same error.
My only real option is to remove all articles from my wallabag.it account?
@cubicgarden
I also receive the same error as everyone else.
Please double-check that the error says JsonEncodingException and not JsonDataException. That makes a huge difference.
Apparently, if the exception is JsonEncodingException and display_errors=off on the server helps, the error happens because server responds with some non-JSON response (a server error message). I think these should be noticeable in the server logs, ping @nicosomb
Got a JsonEncodingException in version 2.3.0 of the android app from f-droid, server version 2.3.1 from docker hub, self-hosted:

I think it's caused by this PDF:
https://openresearch-repository.anu.edu.au/bitstream/1885/98880/2/01_Homer-Dixon_Synchronous_failure%253A_the_2015.pdf
Deleting the PDF from wallabag fixes the error, re-adding it breaks things again.
The error happens when I swipe-down-from-top to reload.
Doesn't cause an error on the web interface, just droid.
@abe-winter thanks for the report. It seems to be a problem with the wallabag server. Newer server versions (2.3.8 and 2.4.0 (dev)) can't save the PDF at all.
If you're technically inclined, you can check the published_by field on the article - my guess that it's the problem.
@di72nn yes, published_by lost some letters:
sqlite> select published_by from wallabag_entry where url = 'https://openresearch-repository.anu.edu.au/bitstream/1885/98880/2/01_Homer-Dixon_Synchronous_failure%3A_the_2015.pdf';
a:1:{i:0;s:175:"Thomas Homer-Dixon, Brian Walker, Reinette Biggs, Anne-Sophie Cr锟絧in, Carl Folke, Eric F. Lambin, Garry D. Peterson, Johan Rockstr锟絤, Marten Scheffer, Will Steffen, Max Troell";}
The 'author' field in the PDF has special chars for the names that get mangled: Cr茅pin, Rockstr枚m
That's actually doesn't look like something that can break syncing with the app.
Can you select all the other fields (except for the content) of this entry?
You can also rewrite this field with a value without special characters to test whether it'll sync.
BTW, if you're using a non-fdroid-build of the app, consider checking out our beta build to help us test compatibility with older wallabag servers (available in releases or opt-in in google play).
@di72nn I set the published_by field to the result of serialize(["some string"]) in php and that fixed the json error in the mobile app
-- I converted the special characters to standard ascii
sqlite> update wallabag_entry set published_by='a:1:{i:0;s:149:"Thomas Homer-Dixon, Brian Walker, Reinette Biggs, Anne-Sophie Crepin, Carl Folke, Eric F. Lambin, Garry D. Peterson, Johan Rockstrom, Marten Scheffer";}' where url = 'https://openresearch-repository.anu.edu.au/bitstream/1885/98880/2/01_Homer-Dixon_Synchronous_failure%3A_the_2015.pdf';
non-content fields if still interested:
sqlite> select id, user_id, title, url, is_archived, is_starred, created_at, updated_at, mimetype, language, reading_time, domain_name, preview_picture, uid, http_status, published_at, published_by, headers, starred_at, origin_url from wallabag_entry where url = 'https://openresearch-repository.anu.edu.au/bitstream/1885/98880/2/01_Homer-Dixon_Synchronous_failure%3A_the_2015.pdf';
66|2|Synchronous failure: the emerging causal architecture of global crisis|https://openresearch-repository.anu.edu.au/bitstream/1885/98880/2/01_Homer-Dixon_Synchronous_failure%3A_the_2015.pdf|0|0|2020-05-01 15:48:53|2020-05-01 15:48:53|application/pdf||69|openresearch-repository.anu.edu.au|||200|2016-01-11 11:45:48|a:1:{i:0;s:149:"Thomas Homer-Dixon, Brian Walker, Reinette Biggs, Anne-Sophie Crepin, Carl Folke, Eric F. Lambin, Garry D. Peterson, Johan Rockstrom, Marten Scheffer";}|N;||
happy to switch to beta if useful to you. remember that I'm using a sqlite backend, so this could be a combination of server error + sqlite unicode failure.
Yeah, probably caused by SQLite or the way wallabag uses it.
happy to switch to beta if useful to you
It may be useful, so please do.
If anyone else encounters "Malformed JSON" errors, create new issues.
Most helpful comment
This is still an issue in 2.3.2.
A workaround is disabling PHP error messages with
display_errors=offin the server's php.ini configuration.