containers icon indicating copy to clipboard operation
containers copied to clipboard

[bitnami/suitecrm] SuiteCRM 8.x mail configuration not working

Open tldev-de opened this issue 1 year ago • 10 comments

Name and Version

bitnami/suitecrm:8

What architecture are you using?

amd64

What steps will reproduce the bug?

  1. Start a fresh docker compose stack with this config:
version: "2"

services:
  db:
    image: mariadb:10.5
    restart: unless-stopped
    environment:
      - MYSQL_DATABASE=suitecrm
      - MYSQL_USER=suitecrm
      - MYSQL_PASSWORD=suitecrm
      - MYSQL_ROOT_PASSWORD=suitecrm
    volumes:
      - db_data:/var/lib/mysql

  suitecrm:
    image: docker.io/bitnami/suitecrm:8
    restart: unless-stopped
    environment:
      - SUITECRM_DATABASE_HOST=db
      - SUITECRM_DATABASE_PORT_NUMBER=3306
      - SUITECRM_DATABASE_NAME=suitecrm
      - SUITECRM_DATABASE_USER=suitecrm
      - SUITECRM_DATABASE_PASSWORD=suitecrm
      - [email protected]
      - SUITECRM_PASSWORD=ooj6jah3XXXXeiS7
      - [email protected]
      - SUITECRM_SMTP_HOST=mail.XXX.XXX
      - SUITECRM_SMTP_PORT=587
      - [email protected]
      - SUITECRM_SMTP_PASSWORD=XXXXXXXXXXX
      - SUITECRM_SMTP_PROTOCOL=tls
      - SUITECRM_SMTP_NOTIFY_NAME=suitecrm
      - [email protected]
    ports:
      - '8080:8080'
      - '8443:8443'
    volumes:
      - 'data:/bitnami/suitecrm'
    depends_on:
      - db

volumes:
  db_data:
  data:

What is the expected behavior?

SuiteCRM should start and configure SMTP

What do you see instead?

there is an error configuring SMTP in the application

suitecrm-suitecrm-1  | suitecrm 09:29:49.30 INFO  ==> Running setup wizard
suitecrm-suitecrm-1  | suitecrm 09:29:55.61 INFO  ==> Starting apache in background
suitecrm-suitecrm-1  | suitecrm 09:30:00.73 INFO  ==> apache started
suitecrm-suitecrm-1  | suitecrm 09:30:00.73 INFO  ==> Configuring SMTP
suitecrm-suitecrm-1  | suitecrm 09:30:01.11 ERROR ==> An error occurred while trying to login to configure SMTP
suitecrm-suitecrm-1 exited with code 1

tldev-de avatar Sep 06 '23 09:09 tldev-de

Hi,

Could you launch it with BITNAMI_DEBUG=true env var to see if it provide more insight on the issue?

javsalgar avatar Sep 07 '23 09:09 javsalgar

with this environment variable set this is the log:

suitecrm-suitecrm-1  | suitecrm 11:07:05.02 
suitecrm-suitecrm-1  | suitecrm 11:07:05.02 Welcome to the Bitnami suitecrm container
suitecrm-suitecrm-1  | suitecrm 11:07:05.02 Subscribe to project updates by watching https://github.com/bitnami/containers
suitecrm-suitecrm-1  | suitecrm 11:07:05.02 Submit issues and feature requests at https://github.com/bitnami/containers/issues
suitecrm-suitecrm-1  | suitecrm 11:07:05.03 
suitecrm-suitecrm-1  | suitecrm 11:07:05.03 INFO  ==> ** Starting SuiteCRM setup **
suitecrm-suitecrm-1  | suitecrm 11:07:05.04 DEBUG ==> Validating settings in APACHE_* environment variables
suitecrm-suitecrm-1  | suitecrm 11:07:05.07 INFO  ==> Generating sample certificates
suitecrm-suitecrm-1  | Generating RSA private key, 4096 bit long modulus (2 primes)
suitecrm-suitecrm-1  | ...................................................................................................................................................++++
suitecrm-suitecrm-1  | ............................................................................................................................................................................................++++
suitecrm-suitecrm-1  | e is 65537 (0x010001)
suitecrm-suitecrm-1  | Signature ok
suitecrm-suitecrm-1  | subject=CN = example.com
suitecrm-suitecrm-1  | Getting Private key
suitecrm-suitecrm-1  | realpath: /bitnami/apache/conf: No such file or directory
suitecrm-suitecrm-1  | suitecrm 11:07:06.24 INFO  ==> Configuring Apache ServerTokens directive
suitecrm-suitecrm-1  | suitecrm 11:07:06.24 DEBUG ==> Configuring ServerTokens Prod on file /opt/bitnami/apache/conf/httpd.conf
suitecrm-suitecrm-1  | suitecrm 11:07:06.28 INFO  ==> Configuring PHP options
suitecrm-suitecrm-1  | suitecrm 11:07:06.28 INFO  ==> Setting PHP expose_php option
suitecrm-suitecrm-1  | suitecrm 11:07:06.29 INFO  ==> Setting PHP output_buffering option
suitecrm-suitecrm-1  | suitecrm 11:07:06.32 INFO  ==> Validating settings in MYSQL_CLIENT_* env vars
suitecrm-suitecrm-1  | suitecrm 11:07:06.34 DEBUG ==> Validating settings in SUITECRM_* environment variables...
suitecrm-suitecrm-1  | suitecrm 11:07:06.40 INFO  ==> Ensuring SuiteCRM directories exist
suitecrm-suitecrm-1  | suitecrm 11:07:06.42 INFO  ==> Trying to connect to the database server
suitecrm-suitecrm-1  | suitecrm 11:07:06.42 DEBUG ==> Executing SQL command:
suitecrm-suitecrm-1  | SELECT 1
suitecrm-suitecrm-1  | 1
suitecrm-suitecrm-1  | suitecrm 11:07:06.45 INFO  ==> Running setup wizard
suitecrm-suitecrm-1  | [07-Sep-2023 11:07:06 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/bitnami/suitecrm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 134
suitecrm-suitecrm-1  | [07-Sep-2023 11:07:06 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/bitnami/suitecrm/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php on line 144
suitecrm-suitecrm-1  | [07-Sep-2023 11:07:06 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Session::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/bitnami/suitecrm/vendor/symfony/http-foundation/Session/Session.php on line 131
suitecrm-suitecrm-1  | [07-Sep-2023 11:07:06 UTC] PHP Deprecated:  Return type of Symfony\Component\HttpFoundation\Session\Session::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /opt/bitnami/suitecrm/vendor/symfony/http-foundation/Session/Session.php on line 141
suitecrm-suitecrm-1  | 
suitecrm-suitecrm-1  | SuiteCRM Silent Install
suitecrm-suitecrm-1  | ============
suitecrm-suitecrm-1  | 
suitecrm-suitecrm-1  | Running: check-install-lock
suitecrm-suitecrm-1  | step: check-install-lock | status: done
suitecrm-suitecrm-1  | Installer not locked. Proceeding with install
suitecrm-suitecrm-1  | Running: check-db-connection
suitecrm-suitecrm-1  | step: check-db-connection | status: done
suitecrm-suitecrm-1  | DB credentials ok
suitecrm-suitecrm-1  | Running: install-system-checks
suitecrm-suitecrm-1  | step: install-system-checks | status: done
suitecrm-suitecrm-1  | Running: create-config
suitecrm-suitecrm-1  | step: create-config | status: done
suitecrm-suitecrm-1  | Created silent install config: config_si.php
suitecrm-suitecrm-1  | Running: create-env
suitecrm-suitecrm-1  | step: create-env | status: done
suitecrm-suitecrm-1  | Created .env.local
suitecrm-suitecrm-1  | Running: run-legacy-install
suitecrm-suitecrm-1  | step: run-legacy-install | status: done
suitecrm-suitecrm-1  | Legacy install successful
suitecrm-suitecrm-1  | 
suitecrm-suitecrm-1  | ============
suitecrm-suitecrm-1  | suitecrm 11:07:13.18 INFO  ==> Starting apache in background
suitecrm-suitecrm-1  | suitecrm 11:07:18.29 INFO  ==> apache started
suitecrm-suitecrm-1  | suitecrm 11:07:18.29 INFO  ==> Configuring SMTP
suitecrm-suitecrm-1  | suitecrm 11:07:18.78 ERROR ==> An error occurred while trying to login to configure SMTP
suitecrm-suitecrm-1 exited with code 1

I think the problem is, that the auth endpoint changed from suitecrm 7 to suitecrm 8. The new endpoint is at POST /login and expects the username and password as json {"username":"will","password":"will"}.

Maybe this curl command helps:

curl 'https://suite8demo.suiteondemand.com/login' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'content-type: application/json' \
  -H 'cookie: LEGACYSESSID=498c4f5560240e4dc48924fcfee096a6; PHPSESSID=59ac7d66274aa262851a3e2dda19d0eb; XSRF-TOKEN=iVdOEqfoV9bb--_Hg1eNrvjNuQ1e38LajjDBUbVpGgc' \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \
  -H 'x-xsrf-token: iVdOEqfoV9bb--_Hg1eNrvjNuQ1e38LajjDBUbVpGgc' \
  --data-raw '{"username":"will","password":"will"}'

tldev-de avatar Sep 07 '23 11:09 tldev-de

Hi @tldev-de, thanks for sharing these details. Have you tried configuring SMTP for SuiteCRM 7? To confirm that it is a regression. Or maybe configuring mailing via UI?

andresbono avatar Sep 14 '23 10:09 andresbono

With the SuiteCRM 7 image everything works fine, manual configuration as well as environment variables. Manual configuration in the suitecrm 8 (no env variables set, but manual configuration in the browser after everything runs) works as well. So the problem is related to suitecrm 8 and the configuration over environment variables.

tldev-de avatar Sep 17 '23 10:09 tldev-de

Hi @tldev-de, thank you very much for confirming it. This is definitely a bug in the way we configure SuiteCRM 8. Thank you for reporting it.

We will try to allocate some time to investigate the issue.

In the meantime, could you please set the email configuration manually via web browser?

andresbono avatar Sep 25 '23 14:09 andresbono

I've reported same bug a bit earlier

lazyest avatar Feb 28 '24 12:02 lazyest

How come the issue is not fixed after half a year has gone by? :shrug:

Kudze avatar May 10 '24 13:05 Kudze

Unfortunately and due to other priorities we didn't have the bandwidth to work on this issue. Since the code is open source and available in this repo, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

carrodher avatar May 13 '24 09:05 carrodher