Alrighty! I’ve created an issue on SuiteDocs GitHub for this. Include php module dependencies for installing Suite 8 · Issue #526 · salesagility/SuiteDocs · GitHub
Hi there,
I’m having issues getting the new interface up and running.
I’ve been able to install via the CLI and can login using the Legacy URL, (http://localhost/legacy/index.php?action=Login&module=Users), however the new login page just keeps on telling me that the username and password are incorrect. The console logs a polyfills-es2015.af170ffe981b0ba2d77d.js:118 POST http://localhost/login 500 (Internal Server Error)
.
In the logs I also get:
request.CRITICAL: Uncaught PHP Exception Doctrine\DBAL\Exception\ConnectionException: "An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory" at /var/www/html/SuiteCRM/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 112 {"exception":"[object] (Doctrine\\DBAL\\Exception\\ConnectionException(code: 0): An exception occurred in driver: SQLSTATE[HY000] [2002] No such file or directory at /var/www/html/SuiteCRM/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:112, Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 2002): SQLSTATE[HY000] [2002] No such file or directory at /var/www/html/SuiteCRM/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18, PDOException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory at /var/www/html/SuiteCRM/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:39)"} []
I’ve confirmed that pdo_mysql is installed and is running, I’ve also checked to ensure that rewrites is enabled. I just cant see what I’m doing wrong
Running Apache2 with PHP8 on Ubuntu (latest) inside of Docker/Docker-Compose.
Cheers!
Hi @jont_titmus,
Welcome to the community and thanks for trying out SuiteCRM 8 beta.
Also, thanks for posting the logs, thats helpful.
Could you check if you have mysqli
extension installed, please? From the logs it seems like it could be it.
Hope this helps
Hey @clemente.raposo,
Thanks! And thanks for the swift reply
Yes, mysqli
is installed and running:
php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
intl
json
libxml
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
Hi @jont_titmus,
Thanks for the feedback.
Was looking into this issue.
Found some threads, talking about this issue. More on this
My guess at the moment is that it could be docker config related issue. I Imagine you have your db setup on a separate service of docker compose, something like:
db:
image: mysql
ports:
- "3306:3306"
environment:
...
if so, on the db url are you using localhost
/ 127.0.0.1
for the server address? Could you try using the name of your docker database service, on the above example is db
. You can change this on .env.local
file that should have been generated on install.
Hey @clemente.raposo,
This is my docker config for mysql:
mysql_crm:
image: mariadb:10.4
ports:
- “3306:3306”
environment:
- MYSQL_ROOT_PASSWORD=suitecrm
- MYSQL_USER=suitecrm
- MYSQL_PASSWORD=suitecrm
- MYSQL_DATABASE=suitecrm
volumes:
- ./docker/config/mysql:/etc/mysql/conf.d
- ./docker/data/mysql:/var/lib/mysql
networks:
- suitecrm_net
And this is the DB config in .env.local:
DATABASE_URL=“mysql://suitecrm:suitecrm@mysql_crm:3306/suitecrm”
Hey @jont_titmus,
From what I’m able to understand the error is usually thrown when doctrine tries to do the connection using socket. However, your config seems ok, and doctrine should not be trying to do that.
some more helpful link on this
Just to make sure, could you double check the following, please?
- check if
.env.local
has the correct permissions set, and that apache is able to read it - check if you don’t have any other file that could being read like
.env.local.php
(probably you don’t, but just to make sure.)
Bit of an update - still not cracked this.
Have checked permissions, (but running under docker there isn’t really much to do there).
I have found this in the network responses since downgrading PHP to 7.4, I guess line 10 is the most interesting:
- ERROR_JS_ALERT_SYSTEM_CLASS: “System”
- ERROR_JS_ALERT_TIMEOUT_MSG_1: “Your session is about to timeout in 2 minutes. Please save your work.”
- ERROR_JS_ALERT_TIMEOUT_MSG_2: “Your session has timed out.”
- ERROR_JS_ALERT_TIMEOUT_TITLE: “Session Timeout”
- ERROR_MISSING_COLLECTION_SELECTION: “Empty required field”
- ERROR_NOTIFY_OVERRIDE: “Error: ResourceObserver->notify() needs to be overridden.”
- ERROR_NO_BEAN: “Failed to get bean.”
- ERROR_NO_RECORD: “Error retrieving record. This record may be deleted or you may not be authorized to view it.”
- ERROR_TYPE_NOT_VALID: “Error. This type is not valid.”
- ERROR_UNABLE_TO_RETRIEVE_DATA: “Error: Unable to retrieve data for {0} Connector. The service may currently be inaccessible or the configuration settings may be invalid. Connector error message: ({1}).”
- ERR_ADDRESS_KEY_NOT_SPECIFIED: “Please specify ‘key’ index in displayParams attribute for the Meta-Data definition”
- ERR_AJAX_LOAD: “An error has occurred”
- ERR_AJAX_LOAD_FAILURE: “There was an error processing your request, please try again at a later time.”
- ERR_AJAX_LOAD_FOOTER: “If this error persists, please have your administrator disable Ajax for this module”
- ERR_A_REMINDER_IS_EMPTY_OR_INCORRECT: “A reminder is empty or incorrect.”
- ERR_BAD_RESPONSE_FROM_SERVER: “Bad response from the server”
- ERR_CANNOT_CREATE_METADATA_FILE: “Error: File [[file]] is missing. Unable to create because no corresponding HTML file was found.”
- ERR_CANNOT_FIND_MODULE: “Error: Module [module] does not exist.”
- ERR_COMPATIBLE_PRECISION_VALUE: “Field value is not compatible with precision value”
- ERR_CONNECTOR_FILL_BEANS_SIZE_MISMATCH: “Error: The Array count of the bean parameter does not match the Array count of the results.”
- ERR_CONNECTOR_NOT_ARRAY: “connector array in {0} been defined incorrectly or is empty and could not be used.”
- ERR_DB_FAIL: “Database failure. Please refer to suitecrm.log for details.”
- ERR_DB_VERSION: “SuiteCRM {0} Files May Only Be Used With A SuiteCRM {1} Database.”
- ERR_DECIMAL_SEP_EQ_THOUSANDS_SEP: “The decimal separator cannot use the same character as the thousands separator.\n\n Please change the values.”
- ERR_DELETE_RECORD: “A record number must be specified to delete the contact.”
- ERR_EMPTY_COLUMNS_LIST: “At least, one element required”
- ERR_EXISTING_PORTAL_USERNAME: “Error: The Portal Name is already assigned to another contact.”
- ERR_EXPORT_DISABLED: “Exports Disabled.”
- ERR_EXPORT_TYPE: "Error exporting "
- ERR_EXTERNAL_API_SAVE_FAIL: “An error occurred when trying to save to the external account.”
- ERR_FACTOR_TPL_INVALID: “Factor Authentication message is invalid, please contact to your administrator.”
- ERR_FILE_NOT_FOUND: “Error: Could not load file {0}. Please check system and web server permissions.”
- ERR_FILE_WRITE: “Error: Could not write file {0}. Please check system and web server permissions.”
- ERR_INVALID_EMAIL_ADDRESS: “not a valid email address.”
- ERR_INVALID_FILE_REFERENCE: “Invalid File Reference”
- ERR_INVALID_PASSWORD: “You must specify a valid username and password.”
- ERR_INVALID_REQUIRED_FIELDS: “Invalid required field”
- ERR_INVALID_VALUE: “Invalid Value”
- ERR_IP_CHANGE: “Your session was terminated due to a significant change in your IP address”
- ERR_MISSING_MAPPING_ENTRY_FORM_MODULE: “Error: Missing mapping entry for module.”
- ERR_MISSING_REQUIRED_FIELDS: “Missing required field”
- ERR_MONITOR_FILE_MISSING: “Error: Unable to create monitor because metadata file is empty or file does not exist.”
- ERR_MONITOR_NOT_CONFIGURED: “Error: There is no monitor configured for requested name”
- ERR_MSSQL_DB_CONTEXT: “Changed database context to”
- ERR_MSSQL_WARNING: “Warning”
- ERR_NOTHING_SELECTED: “Please make a selection before proceeding.”
- ERR_NOT_ADMIN: “Unauthorized access to administration.”
- ERR_NO_DB: “Could not connect to the database. Please refer to suitecrm.log for details (0).”
- ERR_NO_HEADER_ID: “This feature is unavailable in this theme.”
- ERR_NO_INVITEES_FOR_REMINDER: “No invitees for reminder.”
- ERR_NO_SINGLE_QUOTE: "Cannot use the single quotation mark for "
- ERR_NO_SUCH_FILE: “File does not exist on system”
- ERR_OPT_IN_RELATION_INCORRECT: “Opt In requires the email to be related to Account/Contact/Lead/Target”
- ERR_OPT_IN_TPL_NOT_SET: “Opt In Email Template is not configured. Please set up in email settings.”
- ERR_QUERY_LIMIT: “Error: Query limit of $limit reached for $module module.”
- ERR_REMINDER_IS_NOT_SET_POPUP_OR_EMAIL: “Reminder is not set for either a popup or email.”
- ERR_RETURN: “Return to Home”
- ERR_SEARCH_INVALID_QUERY: “An error has occurred while performing the search. Your query syntax might not be valid.”
- ERR_SEARCH_NO_RESULTS: “No results matching your search criteria. Try broadening your search.”
- ERR_SELF_REPORTING: “User cannot report to him or herself.”
- ERR_SMARTY_UNEQUAL_RELATED_FIELD_PARAMETERS: “Error: There are an unequal number of arguments for the ‘key’ and ‘copy’ elements in the displayParams array.”
- ERR_SQS_NO_MATCH: “No Match”
- ERR_SQS_NO_MATCH_FIELD: "No match for field: "
- ERR_STORE_FILE_MISSING: “Error: Unable to find Store implementation file”
- ERR_SUHOSIN: “Upload stream is blocked by Suhosin, please add “upload” to suhosin.executor.include.whitelist (See suitecrm.log for more information)”
- ERR_TWO_FACTOR_CODE_FAILED: “Two Factor Authentication code failed to send.”
- ERR_TWO_FACTOR_CODE_SENT: “Two Factor Authentication code sent.”
- ERR_TWO_FACTOR_FAILED: “Two Factor Authentication failed”
- ERR_UNDEFINED_METRIC: “Error: Unable to set value for undefined metric”
What’s the location of the main config file(s)?
Specifically, I want to change my mysql password.
Hi @RMN,
Thanks for trying out SuiteCRM 8 Beta.
For legacy the configs are the usual:
/public/legacy/config.php
/public/legacy/config_override.php
For Suite 8 side, we use the usual symfony config or env files.
- configs
-
config
folder
-
- env files
-
.env.local
or.env.local.php
.env
-
For the db connection password you can find it in:
-
.env.local
in theDATABASE_URL
and you also need to change it in the legacy configuration:
-
/public/legacy/config.php
on thedb_password
entry
Hope this helps
@clemente.raposo, I’ve managed to crack this in Docker, though I’ve had to modify the PDOMySql/Driver.php file overriding the DSN username and password, as well as the connection parameters, (host, port, dbname, unix socket and charset). So, it looks like something isn’t being handled as expected by the environment variables any advice on fixing this beyond altering core code? Many thanks…
<?php
namespace Doctrine\DBAL\Driver\PDOMySql;
use Doctrine\DBAL\Driver\AbstractMySQLDriver;
use Doctrine\DBAL\Driver\PDO;
use Doctrine\DBAL\Exception;
use Doctrine\Deprecations\Deprecation;
use PDOException;
/**
* PDO MySql driver.
*
* @deprecated Use {@link PDO\MySQL\Driver} instead.
*/
class Driver extends AbstractMySQLDriver
{
/**
* {@inheritdoc}
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = [])
{
try {
$conn = new PDO\Connection(
$this->constructPdoDsn($params),
'suitecrm',
'suitecrm',
$driverOptions
);
} catch (PDOException $e) {
throw Exception::driverException($this, $e);
}
return $conn;
}
/**
* Constructs the MySql PDO DSN.
*
* @param mixed[] $params
*
* @return string The DSN.
*/
protected function constructPdoDsn(array $params)
{
$dsn = 'mysql:';
/*
if (isset($params['host']) && $params['host'] !== '') {
$dsn .= 'host=' . $params['host'] . ';';
}
if (isset($params['port'])) {
$dsn .= 'port=' . $params['port'] . ';';
}
if (isset($params['dbname'])) {
$dsn .= 'dbname=' . $params['dbname'] . ';';
}
if (isset($params['unix_socket'])) {
$dsn .= 'unix_socket=' . $params['unix_socket'] . ';';
}
if (isset($params['charset'])) {
$dsn .= 'charset=' . $params['charset'] . ';';
}
*/
$dsn .= 'host=mysql_crm;';
$dsn .= 'port=3306;';
$dsn .= 'dbname=suitecrm;';
$dsn .= 'unix_socket=\/var\/run\/mysqld\/mysql.sock;';
$dsn .= 'charset=UTF8;';
return $dsn;
}
/**
* {@inheritdoc}
*
* @deprecated
*/
public function getName()
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/issues/3580',
'Driver::getName() is deprecated'
);
return 'pdo_mysql';
}
}
Hi @jont_titmus,
Sorry for not replying earlier. Was out of office for a while. And didn’t have much feedback as I’m not sure what the root cause is yet.
These are good findings. Though, I’m still not able to figure out where the problem is.
Could you try adding the following code to the start of the constructPdoDsn
method, please? and then checking the logs?
protected function constructPdoDsn(array $params)
{
error_log('PDO_MYSQL');
error_log(json_encode($params))
I’m also using docker, my output looks something like:
{"url":"mysql:\\/\\/root:pass@db:3306\\/suite?serverVersion=5.7","driver":"pdo_mysql","charset":"UTF8","host":"db","port":3306,"user":"root","password":"pass","driverOptions":[],"defaultTableOptions":{"charset":"utf8","collate":"utf8_unicode_ci"},"dbname":"suite","serverVersion":"5.7"}
More details on my config
My docker config looks like so:
db:
image: mysql:5.7
ports:
- "3306:3306"
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=pass
- MYSQL_DATABASE=suite
- MYSQL_USER=suite_db_user
- MYSQL_PASSWORD=pass
# Access using localhost
webserver:
image: ubuntu-apache-php-7.3
My db config looks like:
'DATABASE_URL' => 'mysql://root:pass@db:3306/suite?serverVersion=5.7',
While looking at my config remembered of one thing, probably not the problem, though just to make sure:
- Could you try with db user root? Does the suitecrm db user have enough grants on the db side?
Thanks @clemente.raposo - out of interest where would you expect this to log to as nothing is being added
in the usual place
Hi @jont_titmus, this should go to the php error log.
Sorry - I was being a bit dim there
[Mon Aug 23 15:45:28.190290 2021] [php7:notice] [pid 14] [client 172.19.0.1:41126] PDO_MYSQL, referer: http://localhost/
[Mon Aug 23 15:45:28.190349 2021] [php7:notice] [pid 14] [client 172.19.0.1:41126] {“url”:"",“driver”:“pdo_mysql”,“charset”:“UTF8”,“host”:“localhost”,“port”:null,“user”:“root”,“password”:null,“driverOptions”:[],“defaultTableOptions”:{“charset”:“utf8”,“collate”:“utf8_unicode_ci”},“dbname”:""}, referer: http://localhost/
No problem : )
Thanks for the logs. Something is strange on the following:
Seems like the info in the DATABASE_URL is not being picked up, or is not being parsed for some reason.
Lets try another thing.
Instead of the .env
, could you try adding a .env.local.php
please? with the following info:
<?php
return array (
'APP_ENV' => 'prod',
'DATABASE_URL' => 'mysql://suitecrm:suitecrm@mysql_crm:3306/suitecrm',
'installed' => true
);
@clemente.raposo same as before unfortunately:
[Mon Aug 23 19:21:39.736518 2021] [php7:notice] [pid 26] [client 172.22.0.1:35040] PDO_MYSQL, referer: http://lh/
[Mon Aug 23 19:21:39.736551 2021] [php7:notice] [pid 26] [client 172.22.0.1:35040] {“url”:“”,“driver”:“pdo_mysql”,“charset”:“UTF8”,“host”:“localhost”,“port”:null,“user”:“root”,“password”:null,“driverOptions”:,“defaultTableOptions”:{“charset”:“utf8”,“collate”:“utf8_unicode_ci”},“dbname”:“”}, referer: http://lh/
For reference I’ve had to replace the string “localhost” with lh above as it seems that I’ve been reported for posting advertisement links
Hi @jont_titmus, sorry forgot to mention one thing did you remove the .env.local
?
also, please do not remove the .env
, in the previous post said .env
, but meant .env.local
, sorry. We should keep .env
as it is on the package.
By the way, are you using the prebuilt-package / installable-package or from the repo?
Hi @clemente.raposo,
Yes, I removed the .env.local replacing it with the .env.local.php and left the .env untouched.
This made no difference though
Oh, and it was installed from the pre-built package here: https://suitecrm.com/suitecrm-8-beta-preview/ Though I have a feeling it was beta 2 not beta 3… Would upgrading be any help?