Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All stuffs doesn't work after proxy. #329

Open
WALL-EEEEEEE opened this issue Mar 9, 2017 · 10 comments
Open

All stuffs doesn't work after proxy. #329

WALL-EEEEEEE opened this issue Mar 9, 2017 · 10 comments

Comments

@WALL-EEEEEEE
Copy link

WALL-EEEEEEE commented Mar 9, 2017

   I have a proxy in my computer for some essential reasons. After I had installed sx.el into my Emacs, I tried to use some functions of it, sx-search or sx-tab-all-questions. All of them didn't work. I just received an error all the same, Args out of range "" 2.I think this may be a bug in sx.el behind the proxy.

@WALL-EEEEEEE WALL-EEEEEEE changed the title All stuff doesn't work after proxy. All stuffs doesn't work after proxy. Mar 9, 2017
@vermiculus
Copy link
Owner

@WALL-EEEEEEE
Copy link
Author

Yes, it can be made to work just by setting *stack* domain name in no_proxy.I meant I can't use this plugin after the proxy, however the package.el works under it very well. So I think it may be the plugin's problem.

@vermiculus
Copy link
Owner

Have you seen #317? It sounds like a similar situation.

If you're already on emacs 25.1 (or updating doesn't solve your problem or #317's solution doesn't work), I'll try to get to this within the month, but I can't promise anything. I'm not really familiar with the underworkings of url.el 😦

@WALL-EEEEEEE
Copy link
Author

   It doesn't help. My Emacs version is upper 25.1.

GNU Emacs 25.2.1

Copyright (C) 2017 Free Software Foundation, Inc.

GNU Emacs comes with ABSOLUTELY NO WARRANTY.

You may redistribute copies of GNU Emacs

under the terms of the GNU General Public License.

For more information about these matters, see the file named COPYING

Please fix it. Thank you. I have given you a star, come on.

@vermiculus
Copy link
Owner

I have given you a star, come on.

😛

Unless I can reproduce it, I really can't help. Do you have instructions on how to reproduce your setup? Can you provide a backtrace?

@WALL-EEEEEEE
Copy link
Author

WALL-EEEEEEE commented Mar 12, 2017

Just set your proxy up on your computer at first, I use privoxy for my terminal. Then, remove the proxy inside your ~/.emacs if they are there. Third, check if your package.el works well after the proxy to make sure your proxy is no problem.
After all the processes above, install sx and run it. I think it will be reproduced.
One thing more I need to mention, My OS is Gentoo and Emacs version is 25.2.That's all. Hope this will be helpful.

@WALL-EEEEEEE
Copy link
Author

WALL-EEEEEEE commented Mar 12, 2017

However, I ain't very familiar with Emacs, can you tell me how to debug it so I can give you some detail backtrace infos.

@vermiculus
Copy link
Owner

M-x toggle-debug-on-error and reproduce the error.

@WALL-EEEEEEE
Copy link
Author

WALL-EEEEEEE commented Mar 12, 2017

Debugger entered--Lisp error: (args-out-of-range "" 0 2)
  sx-encoding-gzipped-p("")
  sx-request-make("questions?site=emacs" ((pagesize . 100) (filter . "!5-i6ZwIL2GJ0CB5nbLPYd-V*qewBe1Vlyc6)En") (page . 1) (order . desc) (sort . activity)) get sx-request-response-get-items)
  sx-method-call(questions :keywords ((page . 1) (order . desc) (sort . activity)) :site "emacs" :auth t :submethod nil :filter ((question\.body_markdown question\.bounty_amount question\.comments question\.creation_date question\.closed_reason question\.closed_date question\.closed_details question\.answers question\.answer_count question\.score question\.title question\.owner question\.tags question\.last_editor question\.last_activity_date question\.accepted_answer_id question\.link question\.upvoted question\.downvoted question\.question_id question\.share_link user\.display_name user\.link user\.accept_rate user\.reputation shallow_user\.display_name shallow_user\.link shallow_user\.accept_rate shallow_user\.reputation comment\.owner comment\.body_markdown comment\.body comment\.link comment\.edited comment\.creation_date comment\.upvoted comment\.score comment\.post_type comment\.post_id comment\.comment_id answer\.answer_id answer\.creation_date answer\.last_editor answer\.last_activity_date answer\.link answer\.share_link answer\.score answer\.owner answer\.body_markdown answer\.upvoted ...) nil nil))
  #[257 "\306\300\307\310�B\n\205��\311�\203��\312\202��\313B\314\nBDB\315\f\316\317\320\301\321
&�\207" [questions nil sx-question-list--order sx-question-list--descending sx-question-list--site sx-browse-filter sx-method-call :keywords page order desc asc sort :site :auth t :submethod :filter] 13 "\n\n(fn PAGE)"](1)
  sx-question-list-refresh(redisplay nil)
  sx-tab-all-questions(nil "emacs")
  funcall-interactively(sx-tab-all-questions nil "emacs")
  call-interactively(sx-tab-all-questions record nil)
  command-execute(sx-tab-all-questions record)
  execute-extended-command(nil "sx-tab-all-questions" "sx-tab-al")
  funcall-interactively(execute-extended-command nil "sx-tab-all-questions" "sx-tab-al")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

These are all the outputs.Hope it will be helpful.

@vermiculus
Copy link
Owner

Looks like the problem is coming from sx-request.el:192. I could easily make this a better error, but it looks like you're not getting any data at all from the request.

Can you try evaluating this code block after sx is loaded and then trying the request?

(defun sx-encoding-gzipped-p (data)
  (let ((unidata (string-as-unibyte data)))
    (when (<= 2 (length unidata))
      (equal (substring unidata 0 2)
             (unibyte-string 31 139)))))

I don't believe this will make it work, but it should give a better error (like 'end of file while parsing JSON').

The next step will be to figure out why url is failing to get the response through your proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants