Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: XML: can’t import/recognize basic file

Status Resolved
Add-on / Version DataGrab 4.2.2
Severity
EE Version 6.4.5

Paul Larson

Mar 08, 2023

I’m well versed enough with DataGrab where I shouldn’t be having this issue.


a) upload songs.xml. Make sure it’s 755. Verify path, which is:
/var/www/vhosts/mydomain.com/httpdocs/songs.xml

b) Removing content escaping as obstacle, using format (verbatim) from Boldminded docs:

<root>
    <entry>
        <id>A</id>
        <title>Dummy 1</title>
        <date>1973-12-11 13:00:00</date>
        <summary>Adds a related field</summary>
    </entry>
    <entry>
        <id>B</id>
        <title>Dummy 2</title>
        <date>1973-11-04 23:59:00</date>
        <summary>Adds another related field</summary>
    </entry>
</root>

c) Step one of Import creation.

https://www.dropbox.com/s/gv9l6zpz0ajec5t/2023-03-08_16-31-59.png?dl=0

d) Step two

https://www.dropbox.com/s/habtwrok5791kms/2023-03-08_16-32-58.png?dl=0

e) Can’t get past the initial “recognize file” step.

https://www.dropbox.com/s/qwt3e3qpkmyhug2/2023-03-08_16-33-34.png?dl=0

——

What on earth am I overlooking?

 

 

#1

Paul Larson

Also, I can browse to the file manually.

https://www.dropbox.com/s/y83zvzeq174k4lc/2023-03-08_16-36-19.png?dl=0

#2

Paul Larson

Also made sure php-xml is installed

#3

BoldMinded (Brian)

If you’re getting that error it’s b/c it can’t open the file. the CURL request is failing for some reason. Is there a redirect happening or something else that could block access to the file? This likely isn’t an issue with DataGrab itself… when this error happens its almost always a configuration error or something blocking access to the file.

#4

Paul Larson

Yeah - switched the Nginx, turned off Apache…and it works.

¯_(ツ)_/¯

Close this please =)

#5

BoldMinded (Brian)

In the datatypes/dt.datagrab_xml.php file is the following function around line 248…. try adding the if (!$data) conditional to it and see if it adds any helpful error message in the log file.

private function _curl_fetch($url)
    {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);

        $data = curl_exec($ch);

        curl_close($ch);

        if (!$data) {
            $this->addError('cURL Error: ' . curl_error($ch));
        }

        return $data;
    }
#6

BoldMinded (Brian)

Paul, did you figure out what the issue is? Did you try that error logging from the previous comment?

#7

Paul Larson

I solved it by simply switching to Nginx from Apache. Must be different compiled PHP modules between the two. I don’t quite understand the “why,” but it works. Thanks!

Login to reply