kevinschaich / mintable

🍃 Automate your personal finances – for free, with no ads, and no data collection.
https://kevinschaich.io/mintable/
MIT License
1.54k stars 204 forks source link

Access token only lasts a day. #171

Open andrewhumble opened 1 year ago

andrewhumble commented 1 year ago

Mintable is working for me until the access token expires after roughly a day, giving me the error: "No refresh token is set". Is this a common issue? I don't see anything about it in the docs. Any help here would be greatly appreciated.

Here's the full stacktrace I'm getting:

Error: No refresh token is set. at OAuth2Client.refreshTokenNoCache (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:162:19) at OAuth2Client.refreshToken (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:143:25) at OAuth2Client.getRequestMetadataAsync (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:266:28) at OAuth2Client.requestAsync (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:339:34) at OAuth2Client.request (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:333:25) at createAPIRequestAsync (/Users/andrewhumble/mintable/node_modules/googleapis-common/build/src/apirequest.js:268:27) at Object.createAPIRequest (/Users/andrewhumble/mintable/node_modules/googleapis-common/build/src/apirequest.js:46:16) at Resource$Spreadsheets.get (/Users/andrewhumble/mintable/node_modules/googleapis/build/src/apis/sheets/v4.js:145:44) at GoogleIntegration.getSheets (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:69:18) at GoogleIntegration.<anonymous> (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:302:55) at step (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:33:23) at Object.next (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:14:53) at /Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:8:71 at new Promise (<anonymous>) at __awaiter (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:4:12) at GoogleIntegration.updateSheet (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:297:87) { [stack]: 'Error: No refresh token is set.\n' + ' at OAuth2Client.refreshTokenNoCache (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:162:19)\n' + ' at OAuth2Client.refreshToken (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:143:25)\n' + ' at OAuth2Client.getRequestMetadataAsync (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:266:28)\n' + ' at OAuth2Client.requestAsync (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:339:34)\n' + ' at OAuth2Client.request (/Users/andrewhumble/mintable/node_modules/google-auth-library/build/src/auth/oauth2client.js:333:25)\n' + ' at createAPIRequestAsync (/Users/andrewhumble/mintable/node_modules/googleapis-common/build/src/apirequest.js:268:27)\n' + ' at Object.createAPIRequest (/Users/andrewhumble/mintable/node_modules/googleapis-common/build/src/apirequest.js:46:16)\n' + ' at Resource$Spreadsheets.get (/Users/andrewhumble/mintable/node_modules/googleapis/build/src/apis/sheets/v4.js:145:44)\n' + ' at GoogleIntegration.getSheets (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:69:18)\n' + ' at GoogleIntegration.<anonymous> (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:302:55)\n' + ' at step (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:33:23)\n' + ' at Object.next (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:14:53)\n' + ' at /Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:8:71\n' + ' at new Promise (<anonymous>)\n' + ' at __awaiter (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:4:12)\n' + ' at GoogleIntegration.updateSheet (/Users/andrewhumble/mintable/lib/integrations/google/googleIntegration.js:297:87)', [message]: 'No refresh token is set.' }

logan-life commented 11 months ago

You should have a refreshToken key/value pair in your mintable.jsonc config. If you don't, consider re-doing mintable google-setup workflow.