1. batetim
  2. RO CSVI
  3. Monday, 27 February 2017
  4.  Subscribe via email
Hi Tharuna/Roland

We have the below error message occuring which i wonder if you could point us in the direction of solving.

"Error - couldn't connect to host" when running export but i cant see that anything is wrong with template setup

I have attached a log file.

I am guessing this bit is the issue?

[QUERY] SELECT c.* FROM hal3m_virtuemart_calcs as c LEFT JOIN hal3m_virtuemart_calc_shoppergroups as cs ON cs.virtuemart_calc_id=c.virtuemart_calc_id WHERE `calc_kind` IN ('Marge','Tax','VatTax','DBTax','DATax' ) AND `published`="1" AND (`virtuemart_vendor_id`="1" OR `shared`="1" ) AND ( publish_up = "0000-00-00 00:00:00" OR publish_up <= "2017-02-27 17:46:00" ) AND ( publish_down = "0000-00-00 00:00:00" OR publish_down >= "2017-02-27 17:46:00" ) AND ( virtuemart_shoppergroup_id = 2 OR (virtuemart_shoppergroup_id) IS NULL)

Kind regards

Tim com_csvi.log.16.zip
Accepted Answer Pending Moderation
Hello Tim,
The query should not be the problem. What i am thinking is you have set the file to Save on server path. That must be causing the issue. What if you set the Destination to Download, can you download the file?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Tharuna

Unfortunately if you set template to download it produces same cannot connect to host error as attached log

Kind regards

Tim com_csvi.log.17.zip
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello Tim,

Assuming you get this error while running the export then it could be one of two reasons. Either it cannot connect to the server or it cannot connect to the database. My guess is that it loses the connection to the database. To verify that, do you get the same error when you export for example 5 products?

If there is no error, it would be something to check with the hosting provider if they can see any more details on why the connection would be lost. The other thing I wonder is, when it happens. Does it happen immediately or after running for a while?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi Roland

Yes same error with exporting just 5 lines.

VM product imports working fine though so imports connecting no problem with csvi.

Error come up pretty much straight away, but say three seconds in on an export with 500 lines on

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Tim,

Would you mind posting a screenshot of how the error shows itself?

Are you using the MySQLi driver as set in the global Joomla configuration?

My previous remark also still stands, does the hosting provider see any reason why this error shows? CSVI is not retrieving a large dataset at once but rather looping through them and requesting one record after the other.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi Roland

No problem screen shot attached

CSVI-errormessage.jpg

yes mysqli driver

Happy to ask host provider if any reason why cant connect to database server, but would this not effect imports also?

Kind regards

Tim
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 6
Accepted Answer Pending Moderation
... also cant seem to get any error message on server logs.

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 7
Accepted Answer Pending Moderation
Hello Tim,
The problem is only with Google export? What about any other export? Does it work?

I have a doubt with SEF URL generation in google export. The SEF URL is generated by calling the front end so probably that is reason you are seeing this error. Can you try setting Export SEF URLs to No on options tab in your template settings and see if export works?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 8
Accepted Answer Pending Moderation
Hello Tim,

I believe Tharuna is pointing in the right direction and that it is related to the SEF URLs. This error message is not one that is created by Joomla or CSVI. Assuming you have CSVI 7.1.0 installed, you can also try to update the SEF URLs from the maintenance menu, and see if that works.

The export should then take the URLs from the SEF Cache rather than calling the server for every single URL and thus lowering the demand for resources.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 9
Accepted Answer Pending Moderation
Hi Roland/Tharuna

Yes using 7.1.0 now and it does seem to be the SEF URL's as it does work when turning this option off in the template. As this is the first export there will be no cache as yet., and running this refresh under maintenance generates same error couldnt connect to host error.

I wonder if somehow either admin tools or RS firewall has blacklisted the IP address generating the SEF urls? Wonder if there is an ip address i should check if blacklisted (as these SEF urls works fine on a couple of other sites i have sitting on different web spaces on same server using same set up)

Does that sound possible?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 10
Accepted Answer Pending Moderation
Hello Tim,
You can check if CSVI has been blocked in any of these firewall extensions and also in your .htaccess file. I think once you whitelist CSVI, you should be able to run the export.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 11
Accepted Answer Pending Moderation
Hi Tharuna

I can see anything obvious in any of these security extensions. They block primarily by IP address, i am not sure how the SEF caching works, but is there an external IP address i should check that spiders the pages accociated with CSVI? If so i can add this to whitelist.

Export with SEF urls OFF works great with up to 2500 lines on, but idealy would like to use SEF urls.

Any other thoughts on what may be preventing SEF URL creation?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 12
Accepted Answer Pending Moderation
Hello Tim,
but is there an external IP address i should check that spiders the pages accociated with CSVI?

There is no external IP address for generating SEF URLs. It is that CSVI is trying to access the front end and is been stopped. Can you also check your .htaccess file to see if CSVI has been blocked in there?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 13
Accepted Answer Pending Moderation
Hi Tharuna

Nothing in .htaccess that refers to csvi

Is there any other way we can test what is causing the csvi to be blocked?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 14
Accepted Answer Pending Moderation
Hello Tim,

The way SEF caching works is that it sends a POST request the following url http://example.com/index.php?option=com_csvi&task=sefs.getsef&format=json and the parseurl variable that is posted contains the URL or URLs to convert. During a regular export the parseurl contains a single URL but during a maintenance task it contains up to 500 URLs. The script resturns the generated SEF URLs as an array.

So you could check if some kind of limit is hit when posting to this URL.

If you don't have any SEF cache enabled, exporting 2500 URLs means 2500 requests to the front-end of your site. This could be seen as a DDOS attack and therefore not allowing you to send any more requests. That is where the maintenance task for SEF URLs comes in. With 500 URLs per request, the 2500 requests become 5 requests. This is significantly lower.

Did you try running the maintenance task to populate the SEF cache?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 15
Accepted Answer Pending Moderation
Hi Roland

Yes the maintenance task produces same:

Error
couldn't connect to host

error message.

The site has 13831 products on, but even when i set the template to just one single product line with SEF urls on it produces same error.

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 16
Accepted Answer Pending Moderation
Hi Roland

I have raised this with host and they replied as follows:

"There is nothing in particular on the server that will be blocking connections to the database. When you are trying to connect, are you using the external IP address of 46.32.241.98 or the internal one, which is 10.16.16.12? If you are trying to connect from the website itself, you should use the internal one but for all other purposes, it would be the external IP address"

Not sure if this helps?

Kind regards

Tim
  1. more than a month ago
  2. RO CSVI
  3. # 17
Accepted Answer Pending Moderation
Hello Tim,

There is nothing in particular on the server that will be blocking connections to the database.
It is not the connection to the database but to the website itself.

So digging a little deeper, the message "couldn't connect to host" comes from cURL. CSVI uses cURL to make an outbound connection. Perhaps this article can shed some light on this. Perhaps the server is blocking POST requests that miss certain parameters, that I can't see.

So I tried to send a few requests to your site and the answers came back as expected. If you want to try it out yourself, since you are coming from the same IP as the script here is the code:
$parseUrl = json_encode(
array(
'index.php?option=com_virtuemart&view=productdetails&' . 'virtuemart_product_id=10' . '&virtuemart_category_id=2' . '&Itemid=1',
)
);
$http = JHttpFactory::getHttp(null, array('curl', 'stream'));
$result = $http->post('http://YOURDOMAIN/index.php?option=com_csvi&task=sefs.getsef&format=json', array('parseurl' => $parseUrl));
?>
<pre><?php
echo __FILE__ . '::' . __LINE__ . ':: ';
echo 'result: ';
echo '<div style="font-size: 1.5em;">';
print_r($result);
echo '</div>';
?></pre><?php

Replace YOURDOMAIN with your own domain name. This code can be placed in the file administrator/components/com_csvi/csvi.php after line 34. When you open CSVI, you should see the response from your server. Would be interesting to see what comes back there.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 18
Accepted Answer Pending Moderation
Hi Roland

Thanks for your reply.

Have made that change and it shows pretty much same error message as attached?

Kind regards

Tim Error_0_couldn_t_connect_to_host_-_2017-03-03_16.45.14.png
Attachments (1)
  1. more than a month ago
  2. RO CSVI
  3. # 19
Accepted Answer Pending Moderation
Hello Tim,

It's hard to believe maybe but this is good news, now we have determined the root cause of the error you see. Since this is an easy way to reproduce the error, I am afraid it is back to your host to see why that request is blocked. This is really something outside of CSVI, so we have no control over it. Now that you have easy sample code to reproduce the issue, perhaps that can help your host as well to determine why the request is blocked.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 20
  • Page :
  • 1
  • 2


There are no replies made for this post yet.
Be one of the first to reply to this post!