Closed luck-git closed 1 year ago
Can you try removing the end slash of the viewer url?
http://140.82.42.177:3002/
=> http://140.82.42.177:3002
I checked but this is same like you recommend , So this can't be the issue .... {Builder and viewer are not making connection}
Have you followed this guide? https://docs.typebot.io/self-hosting/manual
You need to build the viewer like this pnpm run build:viewer
I can see that the populated env var is http://localhost:3001
Yes i have followed the guide .. There are two options to build .. First is You can Build it together and The second is You can build them separately . And I have build them in one single command . pnpm run build:apps . So,as you say I can try to build them separately .. Could You please help me as there I have provided the configurations what should i change in it .?
Can you show the output of pnpm build:apps
?
I got similar error yet on caprover. I upgraded like always did until now, and everything on builder side worked. Yet viewer was giving that error. I reverted to previous version i had, works like a charm.
I got similar error yet on caprover. I upgraded like always did until now, and everything on builder side worked. Yet viewer was giving that error. I reverted to previous version i had, works like a charm.
What versions are we talking about?
That really doesn't help š can you paste the entire output of pnpm build:apps
no screenshot please š
Yes sure i will paste the whole output of pnpm build:apps ... Thanks
Yes sure i will paste the whole output of pnpm build:apps ... Thanks
I got similar error yet on caprover. I upgraded like always did until now, and everything on builder side worked. Yet viewer was giving that error. I reverted to previous version i had, works like a charm.
What version ?
It can be the reason of s3 that it's not publishing ?
I got similar error yet on caprover. I upgraded like always did until now, and everything on builder side worked. Yet viewer was giving that error. I reverted to previous version i had, works like a charm.
What versions are we talking about?
That really doesn't help š can you paste the entire output of
pnpm build:apps
no screenshot please š
@baptisteArno I reffered to previous version as to latest stable 2.15.2. When upgrading to latest release viewer stopped working. Now tell me again please what logs you need here is the command you mentioned pnpm with current release.
root@7d37443bdefa:/app# pnpm build:apps
> typebot-os@2.15.2 build:apps /app
> turbo run build --filter=builder... --filter=viewer...
ā¢ Running build
ā¢ Remote caching disabled
No tasks were executed as part of this run.
Tasks: 0 successful, 0 total
Cached: 0 cached, 0 total
Time: 32ms
Shoul I try to upgrade to 2.16.0 and run the command again?
Note this runs on caprover, all previous upgrades until 2.16.0 worked fine both for viewer and builder.
When I navigate to http://140.82.42.177:3002, then in console I checked the injected public env vars:
window.__env
, I see:
{VIEWER_URL: ''}
So it didn't successfully injected the variables. Are you sure that you have a apps/viewer/.env.docker
file with the following content:
# Don't edit this file
NEXT_PUBLIC_VIEWER_URL=
NEXT_PUBLIC_E2E_TEST=
It should stay as is, don't edit this file.
Then check if you have a apps/viewer/.env.local
with at least that variable in it:
NEXT_PUBLIC_VIEWER_URL=http://140.82.42.177:3002
Is this the case?
When I navigate to http://140.82.42.177:3002, then in console I checked the injected public env vars:
window.__env
, I see:{VIEWER_URL: ''}
So it didn't successfully injected the variables. Are you sure that you have a
apps/viewer/.env.docker
file with the following content:# Don't edit this file NEXT_PUBLIC_VIEWER_URL= NEXT_PUBLIC_E2E_TEST=
It should stay as is, don't edit this file.
Then check if you have a
apps/viewer/.env.local
with at least that variable in it:NEXT_PUBLIC_VIEWER_URL=http://140.82.42.177:3002
Is this the case?
I have followed the directions but still it's showing "The bot you're looking for doesn't exist." .env.docker File is present with the same content you have showed and i check the variables It's set .
Ok, I think the issue is due to cache.
Can you try to run: pnpm turbo run build --filter=builder... --filter=viewer... --force
.
That will build the apps and bypass the cache, it will most likely fix the issue. Do you confirm?
Fixed with new env variables management
Hey, I am facing the same issue. I just synced the fork again. Last sync was 63 days ago. The builder deployed perfectly but the viewer didn't. And when I open the viewer now for a typebot chat that I have recently updated, it tells me: "Error! Couldn't initiate the chat" - So what was the final solution? Thanks in advance!
Can you provide the server logs? There should be a clear error there.
expected 1" }, { "code": "invalid_literal", "expected": 1, "path": [ "groups", 18, "blocks", 0, "items", 5, "type" ], "message": "Invalid literal value, expected 1" }, { "code": "invalid_literal", "expected": 1, "path": [ "groups", 18, "blocks", 0, "items", 6, "type" ], "message": "Invalid literal value, expected 1" }, { "code": "invalid_literal", "expected": 1, "path": [ "groups", 18, "blocks", 0, "items", 7, "type" ], "message": "Invalid literal value, expected 1" }, { "code": "invalid_literal", "expected": 1, "path": [ "groups", 18, "blocks", 0, "items", 8, "type" ], "message": "Invalid literal value, expected 1" }, { "code": "invalid_literal", "expected": 1, "path": [ "groups", 18, "blocks", 0, "items", 9, "type" ], "message": "Invalid literal value, expected 1" } ] at get error [as error] (file:///var/task/node_modules/.pnpm/zod@3.21.4/node_modules/zod/lib/index.mjs:537:31) at ZodEffects.parse (file:///var/task/node_modules/.pnpm/zod@3.21.4/node_modules/zod/lib/index.mjs:636:22) at getTypebot (/var/task/apps/viewer/.next/server/pages/api/v1/[...trpc].js:4564:117) at async startSession (/var/task/apps/viewer/.next/server/pages/api/v1/[...trpc].js:4435:21) at async /var/task/apps/viewer/.next/server/pages/api/v1/[...trpc].js:3291:120 at async resolveMiddleware (file:///var/task/node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/index.mjs:416:30) at async callRecursive (file:///var/task/node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/index.mjs:452:32) at async outputMiddleware (file:///var/task/node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/index.mjs:297:24) at async callRecursive (file:///var/task/node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/index.mjs:452:32) at async callRecursive (file:///var/task/node_modules/.pnpm/@trpc+server@10.34.0/node_modules/@trpc/server/dist/index.mjs:452:32) { issues: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ], addIssue: [Function (anonymous)], addIssues: [Function (anonymous)], errors: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ] } }
And when I try to open the chat inside the builder in preview mode, I get this:
and in vercel there are no logs at all because it doesn't even show me that it even tried to deploy... The only logs are for the old ones.
@seabysalt Hi, what version you had before upgrade and to what version you upgraded to?
the viewer deployment failed
Can you tell us what are the deployment logs? What's the error message?
I would love to and that's what is weird. There are no logs. In vercel, I can only see the ones for the builder, which worked fine but for the viewer there is not even an error message. Also, on github, I can only see this:
<img width="932" alt="Screenshot 2023-11-16 at 13 21 14" src="https://github.com/baptis
teArno/typebot.io/assets/50774780/260e57fa-6541-451f-9aa8-432cfda6759b">
that's why its so tough to debug for me...
This check however seems to be failing:
With this error @baptisteArno create-tag The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Maybe some helpful information: I synced the fork directly within github. I deploy it using vercel and I am using supabase as my database. Once I sync it in github, it usually automatically deploys with vercel but after syncing it this time, only the builder deployed, the viewer in github (as can be seen above) said it "failed" but once I look into the logs, there is no log showing that it even attempted to deploy. In Vercel it shows nothing and in github, the latest deployments looks as seen on the screenshots. There is only this one error for the job create tag
The latest version before was 2.17.2 and the version now is 2.19.0 @uhlhosting
@seabysalt Thanks for that. Im just thinking it could have to do with some changes made in between these releases. So it could help @baptisteArno better to see what push broked it.
Go to the Vercel deployments tab
You should see the failing deployment here, click on it and tell us what the error is š
That's what I did. That's what I mean is strange, because on the viewer it doesn't show me any deployment in the last hours. Just for the builder it shows it, see:
@baptisteArno do you understand now that I don't know what to do and why I cannot show you any logs? There is nothing, I could potentially click on and I just cannot figure out, why... What would you do?
For the builder, the latest deployment was 20 hours ago and for the viewer 64 days ago (see screenshots). So, there is no error but on github it says that the deployment to the viewer failed, whereas it does not say that or show any proof of it on vercel, saying there are no logs... And I cannot use any updated chats now anymore.
On Vercel it shows no deployment attempt for the viewer (thus, no error logs) and on github it shows this, which is why I suspect it could have something to do with this tag thing that failed. Have you encountered anything like this before?
Then that's an issue with Vercel, try to re-create the pull request or contact them if it persists
In case someone else encounters this one day as well:
I found the issue after all & vercel actually left a comment on a commit that it's related to the plan I am using:
"If the Vercel for Git integration is installed properly, the Vercel Bot will leave comments on your commits that indicate success or failure. These comments may not always be present on the pull request if no Deployment could be created, this occurs when pre-deployment validation fails, for example, an incorrectly formatted vercel.json file."
Thank you @baptisteArno & @uhlhosting for looking into this with me.
I have hosted manually the typebot on node.js using nginx server and PM2 .. Builder is working smoothly but the viewer part is not working at all . I'll attach the builder and viewer .env.local files . so it will be easy to understand if i have done any mistakes in it. BUILDER .ENV.LOCAL FILE - DATABASE_URL=postgresql://typebot:typebot@localhost:5432/typebot # Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration) ENCRYPTION_SECRET=eYZhjc+vW6E2+tc3EdD6k2hu2/B8xqSLJMbqCzEeLjO5DmHR7g5xlNUoKGofJL4A NEXTAUTH_URL=http://140.82.42.177:3001/ NEXT_PUBLIC_VIEWER_URL=http://140.82.42.177:3002/ # Email settings SMTP_USERNAME=## SMTP_PASSWORD=## SMTP_HOST=smtp.zoho.in SMTP_PORT=587 NEXT_PUBLIC_SMTP_FROM='Ai Therapy Notification' ## SMTP_SECURE=false DISABLE_SIGNUP=False ADMIN_EMAIL= ## DEFAULT_WORKSPACE_PLAN=PRO
VIEWER .ENV.LOCAL FILE- ENCRYPTION_SECRET=eYZhjc+vW6E2+tc3EdD6k2hu2/B8xqSLJMbqCzEeLjO5DmHR7g5xlNUoKGofJL4A #256-bits secret (can be generated here: https://www.allkeysgenerator.com/Random/Security-Encryption-Key-Generator.aspx) NEXT_PUBLIC_VIEWER_URL=https://140.82.42.177:3002/ DATABASE_URL=postgresql://typebot:typebot@localhost:5432/typebot NEXTAUTH_URL=http://140.82.42.177:3001/ SMTP_USERNAME=## SMTP_PASSWORD=## SMTP_HOST=smtp.zoho.in SMTP_PORT=587 SMTP_FROM='Ai Therapy Notification' ## SMTP_SECURE=false