N
Novu2mo ago
Shri

Studio does not connect to bridge app

Hey folks! I am self-hosting with Docker and using a Remix frontend and I am running the following command:
npx novu@latest dev --tunnel http://leftoverstoday-dev-01:4000 --port 4000 -d http://leftoverstoday-dev-01:4200 --origin http://leftoverstoday-dev-01:4000
npx novu@latest dev --tunnel http://leftoverstoday-dev-01:4000 --port 4000 -d http://leftoverstoday-dev-01:4200 --origin http://leftoverstoday-dev-01:4000
And I am successfully able to hit the bridge endpoint at http://leftoverstoday-dev-01:4000/novu/api and I get this response:
{
"status": "ok",
"sdkVersion": "2.3.0",
"frameworkVersion": "2024-06-26",
"discovered": {
"workflows": 1,
"steps": 1
}
}
{
"status": "ok",
"sdkVersion": "2.3.0",
"frameworkVersion": "2024-06-26",
"discovered": {
"workflows": 1,
"steps": 1
}
}
But the studio is stuck on connecting to Bridge Application. What am I missing here?
No description
14 Replies
Shri
ShriOP2mo ago
No description
Shri
ShriOP2mo ago
With the above settings I am able to trigger a notification from code, but the studio still does not connect
Pawan Jain
Pawan Jain2mo ago
@Shri Do you see any error in developer console ?
Shri
ShriOP2mo ago
No description
No description
Shri
ShriOP2mo ago
Yeah, its a Stripe error The URL is http://localhost:2022/studio/onboarding btw Also this call is failing: https://api.notifications.dev.preprod.leftovers.today/v1/telemetry/measure I have Sentry DSN configured but not new relic
Shri
ShriOP2mo ago
And I get the following error if I open the playground:
No description
Pawan Jain
Pawan Jain2mo ago
this is a bug from our side. playground should not be accessible in self hosting I am more interested in this
Shri
ShriOP2mo ago
Oh really? I put the URL behind a reverse proxy: https://studio.notifications.dev.preprod.leftovers.today/studio/flows So with self-hosting, do we just create a workflow in code and then use the github action to publish it to our Novu backend? Im still not exactly sure how the workflow I create will become available in Novu
Novu_Bot
Novu_Bot2mo ago
@Shri, you just advanced to level 3!
Pawan Jain
Pawan Jain2mo ago
@Shri you can sync using CLI https://docs.novu.co/deployment/cli
npx novu@latest sync --bridge-url <YOUR_DEPLOYED_URL> --secret-key <NOVU_SECRET_KEY> --api-url <YOUR_API_URL>
npx novu@latest sync --bridge-url <YOUR_DEPLOYED_URL> --secret-key <NOVU_SECRET_KEY> --api-url <YOUR_API_URL>
Local Studio is only for local testing
Shri
ShriOP2mo ago
I see, I was also able to hit the sync button and it removed all the demo workflows and only pulled in one email workflow, it did not pull my custom in-app workflow and didnt show me an error either I created this simple workflow:
export const testWorkflow2 = workflow('test-workflow2', async ({ step, payload }) => {
await step.inApp('inbox', async () => {
return {
subject: 'Welcome to Acme!',
body: 'We are excited to have you on board.',
avatar: 'https://acme.com/errors/dead_end_500.jpg',
redirect: {
url: 'https://acme.com/welcome',
target: '_blank',
},
primaryAction: {
label: 'Get Started',
redirect: {
url: 'https://acme.com/get-started',
target: '_self',
}
},
secondaryAction: {
label: 'Learn More',
redirect: {
url: 'https://acme.com/learn-more',
target: '_self',
}
},
data: {
customData: 'customValue',
text: payload.text,
},
};
});
});
export const testWorkflow2 = workflow('test-workflow2', async ({ step, payload }) => {
await step.inApp('inbox', async () => {
return {
subject: 'Welcome to Acme!',
body: 'We are excited to have you on board.',
avatar: 'https://acme.com/errors/dead_end_500.jpg',
redirect: {
url: 'https://acme.com/welcome',
target: '_blank',
},
primaryAction: {
label: 'Get Started',
redirect: {
url: 'https://acme.com/get-started',
target: '_self',
}
},
secondaryAction: {
label: 'Learn More',
redirect: {
url: 'https://acme.com/learn-more',
target: '_self',
}
},
data: {
customData: 'customValue',
text: payload.text,
},
};
});
});
And I also get these in the logs:
[0] 10:18:22 AM [vite] page reload app/novu/workflows.tsx
[0]
[0] Discovered workflowId: 'test-workflow'
[0] └ σ Discovered stepId: 'send-email' Type: 'email'
[0]
[0] Discovered workflowId: 'test-workflow2'
[0] └ σ Discovered stepId: 'notify-user' Type: 'in_app'
[0] 10:18:22 AM [vite] page reload app/novu/workflows.tsx
[0]
[0] Discovered workflowId: 'test-workflow'
[0] └ σ Discovered stepId: 'send-email' Type: 'email'
[0]
[0] Discovered workflowId: 'test-workflow2'
[0] └ σ Discovered stepId: 'notify-user' Type: 'in_app'
But only test-workflow is syncing, not my test-workflow2
Pawan Jain
Pawan Jain2mo ago
@Shri is this issue still happening?
Shri
ShriOP2mo ago
Yeah unfortunately It only syncs one test-workflow for email, and I am able to trigger that one correctly. I dont know why as soon as that workflow syncs, it stops showing all the demo workflows even though they are still in the DB, I can see them. It only syncs 1 workflow and then fails to sync a second one, even if I just make a copy of the first workflow and change the name it does not sync it
Pawan Jain
Pawan Jain2mo ago
@Shri I am DMing you
Want results from more Discord servers?
Add your server