nilsbraden / ttrss-reader-fork

An Android-Client for the self-hosted Tiny Tiny RSS feedreader
https://www.nilsbraden.de/TTRSS-Reader/
151 stars 40 forks source link

Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ #332

Closed D9IDbKA closed 7 years ago

D9IDbKA commented 7 years ago

Good day everybody! I have an issue. I can't figure out, why ttrssreader doesn't shows me my feeds from ttrss instance. Every time when I try to connect to my ttrss instance program shows me this error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ While I try to connect, I have those in ttrss log: E_WARNING (2) api/index.php:87 Cannot modify header information - headers already sent

  1. api/index.php(87): header(Api-Content-Length: 89)

E_WARNING (2) classes/api.php:14 Cannot modify header information - headers already sent

  1. classes/api.php(14): header(Content-Type: text/json)
  2. api/index.php(78): before(login)

E_WARNING (2) lib/accept-to-gettext.php:179 Cannot modify header information - headers already sent

  1. lib/accept-to-gettext.php(179): header(Content-Type: text/html; charset=)
  2. include/functions.php(107): al2gt(Array, text/html)
  3. api/index.php(56): startup_gettext()

E_WARNING (2) lib/accept-to-gettext.php:178 Cannot modify header information - headers already sent

  1. lib/accept-to-gettext.php(178): header(Content-Language: auto)
  2. include/functions.php(107): al2gt(Array, text/html)
  3. api/index.php(56): startup_gettext()

Logcat with filter json shows: JsonConnector {"user":"2","op":"login"} and that's all. it's repeated about 20-30 times

I tried log-in with curl at pc: curl -d '{"op":"login","user":"2","password":"2"}' http://server/tt-rss3/api/ {"seq":0,"status":0,"content":{"session_id":"8p3u21k6i16ojpu31tjpj4mr27","api_level":14}} getApiLevel {"seq":0,"status":0,"content":{"level":14}} getVersion {"seq":0,"status":0,"content":{"version":"16.8"}} getUnread {"seq":0,"status":0,"content":{"unread":"4315"}} getCategories {"seq":0,"status":0,"content":[{"id":-1,"title":"Special","unread":705},{"id":0,"title":"Uncategorized","unread":4315}]} getConfig {"seq":0,"status":0,"content":{"icons_dir":"feed-icons","icons_url":"feed-icons","daemon_is_running":false,"num_feeds":60}} getPrefs {"seq":0,"status":0,"content":{"value":null}} getLabels {"seq":0,"status":0,"content":[]}

Here is my apache and php build options from emerge:

APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D FCGID"

www-servers/apache-2.4.23:2::gentoo USE="ssl threads -debug -doc -ldap (-libressl) (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias -access_compat -asis -auth_digest -authn_dbd -authz_dbd -cache_disk -cern_meta -charset_lite -dbd -dumpio -http2 -ident -imagemap -lbmethod_bybusyness -lbmethod_byrequests -lbmethod_bytraffic -lbmethod_heartbeat -log_forensic -macro -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_fcgi -proxy_ftp -proxy_html -proxy_http -proxy_scgi -proxy_wstunnel -ratelimit -remoteip -reqtimeout -slotmem_shm -substitute -version" APACHE2_MPMS="-event -prefork -worker"

dev-lang/php-5.6.26:5.6::gentoo USE="apache2 berkdb bzip2 calendar cgi cli crypt ctype curl debug embed enchant exif fileinfo filter fpm gd gdbm gmp hash iconv inifile intl json libmysqlclient mhash mysql mysqli nls odbc opcache pcntl pdo phar posix readline session simplexml soap sockets spell sqlite ssl threads tidy tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter zip zlib -bcmath -cdb -cjk (-firebird) -flatfile (-frontbase) -ftp -imap -iodbc -ipv6 -kerberos -ldap -ldap-sasl -libedit (-libressl) -mssql -oci8-instant-client -postgres -qdbm -recode (-selinux) -sharedmem -snmp -sybase-ct -systemd -sysvipc -vpx -wddx -xpm -xslt"

D9IDbKA commented 7 years ago

I find out, that while I try to connect to my ttrss instance from mobile device, apache write this in logs: [Mon Oct 24 16:34:21.579767 2016] [:error] [pid 31612] [client 192.168.8.251:53098] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0 [Mon Oct 24 16:34:21.579804 2016] [:error] [pid 31612] [client 192.168.8.251:53098] PHP Warning: Cannot modify header information - headers already sent in Unknown on line 0

This is logs from tt-rss E_WARNING (2) api/index.php:87 Cannot modify header information - headers already sent

  1. api/index.php(87): header(Api-Content-Length: 89) 16:34 E_WARNING (2) classes/api.php:14 Cannot modify header information - headers already sent
  2. classes/api.php(14): header(Content-Type: text/json)
  3. api/index.php(78): before(login) 16:34 E_WARNING (2) lib/accept-to-gettext.php:179 Cannot modify header information - headers already sent
  4. lib/accept-to-gettext.php(179): header(Content-Type: text/html; charset=)
  5. include/functions.php(107): al2gt(Array, text/html)
  6. api/index.php(56): startup_gettext() 16:34 E_WARNING (2) lib/accept-to-gettext.php:178 Cannot modify header information - headers already sent
  7. lib/accept-to-gettext.php(178): header(Content-Language: auto)
  8. include/functions.php(107): al2gt(Array, text/html)
  9. api/index.php(56): startup_gettext() 16:34
D9IDbKA commented 7 years ago

Fixed by adding "always_populate_raw_post_data = -1" to php.ini