sotirisspace / repo-ranger

Repo-Ranger is an AI-powered Github leaderboard that has no AI. It analyzes your Github activity and based on your score you win a clap 👏 or a 💩.
https://reporanger.xyz
GNU General Public License v3.0
6 stars 2 forks source link

[BUG] Fetching Error on Cron Job #28

Closed AkisKourouklis closed 1 month ago

AkisKourouklis commented 1 month ago

Describe the bug (required) Now we get this error on the server console, it is from the cron job. The error is below in the context

Expected behavior This should not happen, we should handle the error internally and skip the profile if there is an error with github and also fix the created_at error

Screenshots If applicable, add screenshots to help explain your problem.

Screenshot 2024-09-29 at 6 03 03 PM

Additional context (options)

14:58:43.985Z ERROR repo-ranger: Error updating user earlephilhower: QueryFailedError: Field 'created_at' doesn't have a default value
14:58:43.985Z  INFO repo-ranger: Refresh usernames job completed successfully
14:58:47.706Z  INFO repo-ranger: Refresh usernames job triggered
14:58:47.708Z  INFO repo-ranger: User bracesproul updated more than a day ago, processing
14:58:47.708Z  INFO repo-ranger: Processing user: bracesproul
14:58:51.950Z ERROR repo-ranger: {"message":"Request failed with status code 403","name":"AxiosError","stack":"AxiosError: Request failed with status code 403\n    at settle (file:///app/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/settle.js:19:12)\n    at IncomingMessage.handleStreamEnd (file:///app/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/http.js:599:11)\n    at IncomingMessage.emit (node:events:529:35)\n    at endReadableNT (node:internal/streams/readable:1400:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)\n    at Axios.request (file:///app/node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/Axios.js:45:41)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Object.getGithubUserPullRequests (file:///app/dist/src/services/github.service.js:90:26)\n    at async refreshUsernames (file:///app/dist/src/jobs/refreshUsernames.job.js:60:30)\n    at async Object.fn (file:///app/dist/src/agenda/agenda.js:23:13)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"adapter":["xhr","http","fetch"],"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"env":{},"headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/1.7.7","Accept-Encoding":"gzip, compress, deflate, br"},"method":"get","url":"[https://api.github.com/search/issues?q=author:bracesproul+is:pr"](https://api.github.com/search/issues?q=author:bracesproul+is:pr%22);},"code":"ERR_BAD_REQUEST","status":403}
14:58:51.951Z ERROR repo-ranger: Error updating user bracesproul: Error: Failed to get user data
AkisKourouklis commented 1 month ago

Fixed: https://github.com/vanguardvirtual/repo-ranger/commit/b5b85b772bd185c7e3acc9eaa9c1a3c7f11f0605