T
Twentyβ€’2mo ago
BabaBambule

Self-Hosted (Docker) can't create new workspace

Hey so whenever I try to create a new workspace on my self-hosted docker instance I get "An Error Occured" as a toast notification. Is there a log where I can look into the problem or does anyone know why this happens? Twenty is freshly installed with the 1-click script and the only thing I changed is I added a server_url in my .env and made it available via ssl on our domain
31 Replies
manstfu
manstfuβ€’2mo ago
you need to add
IS_MULTIWORKSPACE_ENABLED: ${IS_MULTIWORKSPACE_ENABLED}
DEFAULT_SUBDOMAIN: ${DEFAULT_SUBDOMAIN}
IS_MULTIWORKSPACE_ENABLED: ${IS_MULTIWORKSPACE_ENABLED}
DEFAULT_SUBDOMAIN: ${DEFAULT_SUBDOMAIN}
in compose.yaml environment: and this in .env
IS_MULTIWORKSPACE_ENABLED=true
DEFAULT_SUBDOMAIN=crm
IS_MULTIWORKSPACE_ENABLED=true
DEFAULT_SUBDOMAIN=crm
BabaBambule
BabaBambuleOPβ€’2mo ago
but what if I run my instance already on a subdomain? because now I get a redirect error to crm.leads.mydomain.com
manstfu
manstfuβ€’2mo ago
yea thats what im trying to do now you need to add *.leads in cloudflare dns because we use wildcards now
BabaBambule
BabaBambuleOPβ€’2mo ago
any nginx edits as well?
manstfu
manstfuβ€’2mo ago
yea it needs to use wildcard also then you need to set your server_url to SERVER_URL=https://crm.leads.website.com very strange those stacked subdomains
BabaBambule
BabaBambuleOPβ€’2mo ago
When I change the server_url to crm.leads.website.com i get a triple subdomain stacking which looked super weird and wasn't covered by my ssl cert. So switched the url back to leads.website.com and changed the default_subdomain to my primary workspace and now it's all working. Thanks for your help πŸ™‚
manstfu
manstfuβ€’2mo ago
if i set my server_url to https://leads.website.com i get Unable to Reach Back-end error because it tries to connect to https://workspace.leads.website.com you mean that you set DEFAULT_SUBDOMAIN to leads ? like this
SERVER_URL=https://leads.website.com
DEFAULT_SUBDOMAIN=leads
SERVER_URL=https://leads.website.com
DEFAULT_SUBDOMAIN=leads
?
BabaBambule
BabaBambuleOPβ€’2mo ago
well I was talking to early, couldn't switch between workspaces and stuff. So yeah currently fiddling around with it a bit
manstfu
manstfuβ€’2mo ago
yea 🀣 i think we need to use the strange stacking
BabaBambule
BabaBambuleOPβ€’2mo ago
just tried server_URL=website.com and default_subdomain=leads but then i'll receive a unable to reach back-end as well did you place IS_MULTIWORKSPACE_ENABLED: ${IS_MULTIWORKSPACE_ENABLED} DEFAULT_SUBDOMAIN: ${DEFAULT_SUBDOMAIN} inside the server environments or the worker enviroments in your yml file?
manstfu
manstfuβ€’2mo ago
yes
BabaBambule
BabaBambuleOPβ€’2mo ago
so both?
manstfu
manstfuβ€’2mo ago
if you set default_subdomain to 'default' server_url should be 'https://default.leads.website.com' and workspace will become, https://random.default.leads.website.com πŸͺ“
BabaBambule
BabaBambuleOPβ€’2mo ago
but then you'll need to add ..leads to cloudflare as well otherwise you won't get a ssl cert
manstfu
manstfuβ€’2mo ago
*.leads to cloudflare is enough i think
BabaBambule
BabaBambuleOPβ€’2mo ago
I'll get a not a safe connection error then
manstfu
manstfuβ€’2mo ago
yea me too
BabaBambule
BabaBambuleOPβ€’2mo ago
and since we plan to share it with our clients I certainly want to have a safe connection there πŸ˜…
manstfu
manstfuβ€’2mo ago
SERVER_URL=https://workspace.crm.website.com DEFAULT_SUBDOMAIN=workspace with this env i get redirected to https://workspace.workspace.crm.website.com/ wtf
BabaBambule
BabaBambuleOPβ€’2mo ago
ace so this is working for me SERVER_URL=https://leads.website.com DEFAULT_SUBDOMAIN=leads Now when I go to my page I get client.leads.website.com and can switch between my accounts now I'll stop touching it otherwise I'll just break it again πŸ’€
manstfu
manstfuβ€’2mo ago
yea it strange
BabaBambule
BabaBambuleOPβ€’2mo ago
so at least no triple subdomain weirdness
manstfu
manstfuβ€’2mo ago
so when you go to leads.website.com it works? or you need to go to leads.leads.website.com
BabaBambule
BabaBambuleOPβ€’2mo ago
yes it works it redirects me to my primary workspace which is company.leads.website.com
manstfu
manstfuβ€’2mo ago
that mean that ngix is still leads.website.com without wildcard
BabaBambule
BabaBambuleOPβ€’2mo ago
nope wildcard is in there wait server { listen 443 ssl; server_name leads.website.com *.leads.website.com; ssl_certificate /etc/letsencrypt/live/leads.website.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/leads.website.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } server { listen 80; server_name leads.website.com *.leads.website.com; return 301 https://$host$request_uri; }
manstfu
manstfuβ€’2mo ago
oh you have both of them
BabaBambule
BabaBambuleOPβ€’2mo ago
don't know why it keeps formatting the star out of my answers but yep got both of them in there like I said, works like a charm now. Just invited a team member to both teams. Told them to switch around create a company and user etc and for a brief test it seems to be working
manstfu
manstfuβ€’2mo ago
if you set SERVER_URL=https://leads.website.com/ it works but not connecting to db if i set SERVER_URL=https://leads.website.com without the last slash, i get redirect to leads.leads.website.com
BabaBambule
BabaBambuleOPβ€’2mo ago
that is super weird though that a trailing slash is making this whole thing act up like that
manstfu
manstfuβ€’2mo ago
im still fighting with it xD

Did you find this page helpful?