Display an understandable error message when source file contains links to non-existing files

Created on 31 December 2018, almost 6 years ago
Updated 29 November 2024, 19 days ago

Problem/Motivation

When you are importing files from a http source, but the source contains a url to a non-existing file or the url is otherwise not correct, you could get an error like the following:

In this case it is not clear which url was not correct.

Steps to reproduce

  1. Install modules Node, Feeds, File
  2. Create a content type with a file field
  3. Create a feed type and map to this file field

Import a malformed url. While I don't know the exact url that explicitly caused cURL error 3: <url> malformed, here are some examples that do cause a curl error:

  • /sites/default/files/example.txt (domain name is missing)
  • https://www.example.com/sites/default/files/example.txt (404)
  • https://www.examp le.com/sites/default/files/example.txt (space in domain name)
  • custom://example.txt (unsupported protocol)

But in these situations the url that caused trouble is displayed already in the error message.

Proposed resolution

When an error occurs, make sure that the url that cause the error is displayed and throw it as a TargetValidationException.

Remaining tasks

  1. Reproduce the issue.
  2. Test if the available code solves the problem.
  3. Write a test where a file download failed and assert that the expected message is displayed.
  4. Write a test where a file download still failed on a second import attempt and assert that the expected message is displayed again.
  5. (advanced) See if there is a way on subsequent imports that the user is warned again about the failed download.

User interface changes

Introduced terminology

API changes

Data model changes

Original report by Burlyn84

I have a client that wants to manage his parts online. There are 335 parts to upload and I have feeds set up to handle this from a CSV.

I keep getting this error after trying to upload some parts.

cURL error 3: malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

Sometimes the error will include the information that certain values should not be null, which doesn't make sense because some of the parts will upload.

Any ideas? I have attached the configuration and the screenshot of the error.

Feature request
Status

Needs review

Version

3.0

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024