• Bug#1020989: trafficserver: failed to load plugin

    From Jean Baptiste Favre@21:1/5 to Yavor Doganov on Tue Apr 16 09:40:01 2024
    Hello,
    Thanks for the detailled report.
    The only solution I got for now is to update
    /etc/trafficserver/record.config to disable dynamic reload for plugins:

    CONFIG proxy.config.plugin.dynamic_reload_mode INT 0

    This way, dynamic plugin will be disable, as well as the copy and rename operations in the /run directory.

    Please note however that any update in remap.config will require a full
    service restart.

    I'm preparing a new package release to disable the dynamic reload by
    default.

    Best,
    Jean Baptiste

    On 12/29/23 4:21 PM, Yavor Doganov wrote:
    On Mon, Oct 24, 2022 at 10:39:45AM +0200, Jean Baptiste Favre wrote:
    Please provide some more details on you issue:
    * which plugin do you use? Is there any specific configuration?

    I am not YunQiang Su but I'm pretty sure we're talking about the same
    thing. Any remap plugin will fail to load; for example, add the
    following to /etc/trafficserver/remap.config (example from the manual):

    map http://a.com http://b.com @plugin=regex_remap.so @pparam=maps.reg

    With contents of /etc/trafficserver/maps.reg (again from the manual):

    ^/(ogre.*)/more http://www.ogre.com/$h/$0/$1

    Global plugins are not affected by this issue.

    * do you have some trafficserver's logs to provide?

    Here you are (/var/log/trafficserver/diags.log):

    [Dec 28 20:00:59.369] traffic_server ERROR: plugin 'regex_remap.so' failed to load: /run/trafficserver/adb67a84-e739-4e8f-bc9d-c4797cec16e4/usr/lib/trafficserver/modules/regex_remap.so: failed to map segment from shared object
    [Dec 28 20:00:59.369] traffic_server ERROR: [ReverseProxy] failed to add remap rule at /etc/trafficserver/remap.config line 199: /run/trafficserver/adb67a84-e739-4e8f-bc9d-c4797cec16e4/usr/lib/trafficserver/modules/regex_remap.so: failed to map segment
    from shared objectfailed to remove runtime copy: Success
    [Dec 28 20:00:59.369] traffic_server WARNING: something failed during BuildTable() -- check your remap plugins!
    [Dec 28 20:00:59.369] traffic_server FATAL: remap.config failed to load

    [Dec 28 19:46:23.246] traffic_server ERROR: plugin 'cachekey.so' failed to load: /run/trafficserver/c4edf320-f56b-4193-8554-7db2dccfa0a7/usr/lib/trafficserver/modules/cachekey.so: failed to map segment from shared object
    [Dec 28 19:46:23.246] traffic_server ERROR: [ReverseProxy] failed to add remap rule at /etc/trafficserver/remap.config line 197: /run/trafficserver/c4edf320-f56b-4193-8554-7db2dccfa0a7/usr/lib/trafficserver/modules/cachekey.so: failed to map segment
    from shared objectfailed to remove runtime copy: Success
    [Dec 28 19:46:23.246] traffic_server WARNING: something failed during BuildTable() -- check your remap plugins!
    [Dec 28 19:46:23.246] traffic_server FATAL: remap.config failed to load

    There are errors from dlopen. As the OP said, the culprit is that it
    copies the plugins from /usr/lib to /run and tries to dlopen them
    there. This is doomed to fail because, exactly as the OP said, /run
    is mounted with the "noexec" option. Upstream logic behind this is to dynamically reload plugins that are changed while the server is
    running. I guess it makes sense with custom plugins and some other
    scenarios but there's no way for this to work on Debian systems.

    The attached dirty hack removes this code but also leads to test
    failures of two test programs where this dynamic reloading
    functionality is tested. It is not a proper fix but at least makes
    remap plugins load again.

    Like the OP, I also believe this bug deserves RC severity.

    Additionally (and this is an entirely separate issue, completely
    unrelated with the problem described above), some global plugins fail
    to load as well, for various reasons:

    [Dec 28 19:34:21.066] traffic_server NOTE: loading plugin '/usr/lib/trafficserve
    r/modules/prefetch.so'
    [Dec 28 19:34:21.066] traffic_server ERROR: unable to find TSPluginInit function in '/usr/lib/trafficserver/modules/prefetch.so': /usr/lib/trafficserver/modules/prefetch.so: undefined symbol: TSPluginInit
    [Dec 28 19:34:21.066] traffic_server FATAL: unable to find TSPluginInit function in '/usr/lib/trafficserver/modules/prefetch.so': /usr/lib/trafficserver/modules/prefetch.so: undefined symbol: TSPluginInit

    There is indeed no such function, and according to the plugin API
    there should be.

    [Dec 29 14:31:12.743] traffic_server ERROR: [geoip_acl] No Geo library available!
    [Dec 29 14:31:12.743] traffic_server ERROR: [ReverseProxy] failed to add remap rule at /etc/trafficserver/remap.config line 206: failed to initialize plugin geoip_acl.so: Unknown plugin errorfailed to remove runtime copy: Success
    [Dec 29 14:31:12.744] traffic_server WARNING: something failed during BuildTable() -- check your remap plugins!
    [Dec 29 14:31:12.744] traffic_server FATAL: remap.config failed to load

    I have tested only those that are pcre-based.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)