• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Forwarded to devs [Linux} After 18.0.36 update event handlers using $VAR

burnley

Regular Pleskian
Username: burnley

TITLE

[Linux} After 18.0.36 update event handlers using $VAR

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Obsidian Version 18.0.36, last updated on June 29, 2021 03:37 PM
CentOS Linux 7.9.2009 (Core)

PROBLEM DESCRIPTION

After updating to 18.0.36 all our Linux servers started to exhibit the following event handler behaviour:

1. Commands like this one are still being executed:
"ddnsplesk.py -n actionlog__event_domain_create"

2. Commands like this one aren't executed anymore (or do they silently crash?):
"domainmgr.py ${NEW_DOMAIN_NAME} add"
This command runs perfectly fine from cli when substituting the variable with the domain name value.

STEPS TO REPRODUCE

Upgrade to 18.0.36

ACTUAL RESULT

The event handler isn't executed

EXPECTED RESULT

The event handler should run

ANY ADDITIONAL INFORMATION



YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Update. Added some debug logging for the arguments list and, for "Default domain (the first domain added to a subscription) deleted" and command "domainmgr-ng.py ${OLD_DOMAIN_NAME} delete" this is what I see in the log:

2021-07-16 12:48:56.680338 domainmgr-ng.py [pid:17432][caller_function: usage()][caller_filename: domainmgr-ng.py][caller_linenum: 39] - [Debug] len(sys.argv): 2, sys.argv[0]: domainmgr-ng.py, sys.argv[1]: delete

This is incorrect, len(sys.argv) should be 3 with:
sys.argv[0]: domainmgr-ng.py
sys.argv[1]: the domain name received in ${OLD_DOMAIN_NAME} variable
sys.argv[2]: delete

Has Plesk stopped exporting the variables in the shell? I see the OLD_DOMAIN_NAME is still available in the environment variable as per my logging:
[Debug] In usage function, environment variables: {'LANG': 'en_US.UTF-8', 'SHELL': '/sbin/nologin', 'NEW_LOGIN_NAME': '', 'OLD_LOGIN_NAME': 'admin', 'PLESK_INTERNAL_TASK_MANAGER_EXEC': '1', 'SHLVL': '0', 'NEW_DOMAIN_GUID': '', 'PWD': '/', 'OLD_DOMAIN_NAME': '000plesk12s1.local', 'LOGNAME': 'psaadm', 'USER': 'psaadm', 'NEW_DOMAIN_NAME': '', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'OLD_DOMAIN_GUID': '6937486a-0c78-4d03-a6c8-4de8ab6e24f6', 'OLD_CLIENT_GUID': '6a62b3cb-beec-42d0-a9cf-d9d38c176589', 'HOME': '/usr/local/psa/admin', 'NEW_CLIENT_GUID': ''}
 
This was an undocumented behaviour. Please, refrain from using it.
We are no longer spawning shell processes with the event handler's command line; instead, we pass arguments into the task-manager service, which spawns the process directly without involving shell. Therefore shell expansion will no longer work.

As per the documentation, you should either use environment variables or placeholders in <...> notation, e.g.:

domainmgr.py <NEW_DOMAIN_NAME> add
 
Back
Top