botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
68 stars 84 forks source link

blank page white page grey page chat bot window and emulator botpress error page not displaying #1705

Closed ResearchForumOnline closed 1 year ago

ResearchForumOnline commented 1 year ago

Describe the bug Blank page when i open a chat window for any chat bot i create.

To Reproduce Steps to reproduce the behavior:

  1. make a ubuntu 20 vps server (NO DOCKER) ( Using a large cloud VPS KVM )
  2. follow this tutorial i made: https://github.com/botpress/botpress/discussions/12393
  3. open the chat bot chat after creating a chat bot
  4. you will see a blank white page, and also emulator is blank too.

Expected behaviour no blank page and able to see data that should be displayed like that chat. Error Screenshots 2022-12-07_00-13

Environment (please complete the following information):

Additional context I have reinstalled 7 times this is not an issue on my side?

i followed this https://online-business-seo-forum.seotraining1.com/discussion/129/install-setup-ai-chat-bot-simple-easy-methods-using-botpress-or-rasa-full-info/p1?new=1 see that page it is exactly what i have done, also i have added fixes to issues that may happen.

Also, i get signed out after a while, i think may of edited and forgot, i edited the bits below:

Code Editor using web ui (admin area website where botpress is installed) To make the external url work i added the domain below, should i change localhost to example.domain.com ? Last time i edited the file wrongly i had to reinstall the server. Editing from ssh command line does not work for me and does not apply changes but no issues saving changes etc, even after rebooting and starting services a few times.

botpress.config.json

Currently settings:

{ "$schema": "bp://types/botpress.config.schema.json", "httpServer": { "host": "localhost", "port": 3000, "backlog": 0, "bodyLimit": "10mb", "cors": { "enabled": true }, "externalUrl": "https://bridge.talktoai.online/", "session": { "enabled": false, "maxAge": "1h" }, "socketTransports": [ "websocket", "polling" ], "rateLimit": { "enabled": false, "limitWindow": "30s", "limit": 600 }, "headers": { "X-Powered-By": "Botpress" } }, "dialog": { "janitorInterval": "10s", "timeoutInterval": "25m", "sessionTimeoutInterval": "30m" }, "logs": { "dbOutput": { "expiration": "2 weeks", "janitorInterval": "30s" }, "fileOutput": { "enabled": false, "folder": "./", "maxFileSize": 10000 } },

My only big issue now is blank white page for the bot urt but the ssl is showing url is correct now. Emulator also displays no data blank grey. Maybe i should change localhost to exmaple.domain.com

nginx.conf

                                                /etc/nginx/nginx.conf     

user www-data; worker_processes auto; pid /run/nginx.pid; include /etc/nginx/modules-enabled/*.conf;

events { worker_connections 768;

multi_accept on;

} http { upstream botpress-cluster { server localhost:3000; } server_tokens off; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; client_max_body_size 25M;

    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;
    types_hash_max_size 2048;
    # server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

}

mail {

See sample authentication script at:

http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript

auth_http localhost/auth.php;

pop3_capabilities "TOP" "USER";

imap_capabilities "IMAP4rev1" "UIDPLUS";

server {

listen localhost:110;

protocol pop3;

proxy on;

}

server {

listen localhost:143;

protocol imap;

proxy on;

}

}

/etc/nginx/sites-enabled/chat.talktoai.online

server {

listen on port 9443 (https)

listen 80;
server_name chat.talktoai.online MYSERVERIP;

location / {
    include proxy_params;
    proxy_pass http://127.0.0.1:3000;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/chat.talktoai.online/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chat.talktoai.online/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

ResearchForumOnline commented 1 year ago

@bassamtantawi-botpress help ^_^

ResearchForumOnline commented 1 year ago

I have changed to www.example.domain.com and reinstalled nginx a few times, does not seem to be fixing the blank page issue. Changed back now to https://example.domain.com The source code of the blank page is: env.js The issue maybe nginx but maybe botpress?? I have now reinstalled 15 times and deleted and created new servers with different ip addresses etc just to make sure it is not an issue from my servers etc. I am sure this issue is something very simple but i do not know what it is that will fix the blank page issue? I have been trying to fix this issue for over 2 months now, i am very sure the issue is something small maybe nginx or maybe botpress config or it is a bug?

I can provide a test server if anyone wants to try the tutorial i made, follow the same steps and see if you can fix the issue.

ResearchForumOnline commented 1 year ago

@bassamtantawi-botpress help ^_^

https://github.com/botpress/botpress/pull/627/files is this anything to do with the issue? botpress webchat blank page

bassamtantawi-botpress commented 1 year ago

Hi @securehosting1 ,

I am sorry I don't attend to issues. And that PR is four years old and has already been merged into the product. So I don't think this is related to your issue.

If Botpress on its own (HTTP://localhost:3000) works, then it is not a product issue.

ResearchForumOnline commented 1 year ago

Hi @securehosting1 ,

I am sorry I don't attend to issues. And that PR is four years old and has already been merged into the product. So I don't think this is related to your issue.

If Botpress on its own (HTTP://localhost:3000) works, then it is not a product issue.

with http only no https the chat bot still has a blank page.

ResearchForumOnline commented 1 year ago

I have now moved on to docker and portainer, i may make a custom app image for botpress if needed, will post how i get setup once i work it all out, still learning. Can not get botpress to display chatbot window without a blank page, now the only method i can think if that will work, (fix the blank page issue) is using docker. WILL ADD TO THIS POST ONCE I GET A WORKING SETUP.

ResearchForumOnline commented 1 year ago

Can anyone provide a portainer app stack for botpress?

ResearchForumOnline commented 1 year ago

I have tried everything can not get botpress working for chat bot or emulator both blank, @bassamtantawi-botpress @djanowski @zipme @jonbaer Can anyone help this has been 4 months now, i know someone who can fix but he's never online/busy and has no interest in botpress. New domain talktoai.org must be something small i am thinking nginx issues.

ResearchForumOnline commented 1 year ago

https://talktoai.online/p/20/talk-to-ai-now site is up postgress and SSL working fine, https://talktoai.org just for botpress, i will keep playing around with Nginx see if i can fix, if not will try find an alternative, but honestly, there is no better alternative. 2022-12-29_03-56

ResearchForumOnline commented 1 year ago

FIXED THE ISSUE! Nginx was the issue. @bassamtantawi-botpress

                                             /etc/nginx/sites-available/

server {

listen on port 80 (http)

server_name talktoai.org ServerIPhere www.talktoai.org;

location / { include proxy_params; proxy_pass https://127.0.0.1; }

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/talktoai.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/talktoai.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server { if ($host = talktoai.org) { return 301 https://$host$request_uri; } # managed by Certbot

listen 80; server_name talktoai.org ServerIPhere www.talktoai.org; return 404; # managed by Certbot

}

/////////////////////////////////////////////////////////////////////////////

/etc/nginx/nginx.conf

events { worker_connections 1024; } http { upstream botpress-cluster { server localhost:3000; } server_tokens off; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; client_max_body_size 50M; proxy_cache_path /srv/nginx_cache levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=60m use_temp_path=off; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /access.log main; error_log /error.log; server { server_name talktoai.org;

Enable caching of assets by NGINX to reduce load on the server

location ~ ./assets/. { proxy_cache my_cache; proxy_ignore_headers Cache-Control; proxy_hide_header Cache-Control; proxy_hide_header Pragma; proxy_pass http://botpress-cluster; proxy_cache_valid any 30m; proxy_set_header Cache-Control max-age=30; add_header Cache-Control max-age=30; } location /socket.io/ { proxy_pass http://botpress-cluster/socket.io/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } location / { proxy_pass http://botpress-cluster; }

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/talktoai.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/talktoai.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

} server { if ($host = talktoai.org) { return 301 https://$host$request_uri; } # managed by Certbot

server_name talktoai.org; listen 80; return 404; # managed by Certbot

}}

//////////////////////////////////////////////////////////////////////////////// I am getting blank pages sometimes but reload fixes it, maybe the settings above could be tweaked?