sendingtk / chatwoot

Other
89 stars 78 forks source link

Error updating to V3.12.0 #99

Closed TheEmanuelSampaio closed 2 weeks ago

TheEmanuelSampaio commented 2 weeks ago

Describe the bug

And I found that it is a problem related to volumes. It only updates if I delete the volumes (which is unthinkable in production).

bundler: failed to load command: sidekiq (/gems/ruby/3.3.0/bin/sidekiq)
/usr/local/bundle/gems/bundler-2.5.17/lib/bundler/definition.rb:601:in `materialize': Could not find sentry-rails-5.18.2, sentry-ruby-5.18.2, sentry-sidekiq-5.18.2, sidekiq-7.3.0, rexml-3.3.2 in locally installed gems (Bundler::GemNotFound)
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/definition.rb:193:in `specs'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/definition.rb:259:in `specs_for'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/runtime.rb:18:in `setup'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler.rb:164:in `setup'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/setup.rb:32:in `block in <top (required)>'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/ui/shell.rb:159:in `with_level'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/ui/shell.rb:111:in `silence'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/setup.rb:32:in `<top (required)>'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:56:in `require_relative'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:56:in `kernel_load'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/cli/exec.rb:23:in `run'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/cli.rb:455:in `exec'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/cli.rb:35:in `dispatch'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/cli.rb:29:in `start'
    from /usr/local/bundle/gems/bundler-2.5.17/exe/bundle:28:in `block in <top (required)>'
    from /usr/local/bundle/gems/bundler-2.5.17/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /usr/local/bundle/gems/bundler-2.5.17/exe/bundle:20:in `<top (required)>'
    from /usr/local/bundle/bin/bundle:25:in `load'
    from /usr/local/bundle/bin/bundle:25:in `<main>'

Portainer 2.20.3. Server Hetzner.

To Reproduce

  1. Install ChatwootN v3.11.0 using the stack below
  2. Try to update the stack tag to v3.12.0 and redeploy.
    • Sidekiq container wont go up.
    • If you change back the tag to .11, it'll work again.
version: "3.7"
services:
  chatwoot_app:
    image: sendingtk/chatwoot:v3.11.0
    command: bundle exec rails s -p 3000 -b 0.0.0.0
    entrypoint: docker/entrypoints/rails.sh
    volumes:
      - chatwoot_data:/app/storage 
      - chatwoot_public:/app 
    networks:
      - network_public
    environment:
      - INSTALLATION_NAME=chatwoot
      - NODE_ENV=production
      - RAILS_ENV=production
      - INSTALLATION_ENV=docker
      - SECRET_KEY_BASE=abcdefghijklmnopqrstuvwxyz
      - FRONTEND_URL=https://yourdomain.com
      - DEFAULT_LOCALE=pt_BR
      - FORCE_SSL=true
      - ENABLE_ACCOUNT_SIGNUP=false
      - REDIS_URL=redis://redis:6379
      - POSTGRES_HOST=postgres
      - POSTGRES_USERNAME=postgres
      - POSTGRES_PASSWORD=abcdefghijklmnopqrstuvwxyz
      - POSTGRES_DATABASE=chatwoot
      - ACTIVE_STORAGE_SERVICE=local
      ############
      ##########
      - RAILS_LOG_TO_STDOUT=true
      - USE_INBOX_AVATAR_FOR_BOT=true
      # Servidor de Email Gmail
      - MAILER_SENDER_EMAIL="Chatwoot" <seuemail@gmail.com>
      - SMTP_DOMAIN=gmail.com
      - SMTP_ADDRESS=smtp.gmail.com
      - SMTP_PORT=587
      - SMTP_USERNAME=seuemail@gmail.com
      - SMTP_PASSWORD=abcdefghijklmnopqrstuvwxyz
      - SMTP_AUTHENTICATION=login
      - SMTP_ENABLE_STARTTLS_AUTO=true
      - SMTP_OPENSSL_VERIFY_MODE=peer
      - MAILER_INBOUND_EMAIL_DOMAIN=seuemail@gmail.com
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      labels:
        - traefik.enable=true
        - traefik.http.routers.chatwoot_app.rule=Host(`yourdomain.yourdomain.com`)
        - traefik.http.routers.chatwoot_app.entrypoints=websecure
        - traefik.http.routers.chatwoot_app.tls.certresolver=letsencryptresolver
        - traefik.http.routers.chatwoot_app.priority=1
        - traefik.http.routers.chatwoot_app.service=chatwoot_app
        - traefik.http.services.chatwoot_app.loadbalancer.server.port=3000 
        - traefik.http.services.chatwoot_app.loadbalancer.passhostheader=true 
        - traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https
        - traefik.http.routers.chatwoot_app.middlewares=sslheader@docker

  chatwoot_sidekiq:
    image: sendingtk/chatwoot:v3.11.0
    command: bundle exec sidekiq -C config/sidekiq.yml
    volumes:
      - chatwoot_data:/app/storage
      - chatwoot_public:/app
    networks:
      - network_public
    environment:
      - INSTALLATION_NAME=chatwoot
      - NODE_ENV=production
      - RAILS_ENV=production
      - INSTALLATION_ENV=docker
      - SECRET_KEY_BASE=abcdefghijklmnopqrstuvwxyz
      - FRONTEND_URL=https://yourdomain.com
      - DEFAULT_LOCALE=pt_BR
      - FORCE_SSL=true
      - ENABLE_ACCOUNT_SIGNUP=false
      - REDIS_URL=redis://redis:6379
      - POSTGRES_HOST=postgres
      - POSTGRES_USERNAME=postgres
      - POSTGRES_PASSWORD=abcdefghijklmnopqrstuvwxyz
      - POSTGRES_DATABASE=chatwoot
      - ACTIVE_STORAGE_SERVICE=local
      ############
      ##########
      - RAILS_LOG_TO_STDOUT=true
      - USE_INBOX_AVATAR_FOR_BOT=true
      # Servidor de Email Gmail
      - MAILER_SENDER_EMAIL="Chatwoot" <seuemail@gmail.com>
      - SMTP_DOMAIN=gmail.com
      - SMTP_ADDRESS=smtp.gmail.com
      - SMTP_PORT=587
      - SMTP_USERNAME=seuemail@gmail.com
      - SMTP_PASSWORD=abcdefghijklmnopqrstuvwxyz
      - SMTP_AUTHENTICATION=login
      - SMTP_ENABLE_STARTTLS_AUTO=true
      - SMTP_OPENSSL_VERIFY_MODE=peer
      - MAILER_INBOUND_EMAIL_DOMAIN=seuemail@gmail.com
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints:
          - node.role == manager

volumes:
  chatwoot_data:
    external: true
    name: chatwoot_data
  chatwoot_public:
    external: true
    name: chatwoot_public

networks:
  network_public:
    external: true
    name: network_public

Expected behavior

Sidekiq working on v3.12.0

Environment

app.chatwoot.com

Cloud Provider

Other [please specify in the description]

Platform

None

Operating system

No response

Browser and version

No response

Docker (if applicable)

No response

Additional context

No response

nestordavalos commented 2 weeks ago

The error is due to a bad practice that you are applying for an update, you do not have to use - chatwoot_public:/app as a volume, delete it and try again.

TheEmanuelSampaio commented 2 weeks ago

The error is due to a bad practice that you are applying for an update, you do not have to use - chatwoot_public:/app as a volume, delete it and try again.

Thank You So Much!

And there is another alternative to change the brand favicon on Portainer Instalations?

TheEmanuelSampaio commented 1 week ago

Here is what i've done:

      - chatwoot_data:/app/storage
      - chatwoot_public:/app/public
      - chatwoot_app_app:/app/app

First keep old files (once now i use S3). Second allows me to edit icons and favicons. Third allows me to edit e-mails.

Working beautifully!!