I have a Drupal site that was working fine. I use Juicebox for displaying photos. I recently added a SSL certificate to my site. After installing the certificate I now get the following error when attempting to upload or remove an image:
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /file/ajax/field_juiceimage/und/form-rKYHN1Kbk5aYP4CWNtqXBzxJGszCvR0Qm5pmzy2yfaI
StatusText: n/a
ResponseText:
ReadyState: undefined
The upload works in spite of the error if you go ahead and clear the AJAX error message and save the page.
When attempting to remove an image, however, it does not delete the image.
I ported the site to a different server, and without SSL, the upload/remove functions work fine.
I don't see anything in the logs, but perhaps don't know where to look. I've tried all the browsers (Chrome, Firefox, IE) with same result. I have checked permissions, looked at the .htaccess and settings.php files for possible solution.
Does anyone have an idea? The SSL Cert seems to be the catalyst for the problem.
Thanks.
Comments
It is very odd. Did you clear
It is very odd. Did you clear all caches after installing the SSL cert? If not, that alone could fix the problem.
I am inclined to think it is not the SSL cert diretly so much as the switch to https which is likely to cause a problem.
A few things to look into: Did you redirect all http requests to https? Is the problem path /file/ajax/field_juiceimage/und/form-rKYHN1Kbk5aYP4CWNtqXBzxJGszCvR0Qm5pmzy2yfaI calling URL with the http or the https protocol? If you are using php-fpm did you restart it when you restarted your server? Does changing browser help (since some paths may be cached, who knows--this is a wild guess)?
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
I did not originally clear
I did not originally clear caches, but have now done so. It had no impact.
All pages are being redirected to https. Your question about the problem path is a good one. The error message states that an AJAX HTTP request terminated abnormally, but it seems to me that it should be an HTTPS request. The page with the image files, my juicebox juice album page, is definitely HTTPS. However can the page function (either Upload or Remove) be attempting an HTTP only request and that be the problem? I don't know how to tell.
As far as I can see, php-fpm is not installed (dpkg --list | grep php doesn't show it). I'm running php 7.0.15.
I have tried Chrome, Firefox and IE. They all show the same issue.
Thanks for your input!
More Error Information
In probing around the webpage, I find these error messages in the Console section of the webpage development tools:
Refused to display 'https://www.example.com/file/ajax/field_juiceimage/und/form-t97rklOJAyrf...' in a frame because it set 'X-Frame-Options' to 'deny'.
VM695:1
POST https://www.example.com/file/ajax/field_juiceimage/und/form-t97rklOJAyrf... net::ERR_BLOCKED_BY_RESPONSE
I've tried to simply punch the upload button from various pages on the website and get the same error.
Does this shed any more light?
Thanks!
Not sure. I would take a look
Not sure. I would take a look at the Juicebox module issue queue. In particular this issue https://www.drupal.org/node/2557237 suggests that the problem may be caused by a javascript conflict either from lack of Jquery update or correct version of Jquery, or a conflict with a particular theme. Next easy debugging step is try try switching to Bartik theme to see if the issue is still present. Also take a look at the Console in Chrome developer tools for JS errors.
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Updated jquery - additional error messages
I updated the jquery module to alpha5. Still get the error. Changed the theme to Bartik, still get the error. I'm using the Mix & Match theme. Here are additional error messages I see in the browser developer console:
This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features! juice-album
Use of getAttributeNode() is deprecated. Use getAttribute() instead. jquery.js:55:400
Use of attributes’ nodeValue attribute is deprecated. Use value instead. jquery.js:55:429
Load denied by X-Frame-Options: https://www.example.com/file/ajax/field_juiceimage/und/form-TxercY1H4Mfv... does not permit framing.
It could be a server security
It could be a server security setting. See http://stackoverflow.com/questions/38699221/load-denied-by-x-frame-optio...
You should be able to use the HTML tab in Developer tools to inspect your main page's header and see whether it has
X-Frame-Options SAMEORIGIN
If so you may need to fix it to get Juicebox working. If someone else is running the server, maybe ask them / raise a ticket. If you are running the server, you could take a look at this setting in your Apache config file (assuing you are using Apache).
Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors
Was this ever resolved?
Hello, I'm getting the same error after having recently installed an SSL certificate. I don't think any other changes were made to the system other than the addition of the SSL certificate and web traffic being redirected to https:
Thanks,
Scott
Resolved in my case with changes to virtual host directives
This turned out to be a misconfigured virtual host directive in Apache which was resolved by my sys admin.
If it was X-Frame-Options, as
If it was X-Frame-Options, as I mentioned below, it is not Apache problem but Drupal. Drupal should not use http for AJAX requests when site is on httpS. Changing configuration of VirtualHost to be less safe is not good idea, but it works :P
X-Frame-Options option off
X-Frame-Options option on server is a solution. Drupal AJAX as default us HTTP not httpS and when site request mismatch with ajax request content is blocked
If it was X-Frame-Options, as
"how to delete missclicked comments?"
Content Security Policy
I recently had an error like this. It was caused by Content Security Policy. The Ajax request was blocked by "default-src 'none'". To make it work, I had to add:
connect-src 'self'
So issue you linked to is
So issue you linked to is still ridiculously not resolved.check this out
Depending on how important it is for you to keep AJAX errors when a request is terminated abnormally, you can avoid hacking core by injecting JS that redefines the Drupal AJAX error function.
Other developers even went as far as to redefine window.alert to avoid alerts of any kind appearing.
What I did was to inject the following JS in areas that end users visit suffering from unnecessary alerts when autocompleting is interrupted: