You are here:  » registering feeds but not able to import them


registering feeds but not able to import them

Submitted by rolli1 on Sat, 2006-10-07 22:10 in

Hi David,

I am able to register a feed, but when I try to import it I get an internal 500 error and only one third of the feed is written in the database.
I contacted my host of that and they told me that this occures when a script wants to use a infrastructure of the server which he does not support. Is there a possibillity to downgrade the import script to a level where it is compatible with my resources? For which php version is PT written?

Regards

Roland

Submitted by Oisin on Sun, 2006-10-08 02:48

how many records are you trying to import?
file size?

Submitted by support on Sun, 2006-10-08 04:24

Hi Roland,

I know you've been running the script for some time now - is this just hapenning with one feed? Is the feed XML or a CSV variant (large CSV files are the most resource intensive)?

Submitted by rolli1 on Mon, 2006-10-09 07:47

Hi DAvid,

it is about 680 KB and 300 KB are imported. The script runs very good with other hosts. But with this special host the script does not work. I believe that they have older versions of php and mysql running.

Roland

Submitted by support on Mon, 2006-10-09 08:58

Hi Roland,

If the script is running it is unlikely to be a version problem - it is more likely that your host has PHP running in a restricted configuration and is now allowing enough time to import feeds.

In the first instance, the best thing to do is to contact the host of this particular installation and ask if they can disable "safe mode" against your account. That should then allow enough time to import. If not, let me know there may be other things that would work.

Do you have command line access to this account via Telnet or SSH?

Cheers,
David.

Submitted by rolli1 on Mon, 2006-10-09 13:51

Hi David,

I already asked them and they said they would not change anything and concerning access: no I have not.
Would it be possible to load the feed directly to the database?

Regards
Roland

Submitted by support on Mon, 2006-10-09 13:54

Hi Roland,

Unfortunately there is no easy way to load directly into the database, there is a fair bit of processing goes on during the import that affects other tables etc.

Can you confirm - you're able to do a trial import OK?

Then, when you do a full import; what exactly happens? Does the browser just stop and go blank, or do you get a message showing that PHP exceeded the time limit?

Cheers,
David.

Submitted by rolli1 on Mon, 2006-10-09 23:15

Hi David,

the trial import works fine. When I do the full import I get an error 500 internal server error. If I understood my host clearly they said that the programm uses advanced coding in comparison to their older versions.

Roland

Submitted by support on Tue, 2006-10-10 08:35

Hi Roland,

I presume the 500 internal server error occurs after a short period. Is it about 30 seconds for example, and more or less the same every time?

If it were a safe mode or compatability problem you should get a normal PHP error rather than an Apache 500 internal server error. Do you have access to the apache error log for your site to see what caused it (a 500 error always generates and error log event if you have logging enabled).

Unfortunately it sounds like your host is not willing to help in this sitiuation (most users in this situation find that their host is happy to disable safe mode in order to keep their business); and so the only solution would be to limit the number of products imported.

In admin/index.php you will see the following code (line 107):

tool("Import","feeds_import.php?filename=".urlencode($filename),$feeds[$filename]["registered"],($feeds[$filename]["imported"] < $modified));

To limit the import to, for example, 1000 records, use this code:

tool("Import","feeds_import.php?limit=1000&filename=".urlencode($filename),$feeds[$filename]["registered"],($feeds[$filename]["imported"] < $modified));

If that works you may be able to increase the number of records (try going up by 500 each time) until you find the limit of your servers resource permissions.

Cheers,
David.

Submitted by rolli1 on Tue, 2006-10-10 14:08

You are right concerning the error message.
I'll try your limit proposal and look what will happen. I'll keep you updated.

Thanks

Roland

Submitted by rolli1 on Tue, 2006-10-10 14:21

Hi David,

I tried and was able to import 391 products of about 900. If I take a greater limit the error 500 was displayed.

Roland

Submitted by rolli1 on Wed, 2006-10-11 09:47

Hi David,

the filter method does not work with this domain because I can not import the filter rules. I decided to leave that domain and host.

Thanks for your help solong.

Roland

Submitted by rolli1 on Thu, 2006-10-12 00:19

With my other host I discussed that item and they told me that because it is a shared server they cannot modify the execution time but they told me to add the following code:

ini_set('max_execution_time',10);

I inserted it at the beginning of the feeds_import.php and modifyed it to

ini_set('max_execution_time',500);

With that I have no problems importing the feed.

Greetings

Roland

Submitted by rolli1 on Thu, 2006-10-12 09:41

I tryed it with time,1500
and it works also for much bigger feeds.

Roland