N
Novu2w ago
Norrude

Just migrated from v0 to v2, getting a 400 error on deployment

Hello we’ve just migrated from v0 to v2. We manually rebuilt out notifications to be code-first and are now trying to push them to dev then production. When trying to do it from my Local Studio, I get this error: Error occurred while syncing. Signature does not match the expected signature. Please ensure the signature provided in the novu-signature header is correct and try again. And doing it from our Github actions leads to a 400 with no context. Our Bridge is here: https://app.guided/energy/api/novu And our Nova account is “Guided Energy” (user: [email protected]) I also want to share that code-first notifications are reusing non-code-first notifications IDs, as we wish to replace them, not add to them. Is there any documentation on v0 to v2 migration, and on how to debug that kind of issue ?
28 Replies
Norrude
NorrudeOP2w ago
We are also in Europe, but npx novu@latest dev -d https://eu.dashboard.novu.co leads to an eternally loading page (not redirecting to localhost:2022), so my local dashboard is ran from the US command (npx novu@latest dev)
Novu Cloud Dashboard
Novu Cloud Dashboard
Norrude
NorrudeOP2w ago
I also don't seem to understand if there is anything more to deploy to development than using the development API key ?
Pawan Jain
Pawan Jain2w ago
@Norrude You will need to add NOVU_API_URL=https://eu.api.novu.co environment variable as well same with syncing with CLI, use --api-url flag
npx novu@latest sync --bridge-url <YOUR_DEPLOYED_URL> --secret-key <NOVU_SECRET_KEY> --api-url https://eu.api.novu.co
npx novu@latest sync --bridge-url <YOUR_DEPLOYED_URL> --secret-key <NOVU_SECRET_KEY> --api-url https://eu.api.novu.co
Norrude
NorrudeOP2w ago
Ok, doing it ! dashboard-v2.novu.co redirects me to dashboard.novu.co, is this a problem ?
Pawan Jain
Pawan Jain2w ago
Currently only workflows page can be accessed in dashboard-v2.novu.co Are you facing this issue with workflows page? Did you opt out?
Norrude
NorrudeOP2w ago
I get a 401 with eu.api.novu.co I might have opted out prior to migrating, I am not sure data: { statusCode: 401, timestamp: '2024-12-11T16:03:55.437Z', path: '/v1/bridge/sync?source=cli', message: 'API Key not found', error: 'Unauthorized' } Although I have the correct dev API key: authorization: [ 'Authorization', 'ApiKey {hidden}' ],
Pawan Jain
Pawan Jain2w ago
@Norrude Are you using secret key from europe region?
Norrude
NorrudeOP2w ago
Oh we don't even have an eu account Ok so do you advise us re-creating an account in EU, and starting from scratch here ? Done this: here is the new errorId: 9e59a24392894478a41794677a458ebd
Novu_Bot
Novu_Bot2w ago
@Norrude, you just advanced to level 3!
Pawan Jain
Pawan Jain2w ago
Ok so do you advise us re-creating an account in EU, and starting from scratch here ?
Yes, I would advise this if you want to use EU data centers for data.
Norrude
NorrudeOP2w ago
Ok just did that
Pawan Jain
Pawan Jain2w ago
9e59a24392894478a41794677a458ebd
Is this error id for unauthorized error?
Norrude
NorrudeOP2w ago
I now have message: 'Signature does not match the expected signature. Please ensure the signature provided in the novu-signature header is correct and try again.', It is for a 500, but I now have a different 400
Pawan Jain
Pawan Jain2w ago
Let me check
Norrude
NorrudeOP2w ago
The eu app is fully configured, still stuck on the novu-signature error
Pawan Jain
Pawan Jain2w ago
@Norrude what is the NODE_ENV env variable value for https://app.guided.energy/api/novu deployment?
Norrude
NorrudeOP2w ago
NODE_ENV="development" as is my api_key, I believe Oh sorry NODE_ENV in prod you mean production ok I see so I can't refer a production url with a dev environment ?
Pawan Jain
Pawan Jain2w ago
Let me check this. Give me some time
Norrude
NorrudeOP2w ago
I've realised that NOVU_SECRET_KEY was not set on my production env, adding it Allelujah it works ! Thanks Pawan for the help ! Doc is still very far from being complete, but v2 looks extremely promising, eager to work with it 🙂
Pawan Jain
Pawan Jain2w ago
Would you like to share what was missing?
Norrude
NorrudeOP2w ago
From the top of my head - eu is mentioned only once if I'm not mistaken, on the Local Studio dev command - Explicitly mention that NODE_ENV and SECRET_KEYs must match on both sides (I expected to be able to deploy on novu's dev with our production environment) - had to add
experimental: {
esmExternals: false,
},
experimental: {
esmExternals: false,
},
to my next config for the self hosting - But by far the most painfull is that there is no v0 to v2 migration doc. we had around 20 notifs, if we had 100 we wouldn't have been able to do the switch. + My US account is still stuck in v0 interface, with no way to switch to v2 (I believe ?). I'll now see if we stick to the US or get on the EU account But it's the cost of building a great product quickly. Keep up the good work (if it doesn't add breaking changes haha) 😄 !
Pawan Jain
Pawan Jain2w ago
Thanks for all the feedback You had UI-based workflows earlier and migrated to @novu/framework powered code first workflows. Would you like to share the use case?
Norrude
NorrudeOP2w ago
What do you mean by the use case ? Why we did it ?
Pawan Jain
Pawan Jain2w ago
Why we did it ?
Yes
Norrude
NorrudeOP2w ago
Multiple reasons: 1- We usually avoid using v0 on open source, but Novu fit our expectations. 2- We have a client expecting to be notified on SQS, custom step allows us to use Novu for it 3- React email compatibility 4- Our Notification creation Flow is now much better thanks to v2 (prior was: 3 steps, it's now 2) I'm guessing you have all this well in mind, otherwise you wouldn't have built a whole product around it haha
Pawan Jain
Pawan Jain2w ago
Thanks. @novu/framework provides more customization and control for sure. I have shared all the feedbacks with team and we will fix/add the docs for EU and migration
Norrude
NorrudeOP2w ago
Awesome, have a great day 🙂 Hello @Pawan Jain ! Getting some real painful 500's on remote syncs: Here is one of the error id: 85856bd955d4413bba7335e3b09a06c6
Pawan Jain
Pawan Jain2w ago
for reference: this issue is fixed in another support post
Want results from more Discord servers?
Add your server