[bug] - Error 500 if githost.log is missing
Created by: rtripault
Going to admin > logs returns a 500 error if githost.log is missing. Manually creating the file fixed it
Do not update/delete: Banner broadcast message test data
Do not update/delete: Notification broadcast message test data
Created by: rtripault
Going to admin > logs returns a 500 error if githost.log is missing. Manually creating the file fixed it
Created by: patthoyts
The following will suppress the error - but why is this file missing? It is likely better to create it than just return an empty list.
diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb
index aff13ba..fe2387d 100644
--- a/lib/gitlab/logger.rb
+++ b/lib/gitlab/logger.rb
@@ -10,7 +10,11 @@ module Gitlab
def self.read_latest
path = Rails.root.join("log/githost.log")
- logs = File.read(path).split("\n")
+ if File.exist?(path)
+ logs = File.read(path).split("\n")
+ else
+ logs = []
+ end
end
def self.build
By Administrator on 2012-07-21T14:24:52 (imported from GitLab)
Created by: riyad
Added the workaround to the Trouble Shooting Guide for now.
By Administrator on 2012-08-01T19:14:52 (imported from GitLab)