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

Feng Office: Update to v3.11.2.8 #5992

Merged
merged 30 commits into from
Oct 3, 2024

Conversation

mreid-tt
Copy link
Contributor

@mreid-tt mreid-tt commented Jan 26, 2024

Description

This PR contains the following:

  1. Upgrade Feng Office to version 3.11.2.8
  2. Modernise package scripts
  3. Add PHP profiles for DSM 6
  4. Add full backup and restore

Fixes #2348
Closes #4230

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Package update

@mreid-tt mreid-tt force-pushed the fengoffice-update branch 7 times, most recently from 4146415 to 00bd280 Compare January 27, 2024 04:57
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Jan 27, 2024

hey @hgy59, I was attempting to upgrade this package but ran into some problems with the installer. With the earlier package it seems the original contributor sent some arguments to a supplemental installer which automated the first three steps of the four step wizard.

Running this with it's original setup I got the following in the installer log:

2024/01/26 21:57:21	===> Step postinst. STATUS=INSTALL USER=fengoffice GROUP= SHARE_PATH=
2024/01/26 21:57:21	Begin save_wizard_variables
2024/01/26 21:57:21	End save_wizard_variables
2024/01/26 21:57:21	Begin syno_sync_var_folder
2024/01/26 21:57:21	End syno_sync_var_folder
2024/01/26 21:57:21	Begin service_postinst
2024/01/26 21:57:21	PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_connect() in /volume1/web_packages/fengoffice/public/install/installation/acInstallation.class.php:113
2024/01/26 21:57:21	Stack trace:
2024/01/26 21:57:21	#0 /volume1/web_packages/fengoffice/public/install/installation/steps/FinishStep.class.php(56): acInstallation->execute()
2024/01/26 21:57:21	#1 /volume1/web_packages/fengoffice/public/install/library/classes/ScriptInstaller.class.php(93): FinishStep->execute()
2024/01/26 21:57:21	#2 /volume1/web_packages/fengoffice/public/install/install_helper.php(8): ScriptInstaller->executeStep(4)
2024/01/26 21:57:21	#3 {main}
2024/01/26 21:57:21	  thrown in /volume1/web_packages/fengoffice/public/install/installation/acInstallation.class.php on line 113
2024/01/26 21:57:21	End service_postinst

My assessment of this was that the PHP execution did not include the extensions that would normally be included with the FPM service and these needed to be manually included.

In this state however the wizard was able to be manually run on launch of the web page and if you configured all the required fields the installation would complete. The app seemed to be fully functional (under DSM 7; haven't completed the DSM 6 stuff yet).

I then modified the script to include the PHP extensions. While there were no longer errors in the install log, the service log spat out an HTML page (https://pastebin.com/RNrxGT3u), which contained the error:

Found faulty query: INSERT INTO `fo_members` (`dimension_id`,`object_type_id`, `parent_member_id`, `depth`, `name`, `object_id` ) SELECT (SELECT `id` FROM `fo_dimensions` WHERE `code`='feng_persons'), (SELECT `id` FROM `fo_object_types` WHERE `name`='company'), 0, 1, `o`.`name`, `o`.`id` FROM `fo_objects` `o` INNER JOIN `fo_contacts` `c` ON `c`.`object_id`=`o`.`id` WHERE `c`.`is_company`=1 ON DUPLICATE KEY UPDATE dimension_id=dimension_id
Error while loading inital data for plugin 'core_dimensions'. Field 'description' doesn't have a default value

Now I don't know if this is a warning or an error preventing setup but the webpage does not load after the installation is completed. This is unlike when the automatic setup was not working before. I am not sure what else can be done to resolve this other than requiring the user to just do all the wizard steps. The challenge with that is that the wizard often times out when the database is being setup and only after trying to load the webpage a few times does the interface come up.

EDIT: Okay, I think I've solved it. In reviewing the webpage generated by the manual install most of the parameters were identical with the exception of [database_type]. The original script had mysql whereas the current webpage has mysqli. With this change, the installation seems to have completed successfully. I'll proceed to work on the DSM 6 configs now.

Upon further examination, it seems that the second error encountered during the initial database setup persists across both DSM 6 and 7. However, it is now obscured within the service_postinst execution and can only be seen in the service log. The reported issue of the webpage failing to load after a manual setup appears to be linked to timeouts and caching. Notably, the interface functions properly if one exercises patience or refreshes the page after logging in. This discrepancy in behaviour is absent in the automatic setup, likely because the install helper doesn't support timeouts, waiting until the process concludes. Additionally, since there are no browser queries involved, caching concerns are mitigated.

@mreid-tt
Copy link
Contributor Author

@hgy59, I believe this package update is now complete. Let me know if you have any thoughts from your review.

@mreid-tt mreid-tt changed the title Fengoffice: Update to v3.10.8.3 Fengoffice: Update to v3.10.8.6 Feb 2, 2024
@mreid-tt
Copy link
Contributor Author

mreid-tt commented Feb 2, 2024

hey @moneytoo, as you were the original contributor to this package, I wondered if you had any thoughts on my proposed update?

@mreid-tt mreid-tt force-pushed the fengoffice-update branch 2 times, most recently from ac83182 to e58329b Compare September 11, 2024 21:46
@mreid-tt mreid-tt requested a review from hgy59 September 12, 2024 00:03
@mreid-tt
Copy link
Contributor Author

I've completed testing of the new backup and restore as well as simulated an upgrade from v3.11.1.2 to v3.11.1.19. Overall things work well in DSM 7 but there was one exception for the upgrade process for DSM 6.

In DSM 7, the service log for an upgrade on a backup restore shows the following:

Config file found and loaded.
File '/config/config.php' exists and is writable
Folder '/config' exists and is writable
Folder '/cache' exists and is writable
Folder '/tmp' exists and is writable
Folder '/upload' exists and is writable
Extension 'mysqli' is loaded
Extension 'gd' is loaded
Extension 'simplexml' is loaded
Upgrade script has connected to the database.
Test query has been executed. Its safe to proceed with database migration.
2024-09-11 20:30:20 - Starting upgrade to 3.11.1.19
Database schema transformations executed (total queries: 10)
Feng Office has been upgraded. You are now running Feng Office 3.11.1.19 Enjoy!
2024-09-11 20:30:22 - Finished upgrade to 3.11.1.19
Updating plugins...
Finished plugins update.
Plugin mail updated successfully
Installation log: /var/log/packages/fengoffice.log
Starting fengoffice ...
Wed Sep 11 16:30:44 -04 2024

However in DSM 6 for an upgrade on a backup restore we see the following:

Config file found and loaded.
File '/config/config.php' exists and is writable
Folder '/config' exists and is writable
Folder '/cache' exists and is writable
Folder '/tmp' exists and is writable
Folder '/upload' exists and is writable
Extension 'mysqli' is loaded
Extension 'gd' is loaded
Extension 'simplexml' is loaded
Upgrade script has connected to the database.
Test query has been executed. Its safe to proceed with database migration.
2024-09-11 23:08:09 - Starting upgrade to 3.11.1.19
Database schema transformations executed (total queries: 10)
Feng Office has been upgraded. You are now running Feng Office 3.11.1.19 Enjoy!
2024-09-11 23:08:09 - Finished upgrade to 3.11.1.19
Error: Error found when updating plugins
Error: To finish updating the plugins please try executing the following command in your terminal:
Error: php /volume1/web/fengoffice/public/install/plugin-console.php update_all
Plugin mail updated successfully
Installation log: /var/log/packages/fengoffice.log
Starting fengoffice ...
Wed Sep 11 19:08:28 -04 2024

When attempting a normal package upgrade we see a similar error with a bit more detail for DSM 6:

Config file found and loaded.
File '/config/config.php' exists and is writable
Folder '/config' exists and is writable
Folder '/cache' exists and is writable
Folder '/tmp' exists and is writable
Folder '/upload' exists and is writable
Extension 'mysqli' is loaded
Extension 'gd' is loaded
Extension 'simplexml' is loaded
Upgrade script has connected to the database.
Test query has been executed. Its safe to proceed with database migration.
2024-09-12 00:27:58 - Starting upgrade to 3.11.1.19
Database schema transformations executed (total queries: 72)
Feng Office has been upgraded. You are now running Feng Office 3.11.1.19 Enjoy!
2024-09-12 00:28:28 - Finished upgrade to 3.11.1.19
PHP Fatal error:  Call to undefined function mysqli_connect() in /volume1/web/fengoffice/application/functions.php on line 34
PHP Fatal error:  Class 'DB' not found in /volume1/web/fengoffice/application/functions.php on line 69
Error: Error found when updating plugins
Error: To finish updating the plugins please try executing the following command in your terminal:
Error: php /volume1/web/fengoffice/public/install/plugin-console.php update_all
Plugin mail updated successfully

All the PHP extensions are properly enabled as far as I can tell and all other functions seem to work well. Unsure as to the specific reason this is an issue under DSM 6.

@mreid-tt
Copy link
Contributor Author

@hgy59, I believe the update is now complete. During the process, I realized that the path validation functions, or any functions that used exit 1, only worked within those starting with validate_. Therefore, I restructured the uninstall functions to separate validation from execution. These changes have also been applied to ownCloud in #6225. I’d appreciate any feedback you may have on your review.

@mreid-tt
Copy link
Contributor Author

mreid-tt commented Sep 15, 2024

All the PHP extensions are properly enabled as far as I can tell and all other functions seem to work well. Unsure as to the specific reason this is an issue under DSM 6.

I've conducted a detailed investigation and manually performed an upgrade following the guidelines from the Feng Office upgrade documentation. The results are as follows:

$ cd /var/services/web
$ sudo rsync -aX -I fengoffice-new/share/fengoffice/ fengoffice
$ PHP_SETTINGS=$(jq -r '.extensions | map("-d extension=" + . + ".so") | join(" ")' /var/packages/fengoffice/target/web/fengoffice.json)
$ PHP_SETTINGS="${PHP_SETTINGS} -d mysqli.default_socket=/run/mysqld/mysqld10.sock"
$ sudo -u http /usr/local/bin/php74 $PHP_SETTINGS /var/services/web/fengoffice/public/upgrade/console.php

Config file found and loaded.
File '/config/config.php' exists and is writable
Folder '/config' exists and is writable
Folder '/cache' exists and is writable
Folder '/tmp' exists and is writable
Folder '/upload' exists and is writable
Extension 'mysqli' is loaded
Extension 'gd' is loaded
Extension 'simplexml' is loaded
Upgrade script has connected to the database.
Test query has been executed. Its safe to proceed with database migration.
2024-09-15 01:49:56 - Starting upgrade to 3.11.1.19
Database schema transformations executed (total queries: 10)
Feng Office has been upgraded. You are now running Feng Office 3.11.1.19 Enjoy!
2024-09-15 01:49:59 - Finished upgrade to 3.11.1.19
Error: Error found when updating plugins
Error: To finish updating the plugins please try executing the following command in your terminal:
Error: php /volume1/web/fengoffice/public/install/plugin-console.php update_all

$ sudo -u http /usr/local/bin/php74 $PHP_SETTINGS /var/services/web/fengoffice/public/install/plugin-console.php update_all

Plugin mail updated successfully
$ sudo -u http /usr/local/bin/php74 $PHP_SETTINGS /var/services/web/fengoffice/public/upgrade/console.php

There is no upgrade path from version 3.11.1.19 to 3.11.1.19.

$ sudo -u http /usr/local/bin/php74 $PHP_SETTINGS /var/services/web/fengoffice/public/install/plugin-console.php update_all

$ <<end>>

Although an initial error occurs when updating the plugins during the upgrade process, they are successfully updated afterward using the second command. This aligns with the documentation, which states:

While sometimes this does work automatically, it is recommended that you always run and update the plugins as well

Therefore, the error reported in the DSM 6 service log during the upgrade is promptly resolved by the plugin update command within the script.

@mreid-tt mreid-tt changed the title Fengoffice: Update to v3.11.1.19 Feng Office: Update to v3.11.1.19 Sep 17, 2024
@mreid-tt mreid-tt changed the title Feng Office: Update to v3.11.1.19 Feng Office: Update to v3.11.2.7 Sep 23, 2024
@mreid-tt mreid-tt removed the request for review from hgy59 September 24, 2024 00:42
@mreid-tt mreid-tt changed the title Feng Office: Update to v3.11.2.7 Feng Office: Update to v3.11.2.8 Sep 26, 2024
@mreid-tt mreid-tt merged commit ab6b217 into SynoCommunity:master Oct 3, 2024
17 checks passed
@mreid-tt mreid-tt deleted the fengoffice-update branch October 3, 2024 09:29
@mreid-tt mreid-tt added status/published Published and activated (may take up to 48h until visible in DSM package manager) and removed status/ready-to-merge labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/published Published and activated (may take up to 48h until visible in DSM package manager)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apollolake package for Feng Office requested Feng Office Installer Claims MySQL Root Password is Incorrect
2 participants