Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 2001: Command syntax error #402

Open
Skiewie opened this issue Dec 5, 2024 · 9 comments
Open

Error 2001: Command syntax error #402

Skiewie opened this issue Dec 5, 2024 · 9 comments

Comments

@Skiewie
Copy link

Skiewie commented Dec 5, 2024

Hi,

We have quite some domains of which we want to change the nameservers to a new hostname.
Unfortunately I'm running into a 2001 syntax error while testing the script with the infodomain.php example.

There is another issue posted years ago with the same error, but that one was closed. Someone mentioned changing the password, but this didn't work for me.

The steps I've done to come this far:

  1. git clone https://github.com/metaregistrar/php-epp-client.git
  2. Created a settings.ini file in the Registries folder named settings.ini
interface=eppConnection # (also tried sidnEppConnection)
hostname=ssl://drs.domain-registry.nl
port=700
userid=x
password=x
logging=true
verifypeer=true
verifypeername=true
allowselfsigned=true
  1. Editted Examples/infodomain.php

From if ($conn = eppConnection::create('')) {
To if ($conn = eppConnection::create('../Registries/settings.ini')) {

Also tried sidnEppConnection.

  1. composer install
  2. php infodomain.php test.nl
Retrieving info on test.nl
ERROR: Error 2001: Command syntax error

==== LOG ====
-----Connection made-----2024-12-05 16:36:08-----
Stream opened to ssl://drs.domain-registry.nl port 700 with protocol TLSv1.3, cipher TLS_AES_256_GCM_SHA384, 256 bits TLSv1.3
-----END-----2024-12-05 16:36:08-----

-----WRITE-----2024-12-05 16:36:08-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <command>
    <login>
      <clID>XXXXXXXXXXXXXXXX</clID>
      <pw>XXXXXXXXXXXXXXXX</pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
      </svcs>
    </login>
    <clTRID>6751c868ad389</clTRID>
  </command>
</epp>

-----END-----2024-12-05 16:36:08-----

-----READ-----2024-12-05 16:36:08-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <response>
    <result code="2001">
      <msg>Command syntax error</msg>
    </result>
    <trID>
      <clTRID>6751c868ad389</clTRID>
      <svTRID>SIDN</svTRID>
    </trID>
  </response>
</epp>

-----END-----2024-12-05 16:36:08-----

-----DISCONNECT-----2024-12-05 16:36:08-----
Disconnected
-----END-----2024-12-05 16:36:08-----

Is there maybe something I'm missing or should check? Hopefully someone can help me out, thanks!

@jminhal
Copy link

jminhal commented Jan 7, 2025

Hi there!
I'm having the same problem as you.
Did you manage to pinpoint the problem or find a solution?

Here's my settings file (settings.ini):

interface=eppConnection
hostname=ssl://eppdev.dns.pt 
port=3121
userid=x
password=x
logging=true
verifypeer=true
verifypeername=true
allowselfsigned=true

This is the response I'm getting when I run the PHP script "infodomain.php google.pt":

Retrieving info on google.pt
ERROR: Error 2001: Command syntax error; value:XML validation failed

==== LOG ====
-----Connection made-----2025-01-07 00:54:11-----
Stream opened to ssl://eppdev.dns.pt port 3121 with protocol TLSv1.2, cipher AES128-GCM-SHA256, 128 bits TLSv1.2
-----END-----2025-01-07 00:54:11-----

-----WRITE-----2025-01-07 00:54:11-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <command>
    <login>
      <clID>XXXXXXXXXXXXXXXX</clID>
      <pw>XXXXXXXXXXXXXXXX</pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
      </svcs>
    </login>
    <clTRID>677c7b33255ae</clTRID>
  </command>
</epp>

-----END-----2025-01-07 00:54:11-----

-----READ-----2025-01-07 00:54:11-----
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
  <response>
    <result code="2001">
      <msg>Command syntax error</msg>
      <value>XML validation failed</value>
    </result>
  </response>
</epp>

-----END-----2025-01-07 00:54:11-----

-----DISCONNECT-----2025-01-07 00:54:11-----
Disconnected
-----END-----2025-01-07 00:54:11-----

Let me know if you have any suggestions or insights!

@Skiewie
Copy link
Author

Skiewie commented Jan 7, 2025

Hi, unfortunately haven't found a solution yet. Hopefully @metaregistrar would be able to pinpoint the syntax error based on the posted info or after follow up questions.

@jminhal
Copy link

jminhal commented Jan 9, 2025

@Skiewie, did you try in your settings file to use 'certificatefile' and 'certificatepassword'?

@Skiewie
Copy link
Author

Skiewie commented Jan 13, 2025

@jminhal , I have not tried these parameters. What kind of certificate would I have to use? Do I need to download one from the SIDN portal or generate something?

@metaregistrar
Copy link
Owner

You are connecting to DNS.PT, so getting a certificate from SIDN will not help you in any way.

The registry (DNS.PT) can help you if you need a certificate or not.

When you are receiving "syntax error", it seems that you already have a proper connection, so a certificate will probably not be needed here.

It seems that DNS.PT has problems with the syntax of the formatted EPP command, so you would be best to consult the registry to ask which part of the XML command they do not accept.

I have checked the DNS.PT EPP documentation, and their login command includes the ptcontact-1.0 and ptdomain-1.0 extensions. Have you tried adding these to your login?

@Skiewie
Copy link
Author

Skiewie commented Feb 17, 2025

@metaregistrar the dns.pt issue is from another user. Can you check the primary post from 5 december? Thx!

@metaregistrar
Copy link
Owner

I think you either have to create a sidnEppConnection (that should maybe give another error) or add these extensions to your connection attempt:
$conn->enableDnssec();
$conn->useExtension('sidn-ext-epp-1.0');

SIDN probably expects these extensions.

When I login to SIDN the command looks like this:

-----WRITE-----2025-02-19 15:44:19-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <command>
    <login>
      <clID>XXXXXXXXXXXXXXXX</clID>
      <pw>XXXXXXXXXXXXXXXX</pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
        <svcExtension>
          <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
          <extURI>http://rxsd.domain-registry.nl/sidn-ext-epp-1.0</extURI>
          <extURI>http://rxsd.domain-registry.nl/sidn-ext-epp-scheduled-delete-1.0</extURI>
        </svcExtension>
      </svcs>
    </login>
    <clTRID>xxxxxxxxxx</clTRID>
  </command>
</epp>

@Skiewie
Copy link
Author

Skiewie commented Feb 20, 2025

Just tested it again and it does show the extensions, unfortunately with the same syntax error:

$ php infodomain.php test.nl

Retrieving info on test.nl
ERROR: Error 2001: Command syntax error

==== LOG ====
-----Connection made-----2025-02-20 13:00:53-----
Stream opened to ssl://drs.domain-registry.nl port 700 with protocol TLSv1.3, cipher TLS_AES_256_GCM_SHA384, 256 bits TLSv1.3
-----END-----2025-02-20 13:00:53-----

-----WRITE-----2025-02-20 13:00:53-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <command>
    <login>
      <clID>XXXXXXXXXXXXXXXX</clID>
      <pw>XXXXXXXXXXXXXXXX</pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
        <svcExtension>
          <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
          <extURI>http://rxsd.domain-registry.nl/sidn-ext-epp-1.0</extURI>
        </svcExtension>
      </svcs>
    </login>
    <clTRID>67b7197569ca7</clTRID>
  </command>
</epp>

-----END-----2025-02-20 13:00:53-----

-----READ-----2025-02-20 13:00:53-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <response>
    <result code="2001">
      <msg>Command syntax error</msg>
    </result>
    <trID>
      <clTRID>67b7197569ca7</clTRID>
      <svTRID>SIDN</svTRID>
    </trID>
  </response>
</epp>

-----END-----2025-02-20 13:00:53-----

-----DISCONNECT-----2025-02-20 13:00:53-----
Disconnected
-----END-----2025-02-20 13:00:53-----

I have modified checkdomain.php:

In the $conn part changed eppConnection to sidnEppConnection:
if ($conn = sidnEppConnection::create('../Registries/settings.ini')) {

Yet, this shows the same syntax error:

php checkdomain.php test.nl
Checking 1 domain names
ERROR: Error 2001: Command syntax error

==== LOG ====
-----Connection made-----2025-02-20 13:08:12-----
Stream opened to ssl://drs.domain-registry.nl port 700 with protocol TLSv1.3, cipher TLS_AES_256_GCM_SHA384, 256 bits TLSv1.3
-----END-----2025-02-20 13:08:12-----

-----WRITE-----2025-02-20 13:08:12-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <command>
    <login>
      <clID>XXXXXXXXXXXXXXXX</clID>
      <pw>XXXXXXXXXXXXXXXX</pw>
      <options>
        <version>1.0</version>
        <lang>en</lang>
      </options>
      <svcs>
        <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
        <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
        <svcExtension>
          <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
          <extURI>http://rxsd.domain-registry.nl/sidn-ext-epp-1.0</extURI>
        </svcExtension>
      </svcs>
    </login>
    <clTRID>67b71b2c17a71</clTRID>
  </command>
</epp>

-----END-----2025-02-20 13:08:12-----

-----READ-----2025-02-20 13:08:12-----
<?xml version="1.0" encoding="UTF-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
  <response>
    <result code="2001">
      <msg>Command syntax error</msg>
    </result>
    <trID>
      <clTRID>67b71b2c17a71</clTRID>
      <svTRID>SIDN</svTRID>
    </trID>
  </response>
</epp>

-----END-----2025-02-20 13:08:12-----

-----DISCONNECT-----2025-02-20 13:08:12-----
Disconnected
-----END-----2025-02-20 13:08:12-----

Are there any other things I should check or try? Thanks!

@metaregistrar
Copy link
Owner

I have viewed both our login commands side-by-side, and they are exactly the same. The best thing is to ask SIDN what goes wrong here, because the login command that I showed is succesful and yours is not. There must be some difference but I cannot find it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants