Rails/Paperclip/S3 mystery errors: undefined metho


So I upgraded a Rails app from 3.0 to 4.0 last week, and ever since I've been getting strange errors that seem to point to random places that I haven't changed, and I can't reproduce them.

One such error is like this:

NoMethodError: undefined method `global_endpoint?' for AWS::S3:Class [GEM_ROOT]/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:441 /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:441 in "block in add_service" /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:361 in "call" /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:361 in "block in add_option" /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "block (2 levels) in add_option_with_needs" /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "each" /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "inject" /gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "block in add_option_with_needs" /gems/aws-sdk-1.46.0/lib/aws/core/service_interface.rb:73 in "initialize" /gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:239 in "new" /gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:239 in "obtain_s3_instance_for" /gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:233 in "s3_interface" /gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:243 in "s3_bucket" /gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:247 in "s3_object" /app/models/my_model.rb:49 in "block in my_download_url"

This will randomly occur on a page that has a model with a paperclip attachment saved on S3. Reloading the page will sometimes cause it again, but usually it will reload properly without incident.

I don't know what to do to debug it, since I can't even get it to happen at will.

Any help or ideas?


Solved it! Only took a year and a half of searching! Turns out it's related to some bad memory hooks in the libxml-ruby gem. See here:

https://github.com/sparklemotion/nokogiri/issues/881 https://github.com/sparklemotion/nokogiri/issues/1364

Removing libxml-ruby from my Gemfile fixed it.


  • Rails/Paperclip/S3 mystery errors: undefined method “global_endpoint?”
  • Python send cmd on socket
  • Python send cmd on socket
  • What is wrong with this boost::lambda::bind usage?
  • How to enumerate running ec2 instances and load them into a database using ruby? [closed]
  • AWS Signature Error using Postman to access the AWS API Gateway when posting a binary
  • How do I add inbound security rules for EC2 using DNS?
  • How to set spark.driver.memory for Spark/Zeppelin on EMR
  • invoke lambda function with hours delay
  • Does externalizing sensitive config variables into a .properties outside of Config.groovy provide a
  • AccessDeniedException on aws when i'm trying to raise a support ticket
  • Grouping odd and even days
  • Access Amazon s3 using http in angular2
  • Amazon s3 – 403 Forbidden with Correct Bucket Policy
  • How can I detect errors in an HTML document fragment with Ruby?
  • AWS Cloudwatch not triggering on API calls
  • 500 internal server error in ruby on rails
  • Is creating a new version of an object in AWS S3 eventually consistent or read-after-write consisten
  • AWS Cognito- get user information with ID
  • Dynamically create AWS IoT topic
  • Rails 3.2 from SQLite locally to Postgres on Heroku
  • python - calculate orthographic similarity between words of a list
  • How to get latest version of a artifact on Bintray using JSONP
  • During installation of Django, why do I keep getting ImportError: No module named django?
  • Angular2 component view does not update on value change via method
  • CakePHP ACL tutorial initDB function warnings
  • Spring Cloud Microservice Architecture Confusion
  • error importing numpy
  • How to get Eclipse Oxygen to run on Java 9
  • Very simple C++ DLL that can be called from .net
  • Could not find rake using whenever rails
  • How can I send an e-mail from a vbs script
  • Get object from AWS S3 as a stream
  • Is there a mandatory requirement to switch app.yaml?
  • SetUp method failed while running tests from teamcity
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • Understanding cpu registers
  • Observable and ngFor in Angular 2
  • UserPrincipal.Current returns apppool on IIS
  • Unable to use reactive element in my shiny app