[ Server!] NotFoundError: No DailyStats found

gettings this error, but i dont know if it is the same as https://discord.com/channels/686873244791210014/1253731262930223125 ? Did everything on this list : Got it now, there were three things: I had to use const PRIVATE_KEY = JSON.parse(Buffer.from(process.env.GOOGLE_ANALYTICS_PRIVATE_KEY!, "base64").toString().replace(/\n/g,"")) as per this comment I was encoding with single quotation marks, it should be echo -n ""-----BEGIN PRIVATE KEY---(...)"" | base64 I had to enable the Google Analytics Data API in Google Console and no luck.. is this something else ? [ Server!] NotFoundError: No DailyStats found [ Server!] at /home/lk/mr/mr/app/node_modules/@prisma/client/runtime/library.js:162:12389 [ Server!] at async /home/lk/mr/mr/app/node_modules/@prisma/client/runtime/library.js:162:12328 [ Server!] at getDailyStats$2 (/home/lk/mr/mr/app/src/analytics/operations.ts:18:22) [ Server!] at <anonymous> (/home/lk/mr/mr/app/.wasp/out/server/src/middleware/operations.ts:14:24) [ Server!] at <anonymous> (/home/lk/mr/mr/app/.wasp/out/sdk/wasp/server/utils.ts:26:5) Using GA not Plausible
5 Replies
kapa.ai
kapa.ai5mo ago
Hi @Arukaito. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message you're seeing, NotFoundError: No DailyStats found, indicates that the application is trying to retrieve daily statistics from the database, but it's not finding any. This could be due to a variety of reasons, such as the daily statistics not being properly calculated and stored, or an issue with the database connection. From the knowledge sources provided, it seems that the calculateDailyStats function is responsible for calculating and storing these statistics. If this function fails, it should save a log to the database. You can check your logs to see if there are any errors related to this function (source (https://discord.com/channels/686873244791210014/1215945587841831033)). If you're not seeing any logs related to this function, it might be worth debugging the calculateDailyStats function directly. One suggestion from the community is to change the job to run every minute in the main.wasp file, which would allow you to see if it's running correctly and storing data as expected (source (https://discord.com/channels/686873244791210014/1215945587841831033)). It's also worth noting that if you don't have plausible analytics set, the script might fail. You might want to check if you have plausible analytics set up correctly (source (https://discord.com/channels/686873244791210014/1215945587841831033)). The error you're seeing is different from the one in the link you provided, as they are related to different parts of the application and have different error messages. The steps you've taken seem to be related to setting up Google Analytics, which might not directly solve the No DailyStats found error if the issue lies elsewhere. If you're still having trouble, you might want to reach out to the Wasp community for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Arukaito, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
martinsos
martinsos5mo ago
@Vinny (@Wasp)
Vinny (@Wasp)
Vinny (@Wasp)5mo ago
Hey. The DailyStats are running every hour according to the corresponding job in the main.wasp file. The error your seeing is probably when you're visiting the admin dashboard and it's trying to fetch the daily stats form your DB, but there are none Have you tried first setting the cron schedule to run every minute so that the job can run and populate the DB? the error currently has nothign to do with your private key
かぐら
かぐらOP4mo ago
Alright ! just got it working. it was little bit of both.. in the documentation it doesnt tell you that you have to modify stats.ts to enable google analytics or at least i ommited that part. and next it was the key followed that discord discussion and it worked, thanks !
Vinny (@Wasp)
Vinny (@Wasp)4mo ago
Awesome. Ah ok we should add that to the docs! Thanks for the heads up
Want results from more Discord servers?
Add your server