• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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