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

Unable to install. when I get to the installation phase, it gets to #1731

Closed
anwoke8204 opened this issue Aug 9, 2023 · 19 comments
Closed
Labels
5x Issues related to OrangeHRM 5.x versions

Comments

@anwoke8204
Copy link

OrangeHRM version

5.5

Environment details

  • OrangeHRM source:
  • Platform: Debian Linux running Virtualmin
  • PHP version: 7.4, but can go up to 8.3 if I need to
  • Database and version: the latest version of MariaDB
  • Web server: Apache
  • Browser: Chrome

Describe the bug

when I get to the installation phase, it gets to 99% Request failed with status code 500. For more details check the error log in /src/log/installer.log file. however when I try to view that file there is nothing there. No matter what I do, I can't seem to get it past that error


image

To reproduce

run the installer again

Expected behavior

it should run through the install just fine.

Relevant log output

No response

@anwoke8204 anwoke8204 added the 5x Issues related to OrangeHRM 5.x versions label Aug 9, 2023
@devishke-orange
Copy link
Contributor

Hi @anwoke8204

We will look into this issue further. It's strange that the installer.log is missing.

Something you could try in the meantime would be to check the timeout settings on your server. It could be that the migration request is timing out since certain migrations take a long time to complete.

If you could also send another screenshot of your network tab open while you attempt the install it would speed up the process of solving the issue. To do this on Chrome:

  1. On the "Confirmation" screen (step 7), right click on the page and click "Inspect"
  2. In the tab that appears choose "Network"
  3. Start the install and take a screenshot of the whole browser after the failure occurs

@anwoke8204
Copy link
Author

anwoke8204 commented Aug 9, 2023 via email

@anwoke8204
Copy link
Author

anwoke8204 commented Aug 9, 2023 via email

@devishke-orange
Copy link
Contributor

Hi @anwoke8204

It seems the screenshot has not been attached properly.

Could you try increasing the timeout to a higher value and trying again?

@devishke-orange
Copy link
Contributor

Hi again @anwoke8204

If increasing the timeout also does not work, you could give the CLI installer a try. Check this comment for reference: #1575 (comment)

@anwoke8204
Copy link
Author

anwoke8204 commented Aug 18, 2023 via email

@morfran
Copy link

morfran commented Aug 18, 2023

I get the same when following the docker install instructions here:

https://github.com/orangehrm/orangehrm/wiki/How-to-Install-via-Docker-image

Log file attached.

installer.log

@anwoke8204
Copy link
Author

anwoke8204 commented Aug 18, 2023 via email

@devishke-orange
Copy link
Contributor

Hi @anwoke8204 that's great to hear.

@morfran Thanks for including your installer log. Seems there's an SQL error occurring during the migrations. We'll look into it and get back to you

@morfran
Copy link

morfran commented Aug 18, 2023

CLI didn't work for me either, same issue:

  • Database creation ✓
  • Checking database permissions ✓
  • Applying database changes
  • Instance and Admin user creation
  • Create OrangeHRM database user
  • Creating configuration files

In ExceptionConverter.php line 119:

An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1833 Cannot chan
ge column 'emp_number': used in a foreign key constraint 'hs_hr_emp_attachment_ibfk_1' of table
'ohrm.hs_hr_emp_attachment'

In Exception.php line 30:

SQLSTATE[HY000]: General error: 1833 Cannot change column 'emp_number': used in a foreign key c
onstraint 'hs_hr_emp_attachment_ibfk_1' of table 'ohrm.hs_hr_emp_attachment'

In Connection.php line 34:

SQLSTATE[HY000]: General error: 1833 Cannot change column 'emp_number': used in a foreign key c
onstraint 'hs_hr_emp_attachment_ibfk_1' of table 'ohrm.hs_hr_emp_attachment'

install:on-new-database

@devishke-orange
Copy link
Contributor

Hi @morfran. We're still looking into this. For a temporary fix you could try downgrading to MariaDB 10.4.30 and try installing again.

@harshpatel147
Copy link

Hi @devishke-orange . when I tries to do Fresh Install OrangeHrm v5.5 It gives error as like below:

[2023-09-19T09:11:22.724577+00:00] installer.ERROR: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1833 Cannot change column 'emp_number': used in a foreign key constraint 'hs_hr_emp_attachment_ibfk_1' of table 'orangehrm.hs_hr_emp_attachment' [] []
[2023-09-19T09:11:22.724783+00:00] installer.ERROR: #0 /var/www/html/orangehrm-5.5/src/vendor/doctrine/dbal/src/Connection.php(1814): Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert() #1 /var/www/html/orangehrm-5.5/src/vendor/doctrine/dbal/src/Connection.php(1749): Doctrine\DBAL\Connection->handleDriverException() #2 /var/www/html/orangehrm-5.5/src/vendor/doctrine/dbal/src/Connection.php(1163): Doctrine\DBAL\Connection->convertExceptionDuringQuery() #3 /var/www/html/orangehrm-5.5/src/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php(1204): Doctrine\DBAL\Connection->executeStatement() #4 /var/www/html/orangehrm-5.5/src/vendor/doctrine/dbal/src/Schema/AbstractSchemaManager.php(820): Doctrine\DBAL\Schema\AbstractSchemaManager->_execSql() #5 /var/www/html/orangehrm-5.5/installer/Util/V1/SchemaHelper.php(153): Doctrine\DBAL\Schema\AbstractSchemaManager->alterTable() #6 /var/www/html/orangehrm-5.5/installer/Migration/V4_3_3/Migration.php(36): OrangeHRM\Installer\Util\V1\SchemaHelper->changeColumn() #7 /var/www/html/orangehrm-5.5/installer/Util/AppSetupUtility.php(526): OrangeHRM\Installer\Migration\V4_3_3\Migration->up() #8 /var/www/html/orangehrm-5.5/installer/Util/AppSetupUtility.php(514): OrangeHRM\Installer\Util\AppSetupUtility->_runMigration() #9 /var/www/html/orangehrm-5.5/installer/Controller/Upgrader/Api/MigrationAPI.php(50): OrangeHRM\Installer\Util\AppSetupUtility->runMigrationFor() #10 /var/www/html/orangehrm-5.5/installer/Controller/AbstractInstallerRestController.php(57): OrangeHRM\Installer\Controller\Upgrader\Api\MigrationAPI->handlePost() #11 /var/www/html/orangehrm-5.5/installer/Controller/AbstractInstallerController.php(85): OrangeHRM\Installer\Controller\AbstractInstallerRestController->execute() #12 /var/www/html/orangehrm-5.5/src/vendor/symfony/http-kernel/HttpKernel.php(152): OrangeHRM\Installer\Controller\AbstractInstallerController->handle() #13 /var/www/html/orangehrm-5.5/src/vendor/symfony/http-kernel/HttpKernel.php(74): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #14 /var/www/html/orangehrm-5.5/installer/Framework/HttpKernel.php(244): Symfony\Component\HttpKernel\HttpKernel->handle() #15 /var/www/html/orangehrm-5.5/installer/index.php(66): OrangeHRM\Installer\Framework\HttpKernel->handleRequest() #16 {main} [] []

I tried to install it with MariaDB 10.6.15 and MariaDB 10.4.31 but still I'am getting same error.

even also I tried to do install with cli php installer/console install:on-existing-database. but when I install it by cli then still I'm getting same error:

In ExceptionConverter.php line 119:
                                                                                                                                                                                                           
  An exception occurred while executing a query: SQLSTATE[HY000]: General error: 1833 Cannot change column 'emp_number': used in a foreign key constraint 'hs_hr_emp_attachment_ibfk_1' of table 'orangeh  
  rm.hs_hr_emp_attachment'                                                                                                                                                                                 
                                                                                                                                                                                                           

In Exception.php line 30:
                                                                                                                                                                                    
  SQLSTATE[HY000]: General error: 1833 Cannot change column 'emp_number': used in a foreign key constraint 'hs_hr_emp_attachment_ibfk_1' of table 'orangehrm.hs_hr_emp_attachment'  
                                                                                                                                                                                    

In Connection.php line 34:
                                                                                                                                                                                    
  SQLSTATE[HY000]: General error: 1833 Cannot change column 'emp_number': used in a foreign key constraint 'hs_hr_emp_attachment_ibfk_1' of table 'orangehrm.hs_hr_emp_attachment'  

even also I tried to install OrangeHrm v5.4 but still getting same error.

PHP: v7.4.33
mariaDb: v10.6.15 & MariaDB 10.4.31 (tried with both versions)
Linux Distribution: CentOs 7

Please Help me to complete fresh installation of OrangeHrm

@devishke-orange
Copy link
Contributor

devishke-orange commented Sep 20, 2023

Hi @harshpatel147

After the August release of MariaDB, the ability to alter tables after disabling FOREIGN_KEY_CHECKS was no longer possible. Since our migrations relied upon this, our installer will fail on the following versions of MariaDB 10.x:

  • 10.4.31
  • 10.5.22
  • 10.6.15
  • 10.9.8
  • 10.10.6
  • 10.11.5

We have implemented a fix for this which will be available in our next release (sometime in October). You can view it here: #1736

If possible I'd recommend downgrading your database temporarily. If not you can copy the code over to your 5.5 version.

@harshpatel147
Copy link

Will the installation work perfectly with MariaDB 10.4.30? If it does, we can consider downgrading the database version

@devishke-orange
Copy link
Contributor

You may have to disable ONLY_FULL_GROUP_BY in your sql_mode. Please refer: #1582 (comment)

@harshpatel147
Copy link

we doesn't need to downgrade the Database. just replace changes of #1736 Pull Request OR see this commit. your issue will solve... but I wish to give feedback to Orange hrm team. please optimize the migration process it takes too much time. and when we tries to install it using UI it throw 524 HTTP Error after specific time. for by pass this time out we changed max_execution_time = 0 in php.ini file. but still we face same error about HTTP 524.

then after we tries to install it by CLI Command. finally It successfully completed.

If any one face issue about HTTP 524 Error then try to install orange hrm setup by following CLI Command in Root of project dir:

# php installer/console install:on-existing-database

@devishke-orange
Copy link
Contributor

Hi @harshpatel147

Thanks for the feedback. Glad to hear you got the installation working.

@devishke-orange
Copy link
Contributor

Hi all,

The MariaDB install failure is fixed in OrangeHRM 5.6: https://github.com/orangehrm/orangehrm/releases/tag/v5.6

@devishke-orange
Copy link
Contributor

I'm closing this as the issue has been fixed.

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
Projects
None yet
Development

No branches or pull requests

4 participants