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

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

Closed
Poornima1996 opened this issue May 26, 2022 · 7 comments
Labels
5x Issues related to OrangeHRM 5.x versions bug

Comments

@Poornima1996
Copy link

[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} [] []

@Super-Chama Super-Chama added the 5x Issues related to OrangeHRM 5.x versions label May 26, 2022
@RajithaKumara
Copy link
Member

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
Copy link
Member

Thanks for reporting this issue.
Fixed with OrangeHRM 5.1 release

@Taskytosh
Copy link

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
Copy link

orangescan

@targetdevos
Copy link

How to resolve this error.anybody can help me?

@devishke-orange
Copy link
Contributor

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
Copy link

targetdevos commented May 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5x Issues related to OrangeHRM 5.x versions bug
Projects
None yet
Development

No branches or pull requests

6 participants