If PHP is configured to access files only within web directory, Feeds module cannot find its parser library and throws message:

Warning: file_exists(): open_basedir restriction in effect. File(/ParserCSV.inc) is not within the allowed path(s): ([...]\htdocs) in feeds_include_library() (line 984 of [...]\Htdocs\drupal\sites\all\modules\feeds\feeds.module).

As a consequence, after that not found library, system "imports" 1 totally empty node, and throws error
"PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ..." - obviously, it is dublicate entry for next empty node(s).

configuration in php.ini about restricted filesystem access:
open_basedir = [directory]
; http://php.net/open-basedir

Windows Server. On test system, Windows too, but without setting open_basedir in php, importing works.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

twistor’s picture

Status: Active » Needs review
FileSize
923 bytes

It looks like the libraries module is not configured correctly. We should check for that and also support sites/all/libraries.

Status: Needs review » Needs work

The last submitted patch, 1: feeds-libraries-include-2509464-1.patch, failed testing.

twistor’s picture

Status: Needs work » Needs review
FileSize
924 bytes

The last submitted patch, 1: feeds-libraries-include-2509464-1.patch, failed testing.

Max1’s picture

Wow, feeds-libraries-include-2509464-3.patch works like a charm!

Thank you

Max1’s picture

Status: Needs review » Fixed
Max1’s picture

Status: Fixed » Reviewed & tested by the community
Max1’s picture

I am the community :-)

Please integrate the patch to module for all.

twistor’s picture

Version: 7.x-2.0-alpha9 » 7.x-2.x-dev
FileSize
2.77 KB

Glad to hear it helps.

There's another place this has to be fixed.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 10: feeds-libraries-include-2509464-10.patch, failed testing.

twistor’s picture

twistor’s picture

Status: Needs work » Needs review

  • twistor committed 583e6c1 on 7.x-2.x
    Issue #2509464 by twistor, Max1: Feeds module cannot find its parser...
twistor’s picture

Status: Needs review » Fixed
joelpittet’s picture

@twistor This seemed to throw some new errors after it was upgraded to latest dev this morning.

Notice: Undefined variable: path in feeds_library_exists() (line 1151 of /feeds/feeds.module).
Notice: Undefined variable: path in feeds_library_exists() (line 1151 of /feeds/feeds.module).
Notice: Undefined variable: path in feeds_library_exists() (line 1151 of /feeds/feeds.module).
Notice: Undefined variable: path in feeds_library_exists() (line 1151 of /feeds/feeds.module).
joelpittet’s picture

Status: Fixed » Needs work

Unfortunately as much as we both would like assignment inside a condition to be in scope and early shortcut, this doesn't seem to work:

Here's sample to see:
http://3v4l.org/BHISv

joelpittet’s picture

This may be a better fix with no performance hit perse

http://3v4l.org/FjC7i

joelpittet’s picture

Status: Needs work » Needs review
FileSize
881 bytes

Try this.

  • twistor committed 94a29ed on 7.x-2.x authored by joelpittet
    Issue #2509464 by twistor, joelpittet: Feeds module cannot find its...
twistor’s picture

Status: Needs review » Fixed

Oy, missing some parens I suppose. We should have libraries enabled on testbot.

fixed feeds_include_library() as well.

Max1’s picture

I have updated Feeds module to last dev version (just to be accurate, last hour version - what a speed!). It works great on restricted php, and imports nodes from csv without errors.

Status: Fixed » Closed (fixed)

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