From 3aee47f04fddb82b1887044de86f8824e9e2f5f2 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 11 Jan 2017 13:48:03 -0500 Subject: [PATCH] 10808: Fix crash in cache-ownership-mismatch warning message. refs #10808 --- services/api/config/application.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/services/api/config/application.rb b/services/api/config/application.rb index d3fee8ea19..f3f6424b2d 100644 --- a/services/api/config/application.rb +++ b/services/api/config/application.rb @@ -42,9 +42,14 @@ module Server # other processes to fail later. default_cache_path = Rails.root.join('tmp', 'cache') if not File.owned?(default_cache_path) - STDERR.puts("Defaulting to memory cache, because #{default_cache_path} " \ - "owner (uid=#{File::Stat.new(default_cache_path).uid}) " \ - "is not me (uid=#{Process.euid})") + if File.exist?(default_cache_path) + why = "owner (uid=#{File::Stat.new(default_cache_path).uid}) " + + "is not me (uid=#{Process.euid})" + else + why = "does not exist" + end + STDERR.puts("Defaulting to memory cache, " + + "because #{default_cache_path} #{why}") config.cache_store = :memory_store end end -- 2.39.5