Troubleshooting Chatwoot Installation and Setup

TLDR lauuu faces issues while setting up Chatwoot. v_shnu provides troubleshooting strategies such as commenting out a line in the script, passing a variable to the script, and creating a new VM, but the problems persist.

Photo of lauuu
lauuu
Thu, 23 Jun 2022 18:43:03 UTC

that setup log is pretty large. What exactly can i look for?

Photo of v_shnu
v_shnu
Fri, 24 Jun 2022 06:56:43 UTC

hey lauuu , what does it say at the end?

Photo of lauuu
lauuu
Fri, 24 Jun 2022 16:02:24 UTC

v_shnu thanks. I see this: WARNING: apt does not have a stable CLI interface. Use with caution in scripts. Reading package lists... Building dependency tree... Reading state information... postgresql is already the newest version (12+214ubuntu0.1). postgresql-contrib is already the newest version (12+214ubuntu0.1). redis-server is already the newest version (5:5.0.7-2ubuntu0.1). The following packages were automatically installed and are no longer required: linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic linux-image-5.4.0-26-generic linux-modules-5.4.0-26-generic linux-modules-extra-5.4.0-26-generic Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. adduser: The user `chatwoot' already exists.

Photo of v_shnu
v_shnu
Fri, 24 Jun 2022 17:40:25 UTC

Looks like you re-run the script? Did it fail before?

Photo of v_shnu
v_shnu
Fri, 24 Jun 2022 17:47:20 UTC

This is now failing as the user chatwoot is already present

Photo of v_shnu
v_shnu
Fri, 24 Jun 2022 17:47:53 UTC

could you comment out line 219 in the script and try again? the line that says the following ```219 configure_rvm```

Photo of lauuu
lauuu
Fri, 24 Jun 2022 21:17:56 UTC

it worked. Thanks a lot!

Photo of lauuu
lauuu
Mon, 04 Jul 2022 20:37:21 UTC

hi v_shnu I have tried to uninstall chatwoot so that I could install it again to set up the domain properly

Photo of lauuu
lauuu
Mon, 04 Jul 2022 20:37:42 UTC

when I try to run the script it fails and this is what the log shows

Photo of lauuu
lauuu
Mon, 04 Jul 2022 20:37:43 UTC

[5/5] Building fresh packages... Done in 7.36s. Everything's up-to-date. Nothing to do Database 'chatwoot_production' already exists rake aborted! ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database. If you are sure you want to continue, run the same command with the environment variable: DISABLE_DATABASE_ENVIRONMENT_CHECK=1 /usr/local/rvm/gems/ruby-3.0.4/gems/activerecord-6.1.5.1/lib/active_record/tasks/database_tasks.rb:63:in `check_protected_environments!' /usr/local/rvm/gems/ruby-3.0.4/gems/activerecord-6.1.5.1/lib/active_record/railties/databases.rake:18:in `block (2 levels) in

' /usr/local/rvm/gems/ruby-3.0.4/gems/sentry-ruby-core-5.3.0/lib/sentry/rake.rb:24:in `execute' /usr/local/rvm/gems/ruby-3.0.4/gems/rake-13.0.6/exe/rake:27:in `' /usr/local/rvm/gems/ruby-3.0.4/bin/ruby_executable_hooks:22:in `eval' /usr/local/rvm/gems/ruby-3.0.4/bin/ruby_executable_hooks:22:in `
' Tasks: TOP => db:reset => db:drop => db:check_protected_environments (See full trace by running task with --trace)

Photo of lauuu
lauuu
Mon, 04 Jul 2022 20:37:50 UTC

could you help?

Photo of v_shnu
v_shnu
Tue, 05 Jul 2022 12:06:35 UTC

This is due to production chatwoot database being already created.

Photo of v_shnu
v_shnu
Tue, 05 Jul 2022 12:07:06 UTC

`DISABLE_DATABASE_ENVIRONMENT_CHECK=1` pass this to script when rerunning to override this

Photo of lauuu
lauuu
Tue, 05 Jul 2022 15:18:56 UTC

should place DISABLE_DATABASE_ENVIRONMENT_CHECK=1 inside install.sh at a specific line?

Photo of v_shnu
v_shnu
Wed, 06 Jul 2022 06:18:44 UTC

```DISABLE_DATABASE_ENVIRONMENT_CHECK=1 ./install.sh master```

Photo of v_shnu
v_shnu
Wed, 06 Jul 2022 06:19:11 UTC

you can pass variables to a process/script like this

Photo of v_shnu
v_shnu
Wed, 06 Jul 2022 06:19:56 UTC

If you are installing/uninstalling multiple times, I would recommend spinning up a new instance and doing it fresh. Will be easier.

Photo of lauuu
lauuu
Wed, 06 Jul 2022 17:44:41 UTC

it didn't work. I'll try creating a new VM. Thanks!

Photo of v_shnu
v_shnu
Thu, 07 Jul 2022 04:46:34 UTC

sounds good

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:11:02 UTC

v_shnu

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:11:28 UTC

sorry to bother you again. I've created a new machine, but I'm getting the same error

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:11:45 UTC

warning " > @storybook/[email protected]" has unmet peer dependency "css-loader@*". warning "@storybook/vue > [email protected]" has unmet peer dependency "typescript@*". warning "@storybook/vue > vue-docgen-api > @vue/[email protected]" has incorrect peer dependency "[email protected]". warning " > [email protected]" has unmet peer dependency "webpack@>=1.11.0". warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". [5/5] Building fresh packages... Done in 7.57s. Everything's up-to-date. Nothing to do Database 'chatwoot_production' already exists rake aborted! ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database. If you are sure you want to continue, run the same command with the environment variable: DISABLE_DATABASE_ENVIRONMENT_CHECK=1 /usr/local/rvm/gems/ruby-3.0.4/gems/activerecord-6.1.5.1/lib/active_record/tasks/database_tasks.rb:63:in `check_protected_environments!' /usr/local/rvm/gems/ruby-3.0.4/gems/activerecord-6.1.5.1/lib/active_record/railties/databases.rake:18:in `block (2 levels) in

' /usr/local/rvm/gems/ruby-3.0.4/gems/sentry-ruby-core-5.3.0/lib/sentry/rake.rb:24:in `execute' /usr/local/rvm/gems/ruby-3.0.4/gems/rake-13.0.6/exe/rake:27:in `' /usr/local/rvm/gems/ruby-3.0.4/bin/ruby_executable_hooks:22:in `eval' /usr/local/rvm/gems/ruby-3.0.4/bin/ruby_executable_hooks:22:in `
' Tasks: TOP => db:reset => db:drop => db:check_protected_environments (See full trace by running task with --trace)

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:11:57 UTC

I tried DISABLE_DATABASE_ENVIRONMENT_CHECK=1 ./install.sh master

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:12:02 UTC

but it's the same

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:23:17 UTC

I restarted the chatwoot process and could access via port 3000

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:23:37 UTC

Photo of lauuu
lauuu
Fri, 08 Jul 2022 21:25:31 UTC

but, I wanted to set the dns domain and ssl, which doesn't look like it got done properly