I'm trying to import a CSV into a content type I created, and I get this error. I've tried some stripped down and simplified CSVs and they still do it. There are no helpful errors in the log entries either.

Comments

C.H.Riss’s picture

subscibe - I get the same error here (in german: "Ein AJAX-HTTP-Fehler ist aufgetreten HTTP-Rückgabe-Code: 200 Im Folgenden finden Sie Debugging-Informationen. Pfad: /cwwb/batch?id=28&op=do Statustext: OK Antworttext: Fatal error: Unsupported operand types in /Volumes/Data/htdocs/cwwb/sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 149")

My csv is very simple - 5 fields and about 20 rows. First row is imported, then the error pops up....

C.H.Riss’s picture

Found a solution/hack for this:
depending on php-version (or..? - here: 5.3.1) one of the two arrays to be combined seem to be not an array (even if print_r() returns an array (?!))

I changed line 149 in modules/feeds/includes/FeedsConfigurable.inc

from
return $this->config + $defaults;
to
$cnf = $this->config;
return (array)$cnf + (array)$defaults;

- works.

enkore’s picture

thx c.h.riss for the fix, works also for me

Dale Baldwin’s picture

seems to work with xpath parser though it doesn't work with the YouTube parser.

An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=18&op=do StatusText: Service unavailable (with message) ResponseText: Recoverable fatal error: Argument 2 passed to FeedsProcessor::process() must be an instance of FeedsParserResult, null given, called in /data/drupal7/sites/all/modules/feeds/includes/FeedsSource.inc on line 349 and defined in FeedsProcessor->process() (line 101 of /data/drupal7/sites/all/modules/feeds/plugins/FeedsProcessor.inc).

fun error

paulgemini’s picture

FileSize
439 bytes

Patch based on #2

paulgemini’s picture

Status: Active » Needs review
Dale Baldwin’s picture

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /?q=batch&id=8&op=do StatusText: OK ResponseText: {"status":true,"percentage":"24","message":""}Uncaught exception thrown in session handler.PDOException: SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes: UPDATE {sessions} SET uid=:db_update_placeholder_0, cache=:db_update_placeholder_1, hostname=:db_update_placeholder_2, session=:db_update_placeholder_3, timestamp=:db_update_placeholder_4 WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ); Array ( [:db_update_placeholder_0] => 1 [:db_update_placeholder_1] => 0 [:db_update_placeholder_2] => 192.168.1.145 [:db_update_placeholder_3] =>

Ok updated the script this morning and got that at around 20% of the import. I'm importing around 3k xml files using xpath parser.

Dale Baldwin’s picture

Did some more testing, doesn't seem to work well with larger imports at all, I get to around 220 nodes and the whole thing crashes out. What was interesting was that I tried to create a config array in settings.php

$conf['feeds_node_batch_size'] = 200;

    Notice: Undefined property: stdClass::$feeds in feeds_node_update() (line 569 of /data/drupal7/sites/all/modules/feeds/feeds.module).
    Warning: array_merge(): Argument #2 is not an array in FeedsConfigurable->addConfig() (line 126 of /data/drupal7/sites/all/modules/feeds/includes/FeedsConfigurable.inc).
    Warning: array_intersect_key(): Argument #1 is not an array in FeedsConfigurable->addConfig() (line 128 of /data/drupal7/sites/all/modules/feeds/includes/FeedsConfigurable.inc).

I started getting that error. It seems to import the first node and then crashes out. When you go back to the import screen it then says its importing but it sits at 0%.

Dale Baldwin’s picture

Wow the errors here are misleading, fix works for xpath parser, anything over 200 nodes look at bumping up your php mem limit (I'm running at 512) and increase the script execution time from 60 to 120 seconds.

Still not sure what is going on with youtube feeds parser but will have a mess around with that later tonight.

anacronaut’s picture

Getting an identical error with the YouTube parser.

elijahmeeks’s picture

I'm getting the Ajax error using EditableFields.

doompal’s picture

#2, #5 worked for me.

John Bryan’s picture

If you are not using taxonomy with Feed items then this comment is not relevant.

If you are trying to have RSS or XML (etc.) "Feed Item" nodes inherit a taxonomy term from the parent "Feed" importer node and seeing "An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows." :-

Multiple Feed project issues have been created for this, or with similar message but the relvant one appears to be:-
"taxonomy_node_get_terms doesn't work with drupal 7"
http://drupal.org/node/959984

handsolo’s picture

i used the patch and it eliminates the error but i don't actually get any nodes created, it just says they were created but only the 1 that i used to run the import is created. What am i doing wrong?

Lythimus’s picture

I used this fix and it appears to be working, but is throwing a "Download of failed with code -1002" error. I'll update if I get it resolved if I feel like it's related.

jayray11’s picture

i get this error when i use fix in post #2- "Download of failed with code -1002"

manu manu’s picture

For the ones having the Undefined property: stdClass::$feeds in feeds_node_update() message, see #1273622: Feeds error on node_save() witch also solved this issue (Unsupported operand types) for me.

It's worth mentioning that the feeds source configuration was deleted during VBO actions on feed nodes.

dooug’s picture

Looks like error code -1002 is related to uri scheme (http, https, ... ):
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ht...

Make sure you are importing the files with complete urls. That solved the problem with error code -1002 for me.

liupascal’s picture

@dooug

I have the 1002 error, while my url looks are correct (it's in my local installation, like /Users/myuser/..../file.png, when i copy and paste the link in my browser it works).
If the file is supposed to be in a local folder, what uri scheme should it be (and what function do you use to format it ?)

Many thanks

dooug’s picture

@liupascal
looks if your are using the HTTP Fetcher for you feeds importer these are the options: feed, http or https are the options in drupal_http_request

Maybe in your case you need to use the File Upload fetcher instead?
Change it at: /admin/structure/feeds/YOUR_FEED_IMPORTER/fetcher
If you can't use the File Upload, maybe look at the contributed modules for Fetchers:
http://drupal.org/node/856644

ghmercado’s picture

thanks c.h.riss (#2) worked for me.

lahode’s picture

Hi,

Here are a few tips to make it work:

  • First put Drupal in English, by default mine was in French and did not work (a bug to fix)
  • Then, download iCalcreator (http://www.kigkonsult.se/downloads/index.php), I personnally use 2.10.23, and copied iCalUtilityFunctions.class.php and iCalcreator.class.php to the includes folder of parser_ical module
  • Thirdly, I had to fix a bug in Feeds module (I use the 7.x-2.x-dev of 2012-Jan-07 ). Please see http://drupal.org/node/1213472#comment-4754062
  • Finally, I used the same configuration as kriskhaira #30 with the ical file he attached #28 (Thank you by the way), but create a new content type with a date field (with end date option) to fetch the start + end date, before lauching the import with the "iCalCreator parser"
  • After that, I exported for fun my google agenda (http://support.google.com/calendar/bin/answer.py?hl=en&answer=37111), installed FullCalendar, a create a FullCalender view with my imported contents. And amazing, how simple, it works like mad!

The only tiny problem that still appears is a "Resource is not a file or it is an empty directory" warning

Hope this help and thanks to everyone!

Cheers

hafis’s picture

Thank you, #2 worked for me, 95 items, csv-import.

FranckV’s picture

Great thanks ! [#2] worked perfectly for me ! I used that in an RSS Feed import via http generated with Views (using Views RSS) : From a Drupal 6 site to a Drupal 7 site.

Nigel_S’s picture

The patch above is really not a solution. The problem is that when FeedsNodeProcessor attempts to save the target node type module_invoke_all dutifully calls all of the feed module's hooks including feed_node_insert. feed_node_insert then manually calls feed_node_update which *assumes* that $node->feeds exists but it doesn't on anything other than the actual importer (it having been set by the node module when its form was processed).

The absence of $node->feeds immediately causes errors in drupal but it's not until Feeds tries to append the configuration settings together that an actual PHP error is caused. Casting to an array merely masks the problem until other errors show up.

This error won't occur if the check in feed_node_update/insert isn't satisfied so people are seeing this when the content type they are processing is the same as the one to which the feed itself is bound. It's for that reason that the News sub-module isn't affected for instance; it's processing feed_items but the feed itself lives on a 'feed' type. Creating a separate type for the feed itself will avoid this problem though better checks within feeds.module to ensure that the hooks don't activate on the wrong content type might be in order.

Adding an && isset($node->feeds) for instance so

if (($importer_id = feeds_get_importer_id($node->type)) && isset($node->feeds))

would be a better temp fix than the typecast but it doesn't solve the problem that the created content types have some aspects of a feed importer (for example an import tab) which can't work unless properly set up. Processing the same content type as the importer is attached to is generally not a good idea then. :P Perhaps form validation to make sure the processor isn't touching the same content type that the importer is attached to?

jnettik’s picture

So the hack in #2 worked for me. I was only importing 80 nodes or so containing only a title and some address information.

After my import I noticed my logs were all filled with the three messages shown in #8 though all my nodes seemed to import with no problem.

drupalvino’s picture

Hi,
Im using drupal 7. While importing the csv file and excel file the error is occuring

"An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /example/batch?id=447&op=do StatusText: OK ResponseText: >>>>>> .r48 {"status":true,"percentage":"99","message":""}"

I dont know how to solve this. If u have any idea plz guide me.

emarchak’s picture

Formatted the diff from #26 to a patch for testing. Seems to be working for me.

emarchak’s picture

Hi Drupalvino. It seems like that error is unrelated to the issue that we're discussing here. I'd suggest you open up a new one specifically for that, hopefully more people will be able to find it and give you a hand.

OLD ACCOUNT USE ID 169175 INSTEAD’s picture

The patch in #28 worked for me, thank you!

handsofaten’s picture

#25 works for me. Thank you!

twistor’s picture

So, there are a few things going on here and a few decisions we have to make.

Starting from the assessment done in #25:

  • There's nothing inherently wrong about creating nodes of the same content type as the importer. This is even supported if you add a mapping to the feed_source.
  • We could do some fancy validation that determines if you're mapping to a content type that is an importer, but haven't set a mapping to the source field. I would much rather make the source field optional. We can add an option(default to TRUE to maintain the current behavior) that determines whether the source field is required in the ui, but we still need to not assume it in the code.
twistor’s picture

Version: 7.x-2.0-alpha4 » 7.x-2.x-dev
Component: Feeds Import » Code
Status: Needs review » Patch (to be ported)

Committed the simple fix to 7.x

This stops at least one of the very common "Unsupported operand types" issues.

Followup issue, #913458: Sanity check importer configurations.

http://drupalcode.org/project/feeds.git/commit/255005b

Does this need a backport?

twistor’s picture

Status: Patch (to be ported) » Fixed
sagraham’s picture

#25 was helpful to me. Creating a new content type for import, or even better just using the standalone form solved the problem for me.

Cadyfatcat’s picture

I was getting the following error, a bit different, but this patch worked for me also, the error was:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: XXXXX StatusText: OK ResponseText: Fatal error: Unsupported operand types in XXXXX/sites/all/modules/feeds/includes/FeedsConfigurable.inc on line 149

oh wait that is the same error!

citricguy’s picture

#2 worked for me as well.

Running PHP version 5.3.2

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.