I get error with the job geting daily stats

I get error when getting dailystats see below:
43 Replies
kapa.ai
kapa.ai3w ago
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?
Sven
SvenOP3w ago
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.
miho
miho3w ago
@Vinny (@Wasp) one for you
NEROX
NEROX3w ago
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
Vinny (@Wasp)
Vinny (@Wasp)3w ago
@Sven Make sure you run
echo -n "-----BEGIN PRIVATE KEY-----\nMI...A++eK\n-----END PRIVATE KEY-----\n" | base64
echo -n "-----BEGIN PRIVATE KEY-----\nMI...A++eK\n-----END PRIVATE KEY-----\n" | base64
and then add it to your .env.server file
GOOGLE_ANALYTICS_PRIVATE_KEY=LS0tLS1CRUdJTi....
GOOGLE_ANALYTICS_PRIVATE_KEY=LS0tLS1CRUdJTi....
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.
Sven
SvenOP3w ago
Oh okay i did that Exactly Including the ——- part
NEROX
NEROX3w ago
If it works for you, please let me know. I have that issue and more pending
Vinny (@Wasp)
Vinny (@Wasp)3w ago
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----- ?
NEROX
NEROX3w ago
Is THIS correct?
No description
NEROX
NEROX3w ago
It's encoded with the -----BEGIN PRIVATE KEY----- and ----END PRIVATE KEY----- Maybe that's the problem
Vinny (@Wasp)
Vinny (@Wasp)3w ago
try removing the " " from the beginning and end That's what I did, too
NEROX
NEROX3w ago
Nope :(
No description
Sven
SvenOP3w ago
i put it all on 1 line and it still fails
NEROX
NEROX3w ago
We are fine:be:
Sven
SvenOP3w ago
does it work in dev for you?
NEROX
NEROX3w ago
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 team
Vinny (@Wasp)
Vinny (@Wasp)3w ago
there shouldn't be any line breaks in the key it should be one long string
NEROX
NEROX3w ago
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?
Vinny (@Wasp)
Vinny (@Wasp)3w ago
@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
NEROX
NEROX3w ago
Hey it works!!!!!!!!! From where comes profit? How can I fix it? Or make a withdrawal?:laughboi:
No description
Vinny (@Wasp)
Vinny (@Wasp)3w ago
Ok so why didn't it work when you ran it in the terminal then? Are you on windows or mac/linux?
NEROX
NEROX3w ago
Yep but I was in the wsl commandline So idk windows
Vinny (@Wasp)
Vinny (@Wasp)3w ago
There must be an issue there in how base64 is being encoded. I'll update the docs
NEROX
NEROX3w ago
Let me try again with the terminal to check if the output is the same or no
Vinny (@Wasp)
Vinny (@Wasp)3w ago
And Revenue comes from Stripe
NEROX
NEROX3w ago
:shork: Wtf account I had connected:laughboi:
Vinny (@Wasp)
Vinny (@Wasp)3w ago
Or you manually added some Revenue info in the DB, maybe?
Sven
SvenOP3w ago
Probably dev money
NEROX
NEROX3w ago
yep
Sven
SvenOP3w ago
thanks imma try asap
NEROX
NEROX3w ago
Yep, different output and formats
No description
Sven
SvenOP3w ago
it works for me thakns
NEROX
NEROX3w ago
Did you also get a similar different outputs as me?
Vinny (@Wasp)
Vinny (@Wasp)3w ago
you're also using WSL, right?
Sven
SvenOP3w ago
Yesss
martinsos
martinsos3w ago
Sounds like has to do with multiple lines vs single line?
Sven
SvenOP3w ago
yes
Vinny (@Wasp)
Vinny (@Wasp)3w ago
Not sure. could \n line breaks be processed differenly in WSL?
Sven
SvenOP2w ago
btw how do i distinguis actual clisk and clicks in development mode? i mean visits
VS
VS2w ago
Hey! So what is the guide here? To do this on wsl2?
Vinny (@Wasp)
Vinny (@Wasp)2w ago
if encoding the string to base64 giving you trouble on wsl use that stackblitz repo
VS
VS2w ago
Sweet, yes I was getting an error as well. Great community effort!
Vinny (@Wasp)
Vinny (@Wasp)2w ago
Waspeteers are the best ❤️
Want results from more Discord servers?
Add your server