• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

DNS commande line utility fails to delete TXT record

ESKIS

New Pleskian
Although running
>>
/usr/local/psa/bin/dns --info dev.sname.c002.aname.domain.com
>>
shows the 'ecz1' TXT record exists for "dev.sname.c002.aname.domain.com" :
...
ecz1.dev.sname.c002.aname.domain.com. TXT ecz1
...

running
>>
/usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt '' -domain 'ecz1'
>>
or even :
>>
/usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt 'ecz1' -domain 'ecz1'
>>
failsn with the following error message :

"unable to find DNS record"

Any help appreciated.
 
Last edited:
Thanks IgorG, but already found and checked and nothing helped.
Could you try to delete a dns TXT entry with CLI and tell me what I am doing wrong if you succeed?
 
Really strange - same commands works fine for me:
Code:
[root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --add dev.sname.c002.aname.domain.com -txt ecz1 -domain ecz1
SUCCESS: Creation of DNS record in Domain 'dev.sname.c002.aname.domain.com' complete.
[root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --info dev.sname.c002.aname.domain.com | grep ecz1
ecz1.dev.sname.c002.aname.domain.com. TXT  ecz1
[root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt 'ecz1' -domain 'ecz1'
SUCCESS: Removal of DNS record in Domain 'dev.sname.c002.aname.domain.com' complete.
 
the issue can be caused by extra spaces in the TXT record:
Code:
[root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --add dev.sname.c002.aname.domain.com -txt 'ecz1       ' -domain ecz1
SUCCESS: Creation of DNS record in Domain 'dev.sname.c002.aname.domain.com' complete.
[root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt 'ecz1' -domain ecz1
Unable to del record in DNS server: unable to find DNS record

in the following example I have 3 such TXT records with 3, 5, 7 extra spaces and remove record with 3 spaces:
Code:
[root@a10-52-143-28 ~]# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e  "select host, val, (length(val) - length(rtrim(val))) as extraspaces from dns_recs where host='ecz1.dev.sname.c002.aname.domain.com.' and val like 'ecz1%'"
+---------------------------------------+-------------+-------------+
| host                                  | val         | extraspaces |
+---------------------------------------+-------------+-------------+
| ecz1.dev.sname.c002.aname.domain.com. | ecz1        |           5 |
| ecz1.dev.sname.c002.aname.domain.com. | ecz1        |           3 |
| ecz1.dev.sname.c002.aname.domain.com. | ecz1        |           7 |
+---------------------------------------+-------------+-------------+
[root@a10-52-143-28 ~]# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt 'ecz1   ' -domain ecz1SUCCESS: Removal of DNS record in Domain 'dev.sname.c002.aname.domain.com' complete.
[root@a10-52-143-28 ~]# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e  "select host, val, (length(val) - length(rtrim(val))) as extraspaces from dns_recs where host='ecz1.dev.sname.c002.aname.domain.com.' and val like 'ecz1%'"
+---------------------------------------+-------------+-------------+
| host                                  | val         | extraspaces |
+---------------------------------------+-------------+-------------+
| ecz1.dev.sname.c002.aname.domain.com. | ecz1        |           5 |
| ecz1.dev.sname.c002.aname.domain.com. | ecz1        |           7 |
+---------------------------------------+-------------+-------------+
 
Thanks,

But, no extra spaces... (see below)

root@ns330505:~# /usr/local/psa/bin/dns --add dev.sname.c002.aname.domain.com -txt ecz2 -domain ecz2
SUCCESS
: Creation of DNS record in DomainAlias 'dev.sname.c002.aname.domain.com' complete.

root@ns330505:~# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt ecz2 -domain ecz2
unable to find DNS record


root@ns330505:~# mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "select host, val, (length(val) - length(rtrim(val))) as extraspaces from dns_recs where host='ecz2.dev.sname.c002.aname.domain.com.' and val like 'ecz2%'"
+--------------------------------------------+------+-------------+
| host | val | extraspaces |
+--------------------------------------------+------+-------------+
| ecz2.dev.sname.c002.aname.domain.com. | ecz2 | 0 |
+--------------------------------------------+------+-------------+


Is there any log that may help ? I've searched into /var/log/plesk, but found none containing "ecz2"

==
PLESK is : 12.0.18 Mise à jour n° 43, dernière mise à jour à 17 Avril 2015 06:25
OS : Ubuntu 14.04.2 LTS
==
 
Hmm, very strange...
Can you remove such records in GUI?
If you are able to remove them from the panel then try to enable debug in your panel.ini. Type command # plesk conf panel.ini
and uncomment or add following sections:

[debug]

; Enable debug mode (do not use in production environment)
enabled = on

[log]

; Log messages verbosity level (from 0 to 7)
; 0 - only critical errors, 7 - all including debug messages, default - 3
filter.priority = 7

; Enable logging of external utilities calls
show.util_exec = on

; Enable logging of stdin and stdout for external utilities calls (do not use in production environment)
show.util_exec_io = on

Start watching the panel.log (# plesk log panel.log) and remove the problem record.
 
Also check the same steps with en_US locale set:
# export LANG=en_US
# /usr/local/psa/bin/dns --add dev.sname.c002.aname.domain.com -txt ecz3 -domain ecz3
# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt ecz3 -domain ecz3
 
Thanks for your help RuslanT.

Here's traces of deleting record 'ecz2' from GUI in debug mode (record is actually deleted) :

>>>
[2015-04-20 10:27:59] INFO [panel] Les modifications appliquées aux enregistrements DNS ont été enregistrées.
[2015-04-20 10:27:59] WARN [panel] CommonPanel_Controller_Helper_Url::_getUrlWithCtx: Seriously malformed URL. Skip context challenging: /dns-zone/records-list/id/a:7
[2015-04-20 10:27:59] WARN [panel] CommonPanel_Controller_Helper_Url::_getUrlWithCtx: Seriously malformed URL. Skip context challenging: /dns-zone/records-list/id/a:7
[2015-04-20 10:27:59] DEBUG [util_exec] [5534b88f5beba] Starting: dnsmng /opt/psa/admin/bin/dnsmng '--update' 'dev.sname.c002.aname.domain.com'
[2015-04-20 10:27:59] DEBUG [util_exec] [5534b88f5beba] Finished in 0.19638s, Result: TRUE
>>>

When changing LANG to en_US (Default is "LANG=fr_FR.UTF-8") it gives :
>>>
root@ns330505:~# export LANG=en_US
root@ns330505:~# /usr/local/psa/bin/dns --add dev.sname.c002.aname.domain.com -txt ecz3 -domain ecz3
Warning: Current locale is unusable. Using 'C' instead.
SUCCESS: Creation of DNS record in DomainAlias 'dev.sname.c002.aname.domain.com' complete.
[2015-04-20 10:32:47] DEBUG [util_exec] [5534b9afeb061] Starting: dnsmng /opt/psa/admin/bin/dnsmng '--update' 'dev.sname.c002.aname.domain.com'
[2015-04-20 10:32:47] DEBUG [util_exec] [5534b9afeb061] Finished in 0.02019s, Result: TRUE
root@ns330505:~# /usr/local/psa/bin/dns --del dev.sname.c002.aname.domain.com -txt ecz3 -domain ecz3
Warning: Current locale is unusable. Using 'C' instead.
unable to find DNS record
>>
 
Try to use quotes in commands:
# export LANG=C
# /usr/local/psa/bin/dns --add 'dev.sname.c002.aname.domain.com' -txt 'ecz3' -domain 'ecz3'
# /usr/local/psa/bin/dns --del 'dev.sname.c002.aname.domain.com' -txt 'ecz3' -domain 'ecz3'

If this won't help there another way to try to debug it:
Add or uncomment following In [log] block of panel.ini:
; Enable logging of SQL queries
show.sql_query = on

It will add SQL queries on each operation in the panel.log. Then you can try to compare SQL queries for "working" removing from GUI and "broken" from CLI.
 
Many thanks again for your help,

Unfortunately, 'C' lang and quotes didn't help a lot...

Is there a way to send you a zip of following traces (with SQL query logging enabled) ?

150421_PLESK_CLI_add_quoted.txt : Ading 'ecz4'
150421_PLESK_CLI_add.txt : same, without quotes
150421_PLESK_CLI_del_quoted.txt : Deleting 'ecz4'
150421_PLESK_CLI_del.txt : same, without quotes
150421_PLESK_GUI_del_quoted.txt : Traces when deleting 'ecz4' from GUI
150421_PLESK_GUI_del.txt : When deleting from GUI the entry added without quotes (probably, useless, but...)
 
Last edited:
No "upload" button in conversations GUI
 

Attachments

  • Capture du 2015-04-28 08:24:45.png
    Capture du 2015-04-28 08:24:45.png
    27.2 KB · Views: 3
Hi, ESKIS
Thanks for logs, I was able to reproduce the issue. It's a product bug - I reported it with the internal ID PPPM-2800 "Removing TXT record from domain alias' DNS zone with dns CLI utility failed with: unable to find DNS record". It probably will be fixed in one of the nearest updates - please watch the changes log.


http://talk.plesk.com/members/eskis.168765/
 
Back
Top