• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Forwarded to devs Environment variable for DNS related update events always passes new domain back

Kaspar

API expert
Plesk Guru
Username:

TITLE

Environment variable for DNS related update events always passes new domain back

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Ubuntu 22.04.2 LTS
Plesk 18.0.59

PROBLEM DESCRIPTION

For most "update" events in the event manager there are "old" and "new " environment variables passed back. However for the events listed below both the "old" and "new " environment variables are always the same, even when with the same action other events do pass different "old" and "new " environment variables back.
  • Default domain, DNS zone of domain alias updated
  • Default domain, DNS zone updated
  • DNS zone of a domain alias updated
  • Domain DNS zone updated
So in short the OLD_DOMAIN_NAME and OLD_DOMAIN_ALIAS_NAME environment variables always passes the new domain name back when an domain gets renamed (changed).

STEPS TO REPRODUCE

1) Create a test script to log the passed back environment variables. For testing purposes I used the script below.
Code:
#!/bin/bash

touch /tmp/event.log
echo "Variables: OLD_DOMAIN_NAME: ${OLD_DOMAIN_NAME} NEW_DOMAIN_NAME: ${NEW_DOMAIN_NAME}" >> /tmp/event.log
echo "Variables for alias domains: OLD_DOMAIN_ALIAS_NAME: ${OLD_DOMAIN_ALIAS_NAME} NEW_DOMAIN_ALIAS_NAME: ${NEW_DOMAIN_ALIAS_NAME}" >> /tmp/event.log

2) Add four different types of domains in Plesk to test all four of the events. So in Plesk add
  • a subscription domain
  • an add-on domain (a domain that shares the webspace with a subscription domain)
  • an domain alias to the subscription domain
  • an domain alias to the add-on domain
3) Next, create an event in the event manager for each of the four events below. Use the script from step one as command value.
  • Default domain, DNS zone of domain alias updated
  • Default domain, DNS zone updated
  • DNS zone of a domain alias updated
  • Domain DNS zone updated
4) In Plesk manually rename (change) all four of the domains create in step 2 one by one.

Notice how in the /tmp/event.log (or whichever log file you use) the OLD_DOMAIN_NAME and NEW_DOMAIN_NAME environment variable are the same.

For comparison setup a new event in the event manager for "Default domain (the first domain added to a subscription) updated" and use the same script (from step 1) as command for the event. And rename the subscription domain again in Plesk. Notice how in this case the OLD_DOMAIN_NAME environment variable logged the old domain name, and the NEW_DOMAIN_NAME environment variable logged the new domain name.

ACTUAL RESULT

When a domain is changed (renamed) both the OLD_DOMAIN_NAME and NEW_DOMAIN_NAME environment variable pass back the same (new) domain name.

EXPECTED RESULT

When a domain is changed (renamed) the OLD_DOMAIN_NAME environment variable should pass back the old domain name, and the NEW_DOMAIN_NAME environment variable should pass back the new domain name.

ANY ADDITIONAL INFORMATION

(DID NOT ANSWER QUESTION)

YOUR EXPECTATIONS FROM PLESK SERVICE TEAM

Confirm bug
 
Back
Top