kidd / org-gcal.el

Org sync with Google Calendar. (active maintained project as of 2019-11-06)
435 stars 47 forks source link

`org-gcal-fetch` returns `peculiar error 400` #158

Closed bhi5hmaraj closed 3 years ago

bhi5hmaraj commented 3 years ago

I've set up org-gcal according to the README but I'm getting the following error when I run org-gcal-fetch

[error] request--callback: peculiar error: 400 deferred error : (invalid-function (error http 400))

When I ran with the debugger on, I got the following

(:code 400 :message "API key not valid. Please pass a valid API key." :error

And the Access token used to make the request was quite different from the one I entered (which I copied from the browser after authenticating)

Do let me know if I need to provide more info

I'm using Emacs 27.1 and org-gcal 0.2 and org-mode 9.4.6

telotortium commented 3 years ago

You should enable HTTP request logging. I've added a command org-gcal-toggle-debug to do just that in the most recent commit 80e6f9501fc883f29d26b0c7fea25f8b101512bd - you should pull from master to get it.

bhi5hmaraj commented 3 years ago

Is this function available in the MELPA version of the package or do I have to build from source?

bhi5hmaraj commented 3 years ago

How do I use cask to install the package?

telotortium commented 3 years ago

Is this function available in the MELPA version of the package or do I have to build from source?

You need to build from source.

How do I use cask to install the package?

I don't know - I use straight.el (via Doom Emacs) to manage my packages. With straight I can usually just run git pull

telotortium commented 3 years ago

Accidentally closed

telotortium commented 3 years ago

You can also copy the source of the org-gcal-toggle-debug function from my commit and eval it - it doesn't depend on the rest of the package.

bhi5hmaraj commented 3 years ago

I was able to enable the debugger, and I got the following stack trace

Debugger entered--Lisp error: (wrong-type-argument timerp nil)
  signal(wrong-type-argument (timerp nil))
  cancel-timer(nil)
  url-history-setup-save-timer()
  url-do-setup()
  url-retrieve-internal("https://raw.githubusercontent.com/myuhe/org-gcal.el/master/org.png" #f(compiled-function (xx) #<bytecode 0x12ab8a9>) (nil) nil nil)
  url-retrieve("https://raw.githubusercontent.com/myuhe/org-gcal.el/master/org.png" #f(compiled-function (xx) #<bytecode 0x12ab8a9>) nil nil nil)
  #f(compiled-function () #<bytecode 0x12ab889>)()
  funcall(#f(compiled-function () #<bytecode 0x12ab889>))
  (let ((url-request-extra-headers 'nil) (url-request-method 'nil) (url-request-data 'nil)) (funcall '#f(compiled-function () #<bytecode 0x12ab889>)))
  eval((let ((url-request-extra-headers 'nil) (url-request-method 'nil) (url-request-data 'nil)) (funcall '#f(compiled-function () #<bytecode 0x12ab889>))))
  #f(compiled-function (x) #<bytecode 0x104ab45>)(nil)
  deferred:call-lambda(#f(compiled-function (x) #<bytecode 0x104ab45>) nil)
  deferred:exec-task(#s(deferred :callback #f(compiled-function (x) #<bytecode 0x104ab45>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next nil :status nil :value nil) ok nil)
  deferred:worker()
  apply(deferred:worker nil)
  timer-event-handler([t 24845 34265 213047 nil deferred:worker nil nil 881000])
bhi5hmaraj commented 3 years ago

Sorry, my bad I've been using the MELPA version of the package and it has been causing all the issues. I've now manually placed this repo's org-gcal.el file in my elpa folder and it's working fine. Thanks for your suggestions

tareefdev commented 3 years ago

I have the same issue here. I have installed the package from MELPA as it's the recommended way in readme.md file. Here is the output from the debugger:

Debugger entered--Lisp error: (wrong-type-argument listp menu-bar-open-mouse)
  #f(compiled-function (key item) #<bytecode 0x13eddce0685d19db>)(mouse-1 menu-bar-open-mouse)
  map-keymap(#f(compiled-function (key item) #<bytecode 0x13eddce0685d19db>) (keymap ... ... ... ... ... ... ... "menu-bar" ...))
  easy-menu-lookup-name((keymap ... ... ... ... ... ... ... "menu-bar" ...) "Org")
  #f(compiled-function (map) #<bytecode 0x13dced4ecb638dbb>)((keymap ... ... ... ... ... ... ... "menu-bar" ...))
  mapcar(#f(compiled-function (map) #<bytecode 0x13dced4ecb638dbb>) (... ... ... ...))
  easy-menu-get-map(nil ("Org") nil)
  easy-menu-add-item(nil ("Org") (keymap "File List for Agenda" (Edit\ File\ List menu-item "Edit File List" menu-function-41 :key-sequence nil) (Add/Move\ Current\ File\ to\ Front\ of\ List menu-item "Add/Move Current File to Front of List" org-agenda-file-to-front) (Remove\ Current\ File\ from\ List menu-item "Remove Current File from List" org-remove-file) (Cycle\ through\ agenda\ files menu-item "Cycle through agenda files" org-cycle-agenda-files) (Occur\ in\ all\ agenda\ files menu-item "Occur in all agenda files" org-occur-in-agenda-files) (nil menu-item "--") (~/org/agenda/inbox\.org menu-item "~/org/agenda/inbox.org" menu-function-87 :key-sequence nil) (~/org/agenda/gcal\.org menu-item "~/org/agenda/gcal.org" menu-function-88 :key-sequence nil)) nil)
  easy-menu-change(("Org") "File List for Agenda" (["Edit File List" (org-edit-agenda-file-list) t] ["Add/Move Current File to Front of List" org-agenda-file-to-front t] ["Remove Current File from List" org-remove-file t] ["Cycle through agenda files" org-cycle-agenda-files t] ["Occur in all agenda files" org-occur-in-agenda-files t] "--" ["~/org/agenda/inbox.org" (find-file "~/org/agenda/inbox.org") t] ["~/org/agenda/gcal.org" (find-file "~/org/agenda/gcal.org") t]))
  org-install-agenda-files-menu()
  org-mode()
  org-generic-id-update-id-locations("entry-id")
  #f(compiled-function (_) #<bytecode -0x11428d1b2117d280>)(nil)
  deferred:call-lambda(#f(compiled-function (_) #<bytecode -0x11428d1b2117d280>) nil)
  deferred:exec-task(#s(deferred :callback #f(compiled-function (_) #<bytecode -0x11428d1b2117d280>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (x) #<bytecode 0xd0e572e6ae3136a>) :errorback #f(compiled-function (e) #<bytecode 0x13a2d100a545ddc6>) :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil) ok nil)
  deferred:set-next(#s(deferred :callback deferred:default-callback :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (_) #<bytecode -0x11428d1b2117d280>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (x) #<bytecode 0xd0e572e6ae3136a>) :errorback #f(compiled-function (e) #<bytecode 0x13a2d100a545ddc6>) :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil) :status nil :value nil) #s(deferred :callback #f(compiled-function (_) #<bytecode -0x11428d1b2117d280>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (x) #<bytecode 0xd0e572e6ae3136a>) :errorback #f(compiled-function (e) #<bytecode 0x13a2d100a545ddc6>) :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil))
  deferred:exec-task(#s(deferred :callback #f(compiled-function (x) #<bytecode -0xa63d391cf9af7b4>) :errorback deferred:default-errorback :cancel #f(compiled-function (x) #<bytecode -0x16abd5834811d03>) :next #s(deferred :callback #f(compiled-function (_) #<bytecode -0x11428d1b2117d280>) :errorback deferred:default-errorback :cancel deferred:default-cancel :next #s(deferred :callback #f(compiled-function (x) #<bytecode 0xd0e572e6ae3136a>) :errorback #f(compiled-function (e) #<bytecode 0x13a2d100a545ddc6>) :cancel deferred:default-cancel :next nil :status nil :value nil) :status nil :value nil) :status nil :value nil) ok nil)
  deferred:worker()
  apply(deferred:worker nil)
  timer-event-handler([t 24849 8790 465045 nil deferred:worker nil nil 888000])

I use GNU Emacs 28.0.50.

telotortium commented 3 years ago

Ah, that's not a real error - I need to tell org-gcal-toggle-debug to ignore this error if possible. If you see it, just press "c" in the backtrace buffer to continue (that's M-x debugger-continue).