Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Error and Uncaught Exception during install #8786

Open
Abuelodelanada opened this issue Jun 19, 2020 · 1 comment
Open

Fatal Error and Uncaught Exception during install #8786

Abuelodelanada opened this issue Jun 19, 2020 · 1 comment
Labels
Area: Installation Issues & PRs related to the installation of the application Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type: Bug Bugs within the core SuiteCRM codebase

Comments

@Abuelodelanada
Copy link
Contributor

Issue

If in a non installed instance of SuiteCRM you go to index.php you will be re-directed to the installation page: install.php That's great, but in the log you will have an Uncaught Exception:

[Fri Jun 19 14:48:05 2020] PHP Fatal error:  Uncaught Exception: SuiteCRM is not installed. Entry point needs an installed SuiteCRM, please install first. in /home/jose/trabajos/SuiteCRM/include/entryPoint.php:59
Stack trace:
#0 /home/jose/trabajos/SuiteCRM/index.php(47): require_once()
#1 {main}
  thrown in /home/jose/trabajos/SuiteCRM/include/entryPoint.php on line 59
[Fri Jun 19 14:48:05 2020] 127.0.0.1:45778 [302]: GET / - Uncaught Exception: SuiteCRM is not installed. Entry point needs an installed SuiteCRM, please install first. in /home/jose/trabajos/SuiteCRM/include/entryPoint.php:59
Stack trace:
#0 /home/jose/trabajos/SuiteCRM/index.php(47): require_once()
#1 {main}
  thrown in /home/jose/trabajos/SuiteCRM/include/entryPoint.php on line 59

Expected Behavior

No Fatal Errors and Uncaught Exceptions in PHP log ;-)

Actual Behavior

We have an ugly Fatal Error and Uncaught Exception in PHP log

Possible Fix

The code that throws the exception is in include/entryPoint.php:

if (empty($GLOBALS['installing']) && !file_exists('config.php')) {
    header('Location: install.php');
    throw new Exception('SuiteCRM is not installed. Entry point needs an installed SuiteCRM, please install first.');
}

This exception is thrown after a header() so execution continues on its way redirecting you to the installation, so the message in the exception "SuiteCRM is not installed. Entry point needs an installed SuiteCRM, please install first." is useless, so may be we can remove that line:

if (empty($GLOBALS['installing']) && !file_exists('config.php')) {
    header('Location: install.php');
}

Steps to Reproduce

  1. Open the browser in index.php in a non installed SuiteCRM instance
  2. See PHP log ;-)

Context

Your Environment

  • SuiteCRM Version used: 7.10.27
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Firefox 77
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.3 - MySQL 8.0.x
  • Operating System and version (e.g Ubuntu 16.04): Ubuntu 20.04
@chris001
Copy link
Contributor

You're right. "Not installed yet" is a normal condition, so it should log something to register that it detected this. It should throw Exception when install fails in some way.

@Mac-Rae Mac-Rae added Area: Installation Issues & PRs related to the installation of the application Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type: Bug Bugs within the core SuiteCRM codebase labels Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Installation Issues & PRs related to the installation of the application Priority:Moderate Issues & PRs that are minor; broken styling, cosmetic, warnings - there are practical workarounds Type: Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

3 participants