centralnicgroup-opensource / rtldev-middleware-whmcs

CentralNic's WHMCS Software Bundle
https://centralnicreseller.com
Other
35 stars 15 forks source link

IBS: 504 Gateway timeout & _SaveContactDetails not saving #253

Closed Kian987 closed 1 year ago

Kian987 commented 1 year ago

Hi,

sorry for the long bug report but it's complicated.

1. 504 Gateway Timeout

Installing the latest version of IBS registrar module whmcs-ibs-registrar-latest.zip results in 504 Gatewat Timeout when accessing to Clients > Domain Registrations page. The module floods IBS API server with hundreds of getconfigarray commands as follows:

immagine

It only stops when PHP hits timeout. The issue occurs on a system (WHMCS 8.4.1) that was already running IBS module (version 1.0.5).

2. Wrong download link

We still don't get what is the right repository we should be using for IBS. On internetbs.net we have the following link that gives us the 1.0.5 version (this file) that works but comes with some bugs that we have already reported - more on that later.

immagine

When we ask for support they tell us we must reference to this repository that gives us this other file (version 3.1.4) that produces 504 Gatewat Timeout error.

3. The actual bug

The only reason why we are updating is that we need ibs_SaveContactDetails() to work properly. For simplicity reasons let's focus on updating details for .it domain but the same also applies to .fr and others. Version 1.0.5 has this piece of code:

    // Unset params which is not possible update for domain
    if ('it' == $ext) {
        $data['registrant_clientip'] = ibs_getClientIp();
        $data['registrant_dotitterm1'] = 'yes';
        $data['registrant_dotitterm2'] = 'yes';
        $data['registrant_dotitterm3'] = $params['additionalfields']['Hide data in public WHOIS'] == 'on' ? 'no' : 'yes';
        $data['registrant_dotitterm4'] = 'yes';
        unset($data['registrant_countrycode']);
        unset($data['registrant_organization']);
        unset($data['registrant_countrycode']);
        unset($data['registrant_country']);
        unset($data['registrant_dotitentitytype']);
        unset($data['registrant_dotitnationality']);
        unset($data['registrant_dotitregcode']);
    }

This doesn't let both customers and administrators to update contact details since the script is unsetting mandatory parameters.

When I reported the issue I suggested that all these unset() had to be removed and that you also had to add new ones (eg. legal entity type, nationality etc.). From what I can see you listened to me since version 3.1.4 has been changed as follows:

    // Unset params which is not possible update for domain
    if ("it" == $ext) {
        $data["registrant_clientip"] = ibs_getClientIp();
        $data["registrant_dotitterm1"] = "yes";
        $data["registrant_dotitterm2"] = "yes";
        $data["registrant_dotitterm3"] = $params["additionalfields"]["Hide data in public WHOIS"] == "on" ? "no" : "yes";
        $data["registrant_dotitterm4"] = "yes";
        //unset($data["registrant_countrycode"]);
        //unset($data["registrant_organization"]);
        //unset($data["registrant_countrycode"]);
        //unset($data["registrant_country"]);
        //unset($data["registrant_dotitentitytype"]);
        $data["registrant_dotitentitytype"] = $params["additionalfields"]["Legal Entity Type"];
        //unset($data["registrant_dotitnationality"]);
        $data["registrant_dotitnationality"] = $params["additionalfields"]["Nationality"];
        //unset($data["registrant_dotitregcode"]);
        $data["registrant_dotitregcode"] = $params["additionalfields"]["VATTAXPassportIDNumber"];
    }

I still hadn't a chance to see if it works due to the 504 Gateway Timeout error but for sure the issue hasn't been fixed for other extensions like .fr TLD.

Thanks.

KaiSchwarz-cnic commented 1 year ago

@Kian987 thanks for reaching out.

1. 504 Gateway Timeout

With the latest version, you shouldn't run into that issue. Just in case you still notice that, please follow-up.

2. Wrong download link

Team mates from Brand IBS finally updated the Homepage. I requested an update a while ago, but ...

3. The actual bug

The basic problem is, that the initial version has been developed by others in the group. Taking over the module happens on a single day, but rewriting the entire module and fixing bugs, takes a while especially in lack of useful comments (why unset has been added and by whom) to avoid a time consuming analysis. So, whenever you notice something not to work - please reach out, we are able to release updates in short. I commented all the contact data related unset calls out now and released it as new major version - coming with breaking changes though. I expect that those unset's have been added for certain reasons, but honestly we haven't such code in place for the HEXONET and CNR Integrations, so why should that apply to IBS? If that's necessary, I see the error related to the IBS API and not to the integration. I've been fine with those changes therefore.

v4.0.0 is out. Please give it a try regarding the 504 Gateway Timeout issue.

Kian987 commented 1 year ago

Hi,

thanks but the 504 Gateway error persists. The module still floods IBS API server with getconfigarray (more in particular Account/Balance/Get) requests.

Let me know if you need more details.

KaiSchwarz-cnic commented 1 year ago

@Kian987 do you have a $customadminpath defined in configuration.php so that you have a non standard url? What's the url (including GET parameters) of the Domain Registrations page in your system? (feel free to hide the hostname)

KaiSchwarz-cnic commented 1 year ago

I guess, I am right. Please give v4.0.2 a try which I released right now. Thanks for reporting!

Kian987 commented 1 year ago

I confirm that it works. Many thanks.

I'll let you know if my customers still have problems when it comes to triggering SaveContactDetails() function.