austin----- / weibo.emacs

Sina weibo client in Emacs
https://github.com/austin-----/weibo.emacs
105 stars 28 forks source link

Wrong type argument: processp, nil #19

Closed jerryfive closed 10 years ago

jerryfive commented 12 years ago

我获取授权,然后黏贴 框中所有字符到emacs 总是弹出这个错误。我用的是emacs24 。怎么解决啊? 谢谢拉

austin----- commented 12 years ago

@jerryfive 你好,能否提供出现这个错误时的traceback(在Backtrace buffer中)?谢谢

jerryfive commented 12 years ago

是这个吗? 获取微博 ?... (No changes need to be saved) Saving file e:/Program Files/emacs24/.t.weibo.emacs.d/token2... Wrote e:/Program Files/emacs24/.t.weibo.emacs.d/token2 url-http-mark-connection-as-busy: Wrong type argument: processp, nil

(我是在windows环境下安装的。安装了gnutls 。我是个新手,有劳了。)

wobutianl

From: austin----- Date: 2012-09-04 01:58 To: austin-----/weibo.emacs CC: jerryfive Subject: Re: [weibo.emacs] Wrong type argument: processp, nil (#19) @jerryfive 你好,能否提供出现这个错误时的traceback(在Backtrace buffer中)?谢谢 — Reply to this email directly or view it on GitHub.

austin----- commented 12 years ago

@jerryfive ,这个是*Message*buffer中的消息,出错的时候,会弹出一个*Backtrace*buffer来,其中会有详细的traceback。另外,请试试看在cmd中能否运行gnutls-cli.exe,看看是否所有的运行库都具备。谢谢。

ghost commented 11 years ago

Hi austin, 我也遇到相同的问题。 Backtrace:

Debugger entered--Lisp error: (wrong-type-argument processp nil) set-process-query-on-exit-flag(nil t) url-http-mark-connection-as-busy("api.weibo.com" 443 nil) url-http-find-free-connection("api.weibo.com" 443) url-http([cl-struct-url "https" nil nil "api.weibo.com" 443 "/2/statuses/friends_timeline.json?" nil nil t](lambda %28&rest --cl-rest--%29 %28apply #[... "���p#��L� pL�" [G51601 G51600 url-debug retrieval "Synchronous fetching done %28%S)" t] 4] (quote --asynch-buffer--) (quote --retrieval-done--) --cl-rest--)) (nil)) url-https([cl-struct-url "https" nil nil "api.weibo.com" 443 "/2/statuses/friends_timeline.json?" nil nil t](lambda %28&rest --cl-rest--%29 %28apply #[... "���p#��L� pL�" [G51601 G51600 url-debug retrieval "Synchronous fetching done %28%S)" t] 4] (quote --asynch-buffer--) (quote --retrieval-done--) --cl-rest--)) (nil)) url-retrieve-internal("https://api.weibo.com/2/statuses/friends_timeline.json?" (lambda (&rest --cl-rest--) (apply #[... "���p#��L� pL�" [G51601 G51600 url-debug retrieval "Synchronous fetching done (%S)" t] 4](quote --asynch-buffer--) (quote --retrieval-done--) --cl-rest--)) (nil)) url-retrieve("https://api.weibo.com/2/statuses/friends_timeline.json?" (lambda (&rest --cl-rest--) (apply #[... "���p#��L� pL�" [G51601 G51600 url-debug retrieval "Synchronous fetching done (%S)" t] 4](quote --asynch-buffer--) (quote --retrieval-done--) --cl-rest--))) url-retrieve-synchronously("https://api.weibo.com/2/statuses/friends_timeline.json?") (progn (fset (quote message) (function* ...)) (url-retrieve-synchronously url)) (unwind-protect (progn (fset ... ...) (url-retrieve-synchronously url)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...))) (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ...) (if --cl-letf-bound-- ... ...))) (letf ((... ...)) (url-retrieve-synchronously url)) (letf* ((... ...)) (url-retrieve-synchronously url)) (flet ((message ... nil)) (url-retrieve-synchronously url)) (let ((url-request-method "GET") (url-request-extra-headers ...)) (flet (...) (url-retrieve-synchronously url))) weibo-retrieve-url("https://api.weibo.com/2/statuses/friends_timeline.json?") (set-buffer (weibo-retrieve-url (concat ... param))) (save-current-buffer (set-buffer (weibo-retrieve-url ...)) (weibo-get-body)) (with-current-buffer (weibo-retrieve-url (concat ... param)) (weibo-get-body)) (let ((root ...)) (apply callback (cons root cbdata))) weibo-get-data("statuses/friends_timeline" weibo-timeline-parse-data "?" t) (progn (when with-temp-message (setq current-message ...) (message "%s" with-temp-message)) (weibo-get-data type parse-func param new) (when new (cond ... ...))) (unwind-protect (progn (when with-temp-message ... ...) (weibo-get-data type parse-func param new) (when new ...)) (and with-temp-message (if current-message ... ...))) (let ((with-temp-message ...) (current-message)) (unwind-protect (progn ... ... ...) (and with-temp-message ...))) (with-temp-message (concat "\x83b7\x53d6\x5fae\x535a " param "...") (weibo-get-data type parse-func param new) (when new (cond ... ...))) (let* ((keyword ...) (id ...) (idparam ...) (param ...)) (with-temp-message (concat "\x83b7\x53d6\x5fae\x535a " param "...") (weibo-get-data type parse-func param new) (when new ...))) weibo-pull-status(nil weibo-timeline-parse-data t "statuses/friends_timeline") apply(weibo-pull-status (nil weibo-timeline-parse-data t "statuses/friends_timeline")) (let* ((pos ...) (node ...) (node-data ...)) (apply (weibo-timeline-provider-pull-function weibo-timeline-current-provider) (list node-data ... new ...))) (progn (let* (... ... ...) (apply ... ...)) (weibo-timeline-update)) (if (weibo-timeline-provider-p weibo-timeline-current-provider) (progn (let* ... ...) (weibo-timeline-update))) (when (weibo-timeline-provider-p weibo-timeline-current-provider) (let* (... ... ...) (apply ... ...)) (weibo-timeline-update)) weibo-timeline-pull(t) weibo-timeline-pull-new() weibo-timeline-refresh() (if (eq major-mode (quote weibo-timeline-mode)) nil (weibo-timeline-mode) (weibo-timeline-refresh) (unless (timerp weibo-timeline-timer) (setq weibo-timeline-timer ...))) (unless (eq major-mode (quote weibo-timeline-mode)) (weibo-timeline-mode) (weibo-timeline-refresh) (unless (timerp weibo-timeline-timer) (setq weibo-timeline-timer ...))) (save-current-buffer (set-buffer (get-buffer-create weibo-timeline-buffer-name)) (unless (eq major-mode ...) (weibo-timeline-mode) (weibo-timeline-refresh) (unless ... ...)) (current-buffer)) (with-current-buffer (get-buffer-create weibo-timeline-buffer-name) (unless (eq major-mode ...) (weibo-timeline-mode) (weibo-timeline-refresh) (unless ... ...)) (current-buffer)) weibo-timeline-buffer() (switch-to-buffer (weibo-timeline-buffer)) weibo-timeline() call-interactively(weibo-timeline t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil)

austin----- commented 11 years ago

@sanfly 请问这个错误是总是发生,还是有时会发生?你是否安装了gnutls-cli?能从命令行运行gnutls-cli吗?

ghost commented 11 years ago

搞清楚问题了,在linux环境下,网络处在代理服务器后,没有正确的配置url-proxy-service。 配置好了url-proxy-service之后就不会出这问题,应该是emacs自带库的问题,这个地方应该提示无法连接网络,而不是抛出这么一个错误来。 另外,emacs weibo不支持proxy访问呢?w3m都可以上网,但emacs weibo只能得到一个proxy返回的错误信息。 建议研究一下如何通过带认证的proxy来访问weibo,毕竟有时候广大码农屌丝寄希望于用emacs weibo通过公司防火墙掩人耳目的上weibo。

austin----- commented 11 years ago

@sanfly 返回的错误是什么?应该是证书没有认证吧。也许有办法让它不检查证书。你用的是openssl还是gnutls-cli?tls-program的值是什么?

ghost commented 11 years ago

gnutls-cli.

Debugger entered--Lisp error: (error "Command attempted to use minibuffer while in minibuffer") read-string("Username [for @corpusers.net]: " "222222222") url-basic-auth([cl-struct-url "https" nil nil "api.weibo.com" 443 "/2/remind/set_count.json" nil nil t] t "Basic Mjg4NTE1OTE6" "@corpusers.net" (("realm" . "@corpusers.net") ("basic"))) url-get-authentication("https://api.weibo.com/2/remind/set_count.json" "@corpusers.net" "basic" t (("realm" . "@corpusers.net") ("basic"))) url-http-handle-authentication(t) url-http-parse-headers() url-http-content-length-after-change-function(337 1203 866) url-http-wait-for-headers-change-function(1 1203 1202) url-http-generic-filter(#<process proxy.server.net<1>> "HTTP/1.1 407 Proxy Authentication Required \nProxy-Authenticate: NEGOTIATE \nProxy-Authenticate: NTLM \nProxy-Authenticate: BASIC realm=\"@corpusers.net\" \nCache-Control: no-cache \nPragma: no-cache \nContent-Type: text/html; charset=utf-8 \nProxy-Connection: close \nSet-Cookie: BCSI-CS-22b496b77fe9340b=2; Path=/ \nConnection: close \nContent-Length: 853 \n \n \nAccess Denied \n \n \n<FONT face=\"Helvetica\"> \n
\n \n

\n<TABLE border=0 cellPadding=1 width=\"80%\"> \n \n<FONT face=\"Helvetica\"> \nAccess Denied (authentication_failed) \n
\n
\n \n \n \n<FONT face=\"Helvetica\"> \nYour credentials could not be authenticated: \"The specified domain is not trusted.\". You will not be permitted access until your credentials can be verified. \n \n \n \n<FONT face=\"Helvetica\"> \nThis is typically caused by an incorrect username and/or password, but could also be caused by network problems. \n \n \n \n<FONT face=\"Helvetica\" SIZE=2> \n
\nFor assistance, contact your support team. \n \n \n \n
\n \n \n") read-string("Username [for @corpusers.net]: " "22222222") url-basic-auth([cl-struct-url "https" nil nil "api.weibo.com" 443 "/2/statuses/friends_timeline.json?" nil nil t] t "Basic Mjg4NTE1OTE6" "@corpusers.net" (("realm" . "@corpusers.net") ("basic"))) url-get-authentication("https://api.weibo.com/2/statuses/friends_timeline.json?" "@corpusers.net" "basic" t (("realm" . "@corpusers.net") ("basic"))) url-http-handle-authentication(t) url-http-parse-headers() url-http-content-length-after-change-function(337 1203 866) url-http-wait-for-headers-change-function(1 1203 1202) url-http-generic-filter(# "HTTP/1.1 407 Proxy Authentication Required \nProxy-Authenticate: NEGOTIATE \nProxy-Authenticate: NTLM \nProxy-Authenticate: BASIC realm=\"@corpusers.net\" \nCache-Control: no-cache \nPragma: no-cache \nContent-Type: text/html; charset=utf-8 \nProxy-Connection: close \nSet-Cookie: BCSI-CS-22b496b77fe9340b=2; Path=/ \nConnection: close \nContent-Length: 853 \n \n \nAccess Denied \n \n \n<FONT face=\"Helvetica\"> \n
\n \n
\n<TABLE border=0 cellPadding=1 width=\"80%\"> \n \n<FONT face=\"Helvetica\"> \nAccess Denied (authentication_failed) \n
\n
\n \n \n \n<FONT face=\"Helvetica\"> \nYour credentials could not be authenticated: \"The specified domain is not trusted.\". You will not be permitted access until your credentials can be verified. \n \n \n \n<FONT face=\"Helvetica\"> \nThis is typically caused by an incorrect username and/or password, but could also be caused by network problems. \n \n \n \n<FONT face=\"Helvetica\" SIZE=2> \n
\nFor assistance, contact your support team. \n \n \n \n
\n \n \n") accept-process-output(#<process proxy.server.net<2>>) byte-code("ÂÃ !)‡" [inhibit-quit proc nil accept-process-output] 2) url-retrieve-synchronously("https://api.weibo.com/2/account/get_uid.json") (progn (fset (quote message) (function* ...)) (url-retrieve-synchronously url)) (unwind-protect (progn (fset ... ...) (url-retrieve-synchronously url)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound ...))) (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) (unwind-protect (progn ... ...) (if --cl-letf-bound-- ... ...))) (letf ((... ...)) (url-retrieve-synchronously url)) (letf* ((... ...)) (url-retrieve-synchronously url)) (flet ((message ... nil)) (url-retrieve-synchronously url)) (let ((url-request-method "GET") (url-request-extra-headers ...)) (flet (...) (url-retrieve-synchronously url))) weibo-retrieve-url("https://api.weibo.com/2/account/get_uid.json") (set-buffer (weibo-retrieve-url (concat ... param))) (save-current-buffer (set-buffer (weibo-retrieve-url ...)) (weibo-get-body)) (with-current-buffer (weibo-retrieve-url (concat ... param)) (weibo-get-body)) (let ((root ...)) (apply callback (cons root cbdata))) weibo-get-data("account/get_uid" (lambda (uid) (setq weibo-user-uid (weibo-get-node-text uid ...)))) weibo-user-get-uid() (if weibo-user-uid nil (weibo-user-get-uid) (weibo-user-get-friends)) (unless weibo-user-uid (weibo-user-get-uid) (weibo-user-get-friends)) weibo-timeline-get-unread("") (let* ((old-point ...) (data-list ...) (func ...) (result ...) (result-list ...) (since-id ...) (unread ...)) (when result-list (ewoc-filter weibo-timeline-data ...) (mapc ... result-list)) (weibo-timeline-update-header unread) (goto-char old-point)) (progn (let* (... ... ... ... ... ... ...) (when result-list ... ...) (weibo-timeline-update-header unread) (goto-char old-point)) (run-with-idle-timer 0.2 nil (quote weibo-download-image-in-queue))) (if (weibo-timeline-provider-p weibo-timeline-current-provider) (progn (let* ... ... ... ...) (run-with-idle-timer 0.2 nil ...))) (when (weibo-timeline-provider-p weibo-timeline-current-provider) (let* (... ... ... ... ... ... ...) (when result-list ... ...) (weibo-timeline-update-header unread) (goto-char old-point)) (run-with-idle-timer 0.2 nil (quote weibo-download-image-in-queue))) weibo-timeline-update() (progn (let* (... ... ...) (apply ... ...)) (weibo-timeline-update)) (if (weibo-timeline-provider-p weibo-timeline-current-provider) (progn (let* ... ...) (weibo-timeline-update))) (when (weibo-timeline-provider-p weibo-timeline-current-provider) (let* (... ... ...) (apply ... ...)) (weibo-timeline-update)) weibo-timeline-pull(t) weibo-timeline-pull-new() weibo-timeline-refresh() (if (eq major-mode (quote weibo-timeline-mode)) nil (weibo-timeline-mode) (weibo-timeline-refresh) (unless (timerp weibo-timeline-timer) (setq weibo-timeline-timer ...))) (unless (eq major-mode (quote weibo-timeline-mode)) (weibo-timeline-mode) (weibo-timeline-refresh) (unless (timerp weibo-timeline-timer) (setq weibo-timeline-timer ...))) (save-current-buffer (set-buffer (get-buffer-create weibo-timeline-buffer-name)) (unless (eq major-mode ...) (weibo-timeline-mode) (weibo-timeline-refresh) (unless ... ...)) (current-buffer)) (with-current-buffer (get-buffer-create weibo-timeline-buffer-name) (unless (eq major-mode ...) (weibo-timeline-mode) (weibo-timeline-refresh) (unless ... ...)) (current-buffer)) weibo-timeline-buffer() (switch-to-buffer (weibo-timeline-buffer)) weibo-timeline() call-interactively(weibo-timeline t nil) execute-extended-command(nil) call-interactively(execute-extended-command nil nil)

austin----- commented 11 years ago

@sanfly 看了一下,是你的proxy需要用户认证才能使用。不知道你的w3m是如何配置的?但w3m是一个单独的应用程序,emacs只是它的前端,也许w3m的proxy认证是使用自带的功能。weibo.emacs使用的是emacs自带的网络功能,你看看你的proxy需要何种认证,然后再url包中做相应的配置。http://emacswiki.org/emacs/UrlPackage#toc4 对此有描述。这里有人尝试做同样的事情,但好像是emacs的bug:http://stackoverflow.com/questions/10787087/use-elpa-emacs-behind-proxy-requiring-authentication 。也许可以用squid搭一个不需要认证的中间代理服务器来供emacs使用。

ghost commented 11 years ago

Hi austin, 改了一下emacs的网络配置,也用squid试过,现在得到的是:

GET https://api.weibo.com/2/statuses/friends_timeline.json? HTTP/1.1

Mime-Version: 1.0

Extension: Security/Digest Security/SSL

Host: api.weibo.com

Accept-Charset: gb2312;q=1, iso-2022-cn;q=0.5, hz-gb-2312;q=0.5, iso-8859-1;q=0.5, utf-8;q=0.5, big5;q=0.5, iso-2022-jp;q=0.5, shift_jis;q=0.5, euc-tw;q=0.5, euc-jp;q=0.5, euc-jis-2004;q=0.5, euc-kr;q=0.5, us-ascii;q=0.5, utf-7;q=0.5, big5-hkscs;q=0.5, gbk;q=0.5, gb18030;q=0.5, iso-8859-5;q=0.5, koi8-r;q=0.5, koi8-u;q=0.5, cp866;q=0.5, koi8-t;q=0.5, windows-1251;q=0.5, cp855;q=0.5, iso-8859-2;q=0.5, iso-8859-3;q=0.5, iso-8859-4;q=0.5, iso-8859-9;q=0.5, iso-8859-10;q=0.5, iso-8859-13;q=0.5, iso-8859-14;q=0.5, iso-8859-15;q=0.5, windows-1250;q=0.5, windows-1252;q=0.5, windows-1254;q=0.5, windows-1257;q=0.5, cp850;q=0.5, cp852;q=0.5, cp857;q=0.5, cp858;q=0.5, cp860;q=0.5, cp861;q=0.5, cp863;q=0.5, cp865;q=0.5, cp437;q=0.5, next;q=0.5, hp-roman8;q=0.5, adobe-standard-encoding;q=0.5, iso-8859-16;q=0.5, iso-8859-7;q=0.5, windows-1253;q=0.5, cp737;q=0.5, cp851;q=0.5, cp869;q=0.5, iso-8859-8;q=0.5, windows-1255;q=0.5, cp862;q=0.5, iso-2022-jp-2004;q=0.5, cp874;q=0.5, iso-8859-11;q=0.5, viscii;q=0.5, windows-1258;q=0.5, iso-8859-6;q=0.5, iso-2022-cn-ext;q=0.5, iso-2022-jp-2;q=0.5, iso-2022-kr;q=0.5, utf-16le;q=0.5, utf-16be;q=0.5, utf-16;q=0.5, x-ctext;q=0.5

Accept: /

User-Agent: URL/Emacs (x86_64-pc-linux-gnu; X11)

Authorization: OAuth2 AAAAAAAAAKEYBBBBBBBBBBBB

Via: 1.1 cnbjlx6235 (squid/3.2.3)

X-Forwarded-For: 127.0.0.1

Proxy-Authorization: Basic Mjg4NTE1OTE6KjhpaywoOW9sLg==

Cache-Control: max-age=0

HTTP/1.1 400 Bad Request

Cache-Control: no-cache

Pragma: no-cache

Content-Type: text/html; charset=utf-8

Proxy-Connection: close

Connection: close

Content-Length: 690

Request Error
Request Error (invalid_request)

Your request could not be processed.
This could be caused by a misconfiguration, or possibly a malformed request.

For assistance, contact your support team.

看起来是构造的request不被proxy认可。

austin----- commented 11 years ago

@sanfly 这个错误是你自己的squid返回的,还是下游proxy返回的?如果是浏览器使用你的squid可以上网吗?

ghost commented 11 years ago

是上层proxy返回的,浏览器都是正常的。只有emacs weibo返回这个。

austin----- commented 11 years ago

@sanfly 能否在squid的机器上用tcpdump将完整的request/response截出来?从错误看来不是很清楚request哪部分malformed。

ghost commented 11 years ago

上面第4个里面request就是tcpdump出来的。