Closed CemreSuler closed 7 years ago
Thanks for reporting your issue. The problem seems to be unrelated to MagisterJS. As the log says, an error occurred while trying to obtain a new OAuth2 token from the Google Calendar API.
It seems that the Google Calendar API returned an unexpected error object. Could you please share the full response?
What do I need to send, this is all terminal said
Please enable debugging on line 23 (var DEBUG = true
) in the magister-calendar.js
file, and then share the Google API response files saved to disk in the cache folder.
It says the debug log gets saved to disk, but I can't find it
Now terminal says this
Last login: Sat Jul 15 13:57:30 on ttys000 iMac-van-K:~ ksuler$ /Users/ksuler/Desktop/Calendar.command ; exit; [] 13:58:10 Magister Calendar v1.8.3 started. [] System Time: 13:58:10, date: Sat, 15 Jul 2017 11:58:10 GMT [] 13:58:10 Debugging has been enabled. Extra information will be printed, and logs/dumps saved to disk. [] 13:58:10 Using default period to fetch appointments for. [] 13:58:10 Determined period is: From Mon Jul 17 2017 13:58:10 GMT+0200 (CEST) To Sat Jul 29 2017 13:58:10 GMT+0200 (CEST). [] 13:58:10 Google OAuth2 token has expired. Requesting a new one. /Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js:219 tools.log("critical", "Problem requesting new OAuth2 token: "+result.error.errors[0].message, result.error); ^
TypeError: Cannot read property '0' of undefined
at Request._callback (/Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js:219:88)
at Request.self.callback (/Users/ksuler/Desktop/magister-calendar-master/node_modules/request/request.js:198:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.
[Proces voltooid]
That's the same error as before. Please look in your magister-calendar project folder for any crash logs.
I looked, couldnt find anything
Do you have any idea what causes this?
Please use the updated files in the crashreport-patch. See if a crash report is created now.
How to patch without chaning my config settings?
Replace your magister-calendar.js
file and your assets/tools.js
file with the updated files.
It still doesnt make a log
Have you re-enabled the debug setting? Please explain what you have tried and what you see.
Oh no i did not i think
Last login: Sat Jul 15 14:36:34 on ttys000 iMac-van-K:~ ksuler$ /Users/ksuler/Desktop/Calendar.command ; exit; [] 15:8:24 Magister Calendar v1.8.3 started. [] System Time: 15:08:24, date: Sat, 15 Jul 2017 13:08:24 GMT [] 15:8:24 Debugging has been enabled. Extra information will be printed, and logs/dumps saved to disk. [] 15:8:24 Using default period to fetch appointments for. [] 15:8:24 Determined period is: From Mon Jul 17 2017 15:08:24 GMT+0200 (CEST) To Sat Jul 22 2017 15:08:24 GMT+0200 (CEST). [] 15:8:24 Google OAuth2 token has expired. Requesting a new one. /Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js:217 return tools.log("critical", "Problem requesting new OAuth2 token: "+result.error.errors[0].message, result.error); ^
TypeError: Cannot read property '0' of undefined
at Request._callback (/Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js:217:95)
at Request.self.callback (/Users/ksuler/Desktop/magister-calendar-master/node_modules/request/request.js:198:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request.
[Proces voltooid]
Do you have an idea what causes this?
A mis-configuration with your Google API setup perhaps. I have no clue unless you provide me with the error responses.
I do not get error responses
Yes, you do.
Try changing line 219 in /Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js from:
tools.log("critical", "Problem requesting new OAuth2 token: "+result.error.errors[0].message, result.error);
to:
tools.log("critical", "Problem requesting new OAuth2 token: ", result);
And see what result gets printed to the console.
Done, new error log
Last login: Mon Jul 17 18:39:43 on ttys000 iMac-van-K:~ ksuler$ /Users/ksuler/Desktop/Calendar.command ; exit; [] 21:43:34 Magister Calendar v1.8.3 started. [] System Time: 21:43:34, date: Tue, 18 Jul 2017 19:43:34 GMT [] 21:43:34 Debugging has been enabled. Extra information will be printed, and logs/dumps saved to disk. [] 21:43:34 Using default period to fetch appointments for. [] 21:43:34 Determined period is: From Wed Jul 19 2017 21:43:34 GMT+0200 (CEST) To Fri Jul 21 2017 21:43:34 GMT+0200 (CEST). [] 21:43:34 Google OAuth2 token has expired. Requesting a new one. [!] 21:43:34 Problem requesting new OAuth2 token: {"error":"invalid_request","error_description":"Missing required parameter: refresh_token"} [*] 21:43:34 Saved crash report to disk. logout Saving session... ...copying shared history... ...saving history...truncating history files... ...completed. Deleting expired sessions...none found.
[Proces voltooid]
It seems that the application does not have the refresh_token
. A solution could be to re-authenticate your Google application.
Thank you
I created a new Google API, and added the new client_secret.json file to the Magister-Calendar-Master Folder, but I still get the same error.
Did you remove the .credentials
folder in your home directory? And re-authenticated the application using the first run file?
Thank you very, very much!!! Issue is closed
Last login: Wed Jul 12 08:38:46 on console iMac-van-K:~ ksuler$ /Users/ksuler/Desktop/Calendar.command ; exit; [] 14:46:39 Magister Calendar v1.8.3 started. [] System Time: 14:46:39, date: Thu, 13 Jul 2017 12:46:39 GMT [] 14:46:39 Debugging has been disabled. [] 14:46:39 Using default period to fetch appointments for. [] 14:46:39 Determined period is: From Thu Jul 13 2017 14:46:39 GMT+0200 (CEST) To Fri Jul 21 2017 14:46:39 GMT+0200 (CEST). [] 14:46:39 Google OAuth2 token has expired. Requesting a new one. /Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js:219 tools.log("critical", "Problem requesting new OAuth2 token: "+result.error.errors[0].message, result.error); ^
TypeError: Cannot read property '0' of undefined at Request._callback (/Users/ksuler/Desktop/magister-calendar-master/magister-calendar.js:219:88) at Request.self.callback (/Users/ksuler/Desktop/magister-calendar-master/node_modules/request/request.js:198:22) at emitTwo (events.js:125:13) at Request.emit (events.js:213:7) at Request. (/Users/ksuler/Desktop/magister-calendar-master/node_modules/request/request.js:1082:10)
at emitOne (events.js:120:20)
at Request.emit (events.js:210:7)
at IncomingMessage. (/Users/ksuler/Desktop/magister-calendar-master/node_modules/request/request.js:1009:12)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
Deleting expired sessions...none found.
[Proces voltooid]