I get error with the job geting daily stats
I get error when getting dailystats see below:
43 Replies
Hi @Sven. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the knowledge sources, it appears you're encountering an error related to the daily stats job in a Wasp application. Let's address this issue:
The error you're seeing is likely related to the
calculateDailyStats
job, which is responsible for gathering analytics data. According to the Discord thread, there are a few potential reasons for this error:
1. Plausible Analytics configuration: The error might be occurring because Plausible Analytics is not properly set up. As mentioned by Community Member 8, you need to use either Plausible or Google Analytics (https://discord.com/channels/686873244791210014/1215945587841831033).
2. Empty DailyStats table: The error suggests that the DailyStats table in your database is empty, which could be causing the issue.
To debug and potentially resolve this issue, you can try the following steps:
1. Check your Logs: Look for any error messages in your database logs related to the calculateDailyStats
job.
2. Adjust the cron schedule: You can modify the job to run more frequently for debugging purposes. As suggested, change the cron schedule in the main.wasp file to run every minute (https://discord.com/channels/686873244791210014/1215945587841831033).
3. Verify Plausible Analytics setup: Ensure that you have properly configured Plausible Analytics in your application.
4. Check your environment variables: Make sure all necessary environment variables for analytics are correctly set.
If you continue to face issues, you may want to share more detailed error logs or your configuration for further assistance. The Wasp community seems active in helping resolve such issues, so don't hesitate to provide more information if needed.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Sven, 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?Error calculating daily stats: Error: 2 UNKNOWN: Getting metadata from plugin failed with error: error:1E08010C:DECODER routines::unsupported
[ Server!] at callErrorFromStatus (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/call.ts:82:17)
[ Server!] at Object.onReceiveStatus (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/client.ts:360:55)
[ Server!] at Object.onReceiveStatus (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:458:34)
[ Server!] at Object.onReceiveStatus (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/client-interceptors.ts:419:48)
[ Server!] at <anonymous> (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/resolving-call.ts:163:24)
[ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
[ Server!] for call at
[ Server!] at ServiceClientImpl.makeUnaryRequest (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/client.ts:325:42)
[ Server!] at ServiceClientImpl.<anonymous> (/home/sven/SaaS//app/node_modules/@grpc/grpc-js/src/make-client.ts:189:15)
[ Server!] at /home/sven/SaaS//app/node_modules/@google-analytics/data/build/src/v1beta/beta_analytics_data_client.js:190:29
[ Server!] at /home/sven/SaaS//app/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16
[ Server!] at OngoingCallPromise.call (/home/sven/SaaS//app/node_modules/google-gax/build/src/call.js:67:27)
[ Server!] at NormalApiCaller.call (/home/sven/SaaS//app/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)
[ Server!] at /home/sven/SaaS//app/node_modules/google-gax/build/src/createApiCall.js:112:30
[ Server!] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
[ Server!] code: 2,
[ Server!] details: 'Getting metadata from plugin failed with error: error:1E08010C:DECODER routines::unsupported',
[ Server!] metadata: Metadata { internalRepr: Map(0) {}, options: {} }
[ Server!] }
-------------------------
Is it because when i encoded the secret i included "------begin private key.....?
Google.
@Vinny (@Wasp) one for you
Heyy, I think that is a same problem that I have in prod, I didn't solved in the last thread:be:
Just checking anaytics directy instead Wasp App dasboard
https://discord.com/channels/686873244791210014/1303761540847112247 my last screenshots
@Sven Make sure you run
and then add it to your .env.server file
it's outline here in the docs https://docs.opensaas.sh/guides/analytics/#google-analytics
OpenSaaS.sh
Analytics
Open SaaS is a free, open-source, full-stack SaaS starter kit for React + NodeJS.
Oh okay i did that
Exactly
Including the ——- part
If it works for you, please let me know. I have that issue and more pending
Hmm this has been an issue for many people. But I've checked and double-checked this approach and it works for me. Perhaps there is something else going on here (cc: @martinsos)
@Sven did you try it without -----BEGIN PRIVATE KEY----- and ----END PRIVATE KEY-----
?
Is THIS correct?
It's encoded with the -----BEGIN PRIVATE KEY----- and ----END PRIVATE KEY-----
Maybe that's the problem
try removing the " " from the beginning and end
That's what I did, too
Nope :(
i put it all on 1 line
and it still fails
We are fine:be:
does it work in dev for you?
No, not even with inverted quotes
"
at the beginning and at the end.
@Vinny (@Wasp) I think it's because you update the OpenSaaS template and everything works for you and we are left with the version we created our OpenSaaS app.
The wasp teamthere shouldn't be any line breaks in the key
it should be one long string
I found out that the 404 page was added to the template by looking at some tickets for example. Maybe it would be nice to keep a mini OpenSaaS changelog somehow, does it exist by any chance?
@Sven @NEROX what happens when you put the key through here and run
node index.js
in the terminal? https://stackblitz.com/edit/stackblitz-starters-fvhlsc?file=index.js&view=editor
do you get the same result as when you encoded it previously?vincanger
StackBlitz
node.new Starter - StackBlitz
Starter project for Node.js, a JavaScript runtime built on Chrome's V8 JavaScript engine
Hey it works!!!!!!!!!
From where comes profit?
How can I fix it? Or make a withdrawal?:laughboi:
Ok so why didn't it work when you ran it in the terminal then? Are you on windows or mac/linux?
Yep but I was in the wsl commandline
So idk
windows
There must be an issue there in how base64 is being encoded. I'll update the docs
Let me try again with the terminal to check if the output is the same or no
And Revenue comes from Stripe
:shork:
Wtf account I had connected:laughboi:
Or you manually added some Revenue info in the DB, maybe?
Probably dev money
yep
thanks imma try asap
Yep, different output and formats
it works for me thakns
Did you also get a similar different outputs as me?
you're also using WSL, right?
Yesss
Sounds like has to do with multiple lines vs single line?
yes
Not sure. could \n line breaks be processed differenly in WSL?
btw how do i distinguis actual clisk and clicks in development mode?
i mean visits
Hey! So what is the guide here? To do this on wsl2?
if encoding the string to base64 giving you trouble on wsl use that stackblitz repo
Sweet, yes I was getting an error as well. Great community effort!
Waspeteers are the best ❤️