RotherOSS / otobo

OTOBO is one of the most flexible web-based ticketing systems used for Customer Service, Help Desk, IT Service Management. https://otobo.io/
GNU General Public License v3.0
248 stars 71 forks source link

Fix breaking interaction of Exporter and Module::Refresh, leading to internal server errors after adding/removing certain modules (e.g. Kernel/Language) during package (de)installation. #3762

Open svenoe opened 1 week ago

svenoe commented 1 week ago

When (de)installing a package which brings Custom/Kernel/Language.pm, OTOBO will run into a server error until container/apache/... restart. The error occurs at the first instance where in a new request Translatable() which is imported via use Kernel::Language qw(Translatable) is called, with the process complaining about an undefined function. @bschmalhofer had a more detailed look, to my understanding Module::Refresh removes the somewhere cached method, when Custom/Kernel/Language.pm is added or removed. This does not affect many other modules, Kernel/System/VariableCheck.pm would come to my mind, but it should be solved nonetheless.

stefanhaerter commented 1 week ago

Addition: Motivated by recent observations, I have the suspicion that the referenced problem also affects subs which are overwritten via Kernel/Autoload/ modules.

svenoe commented 1 week ago

Addition: Motivated by recent observations, I have the suspicion that the referenced problem also affects subs which are overwritten via Kernel/Autoload/ modules.

(Which would mean that it might not (only) be Module::Refresh after all.)

bschmalhofer commented 1 week ago

Here is my preliminary analysis for a system that has Kernel::Language installed in the Custom folder.Please take it with a grain of salt.

  1. Webserver is running with a persistent Perl
  2. There are compiled modules with the Translatable method mapped to a entry in the symbol table
  3. The entry in the symbol table contains 'Custom' in its name
  4. The file in the custom folder in uninstalled => Module::Refresh removes the symbol
  5. The next HTTP request tries to run with a symbol that no longer exists => BIG FAIL