I have an issue with my ttrss instance very similar to the one encountered in this post : [SyntaxError: JSON parse: unexpected character at line 1 column 1 of the JSON data]
(Sorry I can’t add links to post but it’s on this forum by user Louis on Feb,14 2019)
Everything worked fine but this afternoon I went to my ttrss an I got this unhandled exception :
SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 5771 of the JSON data
Like the other user I cannot access my administration panel nor my prefs.php page.
I tried changing LOG_DESTINATION to blank and syslog but everything seems normal.
The only other error message I get is when I do a sanity check : domain/tt-rss/backend.php?op=rpc&subop=sanityCheck
Exception while creating PDO object:Cannot modify header information - headers already sent by (output started at /home/userfolder/www/private/tt-rss/classes/rpc.php:330)
I guess the problem is related to my database but I can’t figure out what’s going on.
Out of curiosity, I checked for console error on page load and noticed two things.
The initial error
SyntaxError: “JSON.parse: unexpected non-whitespace character after JSON data at line 1 column 5771 of the JSON data”
is triggered because by a < pre > tag in the reply object
},"runtime-info":{"max_feed_id":81,"num_feeds":78,"cdm_expanded":false,"labels":[]}}<pre>Exception while creating PDO object:Cannot modify header information - headers already sent by (output started at /home/folder/www/private/tt-rss/classes/rpc.php:330)</pre>
And this error log on AppBase.js line 422
[Error.report] log response {“error”:{“code”:6,“message”:“Request not authorized.”}}
What is the correlation between malformed JSON and a “Request not authorized” error message?
you can also try commenting this line in classes/db.php:68:
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
which might force PDO to show some error message when you open index.php or maybe log something to http error log.
[Thu Apr 04 12:38:18 2019] [alert] [client IP] [host domain] /homez.36/folder/www/private/tt-rss/.htaccess: Invalid command ‘php_flag’, perhaps misspelled or defined by a module not included in the server configuration
Ok, without mod_php php_flag does not work. What confuses me, is the location of already sent output in original error. Otherwise I would suspect something in config.php before opening <?php tag. But configuring php with output buffering (if possible) is worth trying.