It seems that there is an issue when having fastly plugin and CDN module installed.
When I save a node - I get an error 500.

I haven't been able to verify which part is the culprit - just that disabling CDN solved the issue.

CommentFileSizeAuthor
#5 Screen Shot 2016-06-01 at 10.52.29.png161.82 KBjonasdk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonasdk created an issue. See original summary.

jonasdk’s picture

Issue summary: View changes
jonasdk’s picture

Title: Incombability with Fastly module » Incompatibility with Fastly module
Wim Leers’s picture

Status: Active » Postponed (maintainer needs more info)

Do you see errors in your PHP error log?

jonasdk’s picture

I get following errors when trying to access a node that have an image in it - times 3 from 3 different IPs (all Fastly IPs)

InvalidArgumentException: The URI '//d3ocrpywcc4gay.cloudfront.net/sites/default/files/hero/2016-04/autohjaelp_trailer.jpg' is invalid. You must use a valid URI scheme. i Drupal\Core\Url::fromUri() (linje 276 af /var/www/html/core/lib/Drupal/Core/Url.php).

And I get these messages from the fastly module also in recent reports:
Successfully purged the key config:cdn.settings. Purge ID: 296-xxxxx-xxxxx.

In the screenshot you see the logs filed when I did a Activated of the preconfigured CDN module and after the 500's deactivated CDN in the settings again both on the Status tab in CDN module UI.

jonasdk’s picture

You might also need to know that the way we have the sites set op is like this:

subdomain.prod.domain.dk (The drupal server)
subdomain.domain.dk (fastly)

The Drupal server is only accessible from fastlys servers.

Wim Leers’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks! Now I can do a targeted investigation :) Stay tuned!

Wim Leers’s picture

Assigned: Unassigned » Wim Leers
Wim Leers’s picture

Title: Incompatibility with Fastly module » Purge does not support protocol-relative URLs/purge plug-in is calling file_create_url() when it should not?
Project: CDN » Purge
Assigned: Wim Leers » Unassigned
Issue tags: -D8 cacheability
Related issues: +#2573635: Url::fromUri() should accept protocol-relative URLs

Your screenshot suggests you're actually using the purge module. Is it possible that that's what you're seeing this error with?

In any case, the specific error message you're seeing is because Drupal 8's Url class currently does not support protocol-relative URLs. That's being fixed in #2573635: Url::fromUri() should accept protocol-relative URLs.

I suspect Purge or a plugin for it is calling file_create_url() when it should not

jonasdk’s picture

I don't have the purge module installed.

This is my make file

# Subsite makefile
# ----------------
# drush make base.make <target directory>
# drush make xxxx.make.yml .

#
# API version
# ------------

api: 2

# Core version
# ------------
core: "8.x"

# Set contrib directory
defaults:
  projects:
    subdir: "contrib"


# Fetch translations
translations:
  - da

# Core project
# ------------
projects:
  drupal:
    type: "core"
    version: "8.1.2"

  # ------------
  # development modules
  # ------------
  admin_toolbar:
    version: "1.15"
    subdir: development

  coffee:
    version: "1.0-beta1"
    subdir: development

  devel:
    version: "1.x-dev"
    subdir: development

  features:
    version: "3.0-alpha6"
    subdir: development

  # ------------
  # Contrib modules
  # ------------

  allowed_formats:
    version: "1.0"

  cdn:
    version: "3.0-alpha1"

  config_update:
    version: "1.1"

  crop:
    version: "1.0-rc1"

  ctools:
    version: "3.0-alpha26"

  editor_advanced_link:
    version: "1.2"

  editor_file:
    version: "1.1"

  embed:
    version: "1.0-rc2"

  entity:
    version: "1.0-alpha3"

  entity_embed:
    version: "1.0-alpha1"

  fastly:
    version: "3.0-alpha2"

  field_group:
    version: "1.0-rc4"

  git_deploy:
    version: "2.x-dev"

  #geolocation:
  #  version: "1.5"

  imagemagick:
    version: "1.0-alpha2"

  image_widget_crop:
    version: "1.0"

  libraries:
    version: "3.x-dev"

  metatag:
    version: "1.0-beta9"
# From beta 8    patch: "https://www.drupal.org/files/issues/metatag-n2725895-2.patch"

  pathauto:
    version: "1.0-alpha3"

  # Info about the current state of the module https://github.com/md-systems/redirect
  redirect:
    download:
      url: "git://github.com/md-systems/redirect.git"
      branch: "8.x-1.x"

  search_api:
    version: "1.0-alpha15"

  seckit:
    version: "1.x-dev"

  simplify:
    version: "1.0"

  token:
    version: "1.0-alpha2"

  weight:
    version: "3.0"

  # --------------
  # Custom modules
  # --------------

  search_api_algolia:
    download:
      type: git
      url: "https://github.com/fdmweb/search_api_algolia.git"
    destination: custom

  unset_html_head_link:
    download:
      type: git
      url: "https://github.com/fdmweb/unset_html_head_link.git"
    destination: custom
Wim Leers’s picture

Project: Purge » CDN

Oh, hm, you're right. Those log entries in your screenshot indeed originate from the Fastly module. Let me look into this a bit more.

Wim Leers’s picture

When I save a node - I get an error 500.

Are you uploading a file in that case? The more I think about this, the more it looks like this is a duplicate of #2711529: File upload widget broken when using CDN module, fixed in Drupal 8.1.4: require that version.

jonasdk’s picture

I am not saving a new file with it.
Just going to a node with a image and then trying to save it.

Wim Leers’s picture

Status: Active » Closed (duplicate)

That's effectively the same thing :) Thanks for confirming. See that other issue for details.

Wim Leers’s picture

Title: Purge does not support protocol-relative URLs/purge plug-in is calling file_create_url() when it should not? » When I save a node - I get an error 500