akrennmair / newsbeuter

Newsbeuter is an open-source RSS/Atom feed reader for text terminals.
http://www.newsbeuter.org/
MIT License
780 stars 100 forks source link

Loading URLs from Tiny Tiny RSS...Authentication failed. #141

Open blurmonk opened 10 years ago

blurmonk commented 10 years ago

Hi

I have a working ttrss server . I enabled API. I followed the docs. I added all the settings like url, usrname password etc. And I still get this message.

My ttrss server works fine with other clients like on my android tablet. I doubt that it is my ttrss server that is the issue. The only thing I can think of is that I am using self signed certs (since this is a home server) for https

I am under Debian 64 jessie. And the ttrss server is Debain Wheezy, apache,mysql.

Compilation date/time: Jun 21 2014 19:27:24 System: Linux 3.14-1-amd64 (x86_64) Compiler: g++ 4.9.0 ncurses: ncurses 5.9.20140118 (compiled with 5.9) libcurl: libcurl/7.37.0 GnuTLS/3.2.15 zlib/1.2.8 libidn/1.28 libssh2/1.4.3 (compiled with 7.37.0) SQLite: 3.8.5 (compiled with 3.8.5) libxml2: compiled with 2.9.1

blurmonk commented 10 years ago

I tried it with non-ssl setup as well and I still get the same error.

blurmonk commented 10 years ago

I also tested with Liferea`s ttrss subscription and its implementation works (with the same settings). I am suspecting that this is more of NB situation.

thanks

carno commented 10 years ago

@blurmonk Did You try to check what newsbeuter -l6 -d debug.log will write to the debug.log file? I just tried to compile latest master sources and my newsbeuter (compiled on Debian sid, tt-rss server 1.12 on Debian stable) works just fine.

blurmonk commented 10 years ago

Hi

Ok I did your recommendation and this is the log file.

[2014-07-14 18:20:14] INFO: nl_langinfo(CODESET): UTF-8 [2014-07-14 18:20:14] INFO: nl_langinfo(CODESET): UTF-8 [2014-07-14 18:20:14] DEBUG: utils::try_fs_lock: trying to lock /home/xxxxxxx/.newsbeuter/cache.db.lock [2014-07-14 18:20:14] DEBUG: keymap::keymap: flags = 8ff [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing browser sensible-browser [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = browser, type = 4 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing show-read-feeds no [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = show-read-feeds, type = 1 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing save-path "~/.newsbeuter/xxxxxxxxx" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = save-path, type = 4 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing bookmark-interactive yes [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = bookmark-interactive, type = 1 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing browser "elinks %u" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = browser, type = 4 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing external-url-viewer "urlview" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = external-url-viewer, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing auto-reload "yes" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = auto-reload, type = 1 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing reload-time 360 [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = reload-time, type = 2 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-flag-star "s" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-flag-star, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-flag-publish "p" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-flag-publish, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing urls-source "ttrss" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = urls-source, type = 6 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-url "http://xxxxxxxxxxxxx:8888/tinyrss/" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-url, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-login "xxxxxxxk" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-login, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-password "xxxxxxx" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-password, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-mode "multi" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-mode, type = 6 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE TABLE rss_feed rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE TABLE rss_item rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE TABLE google_replay rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (1) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (2) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (3) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (4) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE INDEX ON rss_feed(rssurl) (4) rc = 0 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE INDEX ON rss_item(guid) (5) rc = 0 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE INDEX ON rss_item(feedurl) (5) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ANALYZE indices (6) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed ADD lastmodified: rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: CREATE INDEX ON rss_feed(lastmodified) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_item (7) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: CREATE INDEX ON rss_item(deleted) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed (8) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed (9) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed(10) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::clean_old_articles, days == 0, not cleaning up anything [2014-07-14 18:20:28] DEBUG: utils::retrieve_url(http://xxxxxxxxxxxxxxxxx:8888/tinyrss//api/)[{"op":"login","sid":"","password":"xxxxxxx","user":"xxxxxxxk"}]: [2014-07-14 18:20:28] DEBUG: ttrss_api::run_op(login,...): post={"op":"login","sid":"","password":"xxxxxxx","user":"xxxxxxxk"} reply = [2014-07-14 18:20:28] ERROR: ttrss_api::run_op: reply failed to parse: [2014-07-14 18:20:28] DEBUG: utils::remove_fs_lock: removed lockfile /home/xxxxxxx/.newsbeuter/cache.db.lock [2014-07-14 18:20:14] DEBUG: utils::try_fs_lock: trying to lock /home/xxxxxxx/.newsbeuter/cache.db.lock [2014-07-14 18:20:14] DEBUG: keymap::keymap: flags = 8ff [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing browser sensible-browser [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = browser, type = 4 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing show-read-feeds no [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = show-read-feeds, type = 1 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing save-path "~/.newsbeuter/xxxxxxx" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = save-path, type = 4 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing bookmark-interactive yes [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = bookmark-interactive, type = 1 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing browser "elinks %u" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = browser, type = 4 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing external-url-viewer "urlview" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = external-url-viewer, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing auto-reload "yes" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = auto-reload, type = 1 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing reload-time 360 [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = reload-time, type = 2 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-flag-star "s" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-flag-star, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-flag-publish "p" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-flag-publish, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing urls-source "ttrss" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = urls-source, type = 6 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-url "http://xxxxxxxxxxxxxxxxx:8888/tinyrss/" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-url, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-login "xxxxxxxk" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-login, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-password "xxxxxxx" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-password, type = 3 [2014-07-14 18:20:14] DEBUG: configparser::parse: tokenizing ttrss-mode "multi" [2014-07-14 18:20:14] DEBUG: configcontainer::handle_action: action = ttrss-mode, type = 6 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE TABLE rss_feed rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE TABLE rss_item rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE TABLE google_replay rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (1) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (2) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (3) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: ALTER TABLE rss_item (4) rc = 1 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE INDEX ON rss_feed(rssurl) (4) rc = 0 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE INDEX ON rss_item(guid) (5) rc = 0 [2014-07-14 18:20:14] DEBUG: cache::populate_tables: CREATE INDEX ON rss_item(feedurl) (5) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ANALYZE indices (6) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed ADD lastmodified: rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: CREATE INDEX ON rss_feed(lastmodified) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_item (7) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: CREATE INDEX ON rss_item(deleted) rc = 0 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed (8) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed (9) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::populate_tables: ALTER TABLE rss_feed(10) rc = 1 [2014-07-14 18:20:28] DEBUG: cache::clean_old_articles, days == 0, not cleaning up anything [2014-07-14 18:20:28] DEBUG: utils::retrieve_url(http://xxxxxxxxxxxxxxxxx:8888/tinyrss//api/)[{"op":"login","sid":"","password":"xxxxxxx","user":"xxxxxxxk"}]: [2014-07-14 18:20:28] DEBUG: ttrss_api::run_op(login,...): post={"op":"login","sid":"","password":"xxxxxxx","user":"xxxxxxxk"} reply = [2014-07-14 18:20:28] ERROR: ttrss_api::run_op: reply failed to parse: [2014-07-14 18:20:28] DEBUG: utils::remove_fs_lock: removed lockfile /home/xxxxxxx/.newsbeuter/cache.db.lock

blurmonk commented 10 years ago

Btw I tested the api call based on http://tt-rss.org/redmine/projects/tt-rss/wiki/JsonApiReference. It seems to work (both http and https). Maybe there is api call issue?

carno commented 10 years ago

Looks like You will have to wait for @akrennmair and his ivestigation. Obviously it fails on the very first utils::retrieve_url (which should return session id as far as I can tell from looking into my logs from a successful connection), but why and how to debug it further is out of my league.

blurmonk commented 10 years ago

@carno

Thanks for your help. Hopefully he will comment on this issue at some point.

roman-holovin commented 9 years ago

Same issue for me

friolz commented 9 years ago

I have the same issue here...

frh commented 9 years ago

I was experiencing this issue when connecting to a server that only supported TLSv1.1 and TLSv1.2 with a libcurl version that only supported TLSv1.0. I fixed it by updating libcurl.

roman-holovin commented 9 years ago

Ok, I took another look into this and for me problem was that I've generated certificate without specifying proper hostname, so curl was failing this check. I've resolved it by patching source code and adding CURLOPT_SSL_VERIFYHOST, but this is in fact temporary solution, I will regenerate proper certificate.

sgvj commented 9 years ago

I have this issue too. Same log output.

Minoru commented 8 years ago

Can someone please run this:

curl -d '{"op":"login","user":"USERNAME","password":"PASSWORD"}' URL/api/

(substituting values that are in caps accordingly) and show me the output? Please make sure that URL part is exactly the same as in ttrss-url setting in your newsbeuter config.

dave4th commented 8 years ago

curl -d '{"op":"login","user":"USERNAME","password":"PASSWORD"}' URL/api/:

curl: (60) SSL certificate problem: self signed certificate More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option.

(Sorry for my "en") Problem is "personal server", not have a real SSL certificate ? (With "-k" or "--insecure" option, working) :'(

frh commented 8 years ago

You can get a certificate easily at no cost from Let's Encrypt and many other CAs. We shouldn't weaken everyone's security by turning off certificate verification. If some people need to turn it off, it should be a configurable option.

Minoru commented 8 years ago

I see. Well, I'll have to add an option, then. Thanks for checking, @dave4th!

dave4th commented 8 years ago

(Sorry for my "en") I do not know what I did ... but now it seems to work, but only "http" address, not "https".

Extract from ...:

### File: /etc/nginx/sites-enabled/myconf
server {
  server_name vmweb;
  listen 80;
  autoindex off;
  index index.html index.htm index.php doku.php;
  root /var/www;
  include "other.conf";
  ... ...
  include tt-rss.conf;
}
server {
  server_name vmweb;
  listen 443 ssl;
  autoindex off;
  index index.html index.htm index.php doku.php;
  root /var/www;
  keepalive_requests 10;
  keepalive_timeout 60 60;
  ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
  ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
  include "other.conf";
  ... ...
  include tt-rss.conf;
}
### File: /etc/nginx/tt-rss.conf
# Ci metto anche qualcosa di "generico", vediamo se funziona:
location ~ \.php(?:$|/) {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass   unix:/var/run/php5-fpm.sock;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
    fastcgi_param  PATH_INFO $fastcgi_path_info;
}
#location /tt-rss/ {
#  try_files $uri $uri/;
#}
# Block access to .htaccess files
location ~ /\.ht {
  deny all;
}
Minoru commented 8 years ago

If the problem really lies in self-signed SSL certificate, it's expected for HTTP to work while HTTPS doesn't.

goodevilgenius commented 8 years ago

I have the same problem, and it's not a self-signed cert. I've got a valid cert from Let's Encrypt.

Here's my curl -d '{"op":"login","user":"USERNAME","password":"PASSWORD"}' URL/api/:

{"seq":0,"status":0,"content":{"session_id":"jhs1f53cfdmgjgrj4la3to6dq7","api_level":13}}

debug.log

Minoru commented 8 years ago

@goodevilgenius, you should specify ttrss-url in your config; otherwise, Newsbeuter just doesn't know where your server is. I guess I need to make Newsbeuter fail if this setting is not present and urls-source is ttrss.

Line 37 contains your password. I'm not ready to say how it's going to be fixed. Just grep for it next time you post your debug.log ;)

goodevilgenius commented 8 years ago

I have ttrss-url specified in my config.

But then I had an idea. I moved ttrss-url above the rest of the ttrss-* config options, and now it's working.

Apparently the order of the config options is important.

Minoru commented 8 years ago

You had? Weird. debug.log shows every line of the config when it parses it, and I didn't see ttrss-url there.

Can you check if it's shown in the log now? I couldn't make neither Newsbeuter 2.9 nor HEAD ignore ttrss-url, no matter where I placed it relative to other options (I just copied yours as a template).

Can you reproduce the config where ttrss-url is ignored?

goodevilgenius commented 8 years ago

Of course now, I can't reproduce it. I don't remember exactly which order I had it in before, but I'm sure it was there, and apparently being ignored.

Although, I'm on v2.8 (installed from the Fedora repos).

Minoru commented 8 years ago

Dropping the milestone as there's noone to assist in debugging.

jludwig commented 7 years ago

I'm running into the same issue. I have a self signed certificate, but my system trusts it. Here's the output of curl:

curl -d '{"op":"login","user":"admin","password":"lolthisisn'tmyrealpassword"}' https://rss.jludwig.net/api/
{"seq":0,"status":0,"content":{"session_id":"a_valid_session_idu0er8877","api_level":13}}

Here's the output of newsbeuter -l6 -d debug.log debug.txt

Minoru commented 7 years ago

Weird: apparently TT-RSS returns a result to you but an empty string to Newsbeuter. I'll get back to you after I re-read the TT-RSS docs and looked a bit into CURL API to understand if we aren't ignoring any errors.

Will you be able to compile from Git and check things if I push something? It looks like you are running a released version at the moment—2.9 probably?

jludwig commented 7 years ago

newsbeuter 2.9, yes.

I will be able to compile from git if you push something np

Minoru commented 7 years ago

Finally got around to working on this and immediately noticed that the URL in your debug.txt and in your curl invocation don't match: it's "https://rssjludwig.net" in the log but "https://rss.jludwig.net/api/" in curl (note the dot after "rss"). Have you made a typo somewhere?

One other thing you might try is a slightly different curl invocation (note the empty "sid" parameter):

curl -d '{"op":"login","sid":"","password":"lolthisisn'tmyrealpassword","user":"admin"}' https://rss.jludwig.net/api/

This shouldn't really matter, and should return the same as the previous curl invocation, but it's an easy check to run, so why not.

Finally, build from bugfix/ttrss-auth-failure branch, re-run Newsbeuter and show me the log. I've added a more detailed debug output in a place I suspect to be a culprit; let's hope I guessed right.

jludwig commented 7 years ago

Oh no... my font made rssjludwig.net look like rss.jludwig.net when underlined. Fixing the typo made it work. I'm embarrassed now. >_<

Thanks so much for helping me find that.

@Minoru Do you still want me to build from bugfix/ttrss-auth-failure and show you the log?

Minoru commented 7 years ago

You're welcome! No, building from that branch is no longer necessary.