• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Resolved 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