orangehrm / orangehrm

OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities required for any enterprise.
GNU General Public License v3.0
746 stars 537 forks source link

Request failed with status code 500. For more details check the error log in /src/log/installer.log file #1299

Closed Poornima1996 closed 1 year ago

Poornima1996 commented 2 years ago

[2022-05-26T12:35:57.256378+02:00] installer.INFO: Matched route "{route}". {"route":"api_installer_migration","route_parameters":{"_controller":"OrangeHRM\Installer\Controller\Installer\Api\MigrationAPI::handle","_route":"api_installer_migration"},"request_uri":"http://localhost:8080/test002/orangehrm-5.0/installer/index.php/installer/api/installation/migration","method":"POST"} [] [2022-05-26T12:35:57.442399+02:00] installer.ERROR: Wrong parameters for Doctrine\DBAL\Driver\PDO\Exception([string $message [, long $code [, Throwable $previous = NULL]]]) [] [] [2022-05-26T12:35:57.442538+02:00] installer.ERROR: #0 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\doctrine\dbal\src\Driver\AbstractException.php(34): Exception->construct('SQLSTATE[HY000]...', NULL, Object(PDOException)) #1 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\doctrine\dbal\src\Driver\PDO\Exception.php(26): Doctrine\DBAL\Driver\AbstractException->construct('SQLSTATE[HY000]...', 'HY000', NULL, Object(PDOException)) #2 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\doctrine\dbal\src\Driver\PDO\Result.php(109): Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException)) #3 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\doctrine\dbal\src\Driver\PDO\Result.php(49): Doctrine\DBAL\Driver\PDO\Result->fetch(7) #4 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\doctrine\dbal\src\Result.php(75): Doctrine\DBAL\Driver\PDO\Result->fetchOne() #5 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Migration\V4_5_0\Migration.php(85): Doctrine\DBAL\Result->fetchOne() #6 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Util\AppSetupUtility.php(516): OrangeHRM\Installer\Migration\V4_5_0\Migration->up() #7 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Util\AppSetupUtility.php(506): OrangeHRM\Installer\Util\AppSetupUtility->_runMigration('OrangeHRM\Insta...') #8 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Controller\Upgrader\Api\MigrationAPI.php(47): OrangeHRM\Installer\Util\AppSetupUtility->runMigrationFor('4.5') #9 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Controller\AbstractInstallerRestController.php(57): OrangeHRM\Installer\Controller\Upgrader\Api\MigrationAPI->handlePost(Object(OrangeHRM\Framework\Http\Request)) #10 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Controller\AbstractInstallerController.php(85): OrangeHRM\Installer\Controller\AbstractInstallerRestController->execute(Object(OrangeHRM\Framework\Http\Request)) #11 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\symfony\http-kernel\HttpKernel.php(152): OrangeHRM\Installer\Controller\AbstractInstallerController->handle(Object(OrangeHRM\Framework\Http\Request)) #12 C:\xampp\htdocs\Test002\orangehrm-5.0\src\vendor\symfony\http-kernel\HttpKernel.php(74): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(OrangeHRM\Framework\Http\Request), 1) #13 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\Framework\HttpKernel.php(224): Symfony\Component\HttpKernel\HttpKernel->handle(Object(OrangeHRM\Framework\Http\Request), 1, true) #14 C:\xampp\htdocs\Test002\orangehrm-5.0\installer\index.php(64): OrangeHRM\Installer\Framework\HttpKernel->handleRequest(Object(OrangeHRM\Framework\Http\Request)) #15 {main} [] []

RajithaKumara commented 2 years ago

Hi @Poornima1996 Thanks for evaluating OrangeHRM 5.0. Can we know more about your environment; PHP version, Web server, Database server version

As a temporary fix can provide a suggestion, you can try it on your test instance.

open installer/Migration/V4_5_0/Migration.php Find below code;

if ($clientId != 'orangehrm_mobile_app') {
    $this->createQueryBuilder()
        ->insert('ohrm_oauth_client')
        ->values(
            [
                'client_id' => ':clientId',
                'client_secret' => ':clientSecret',
                'redirect_uri' => ':redirectUri',
                'grant_types' => ':grantTypes',
                'scope' => ':scope'
            ]
        )
        ->setParameter('clientId', 'orangehrm_mobile_app')
        ->setParameter('clientSecret', '')
        ->setParameter('redirectUri', '')
        ->setParameter('grantTypes', 'password refresh_token')
        ->setParameter('scope', 'user')
        ->executeQuery()
        ->fetchOne();
}

remove 85 line (->fetchOne();)

after changing the code it should look like below;

if ($clientId != 'orangehrm_mobile_app') {
    $this->createQueryBuilder()
        ->insert('ohrm_oauth_client')
        ->values(
            [
                'client_id' => ':clientId',
                'client_secret' => ':clientSecret',
                'redirect_uri' => ':redirectUri',
                'grant_types' => ':grantTypes',
                'scope' => ':scope'
            ]
        )
        ->setParameter('clientId', 'orangehrm_mobile_app')
        ->setParameter('clientSecret', '')
        ->setParameter('redirectUri', '')
        ->setParameter('grantTypes', 'password refresh_token')
        ->setParameter('scope', 'user')
        ->executeQuery();
}

Try this solution.

RajithaKumara commented 1 year ago

Thanks for reporting this issue. Fixed with OrangeHRM 5.1 release

Taskytosh commented 1 year ago

Good day! encountered error: Request failed with status code 500. For more details check the error log in /src/log/installer.log fileRequest failed with status code 500. For more details check the error log in /src/log/installer.log file

OrangeHRM version: orangehrm-5.3

Thank you

targetdevos commented 3 weeks ago

orangescan

targetdevos commented 3 weeks ago

How to resolve this error.anybody can help me?

devishke-orange commented 3 weeks ago

Hi @targetdevos,

Please try installing our latest release: https://github.com/orangehrm/orangehrm/releases/tag/v5.6.1. We fixed a couple of installation bugs in the newer releases.

targetdevos commented 3 weeks ago

We want to configure SMTP mail configuration is it possible to configure email on gui or terminal we are using rocky 9 .then give me email confirmation process also ask you we need to configure any mail server in rocky 9 if need them what and give documents please thanks a lots

On Thu, 9 May, 2024, 10:00 am devishke-orange, @.***> wrote:

Hi @targetdevos https://github.com/targetdevos,

Please try installing our latest release: https://github.com/orangehrm/orangehrm/releases/tag/v5.6.1. We fixed a couple of installation bugs in the newer releases.

— Reply to this email directly, view it on GitHub https://github.com/orangehrm/orangehrm/issues/1299#issuecomment-2101913582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYOUGWKQMLMSBJTOLO444CLZBL3WJAVCNFSM5XAY24P2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJQGE4TCMZVHAZA . You are receiving this because you were mentioned.Message ID: @.***>