[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
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Author Owner
Created by: michelpa
same issue for me...
By Administrator on 2012-07-21T13:21:19 (imported from GitLab project)
By Administrator on 2012-07-21T13:21:19 (imported from GitLab)
- Author Owner
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 project)
By Administrator on 2012-07-21T14:24:52 (imported from GitLab)
- Author Owner
Created by: patthoyts
The commit above will create the file if it is missing which avoids the problem and ensure logging gets re-enabled.
By Administrator on 2012-07-21T14:35:12 (imported from GitLab project)
By Administrator on 2012-07-21T14:35:12 (imported from GitLab)
- Author Owner
Created by: riyad
Added the workaround to the Trouble Shooting Guide for now.
By Administrator on 2012-08-01T19:14:52 (imported from GitLab project)
By Administrator on 2012-08-01T19:14:52 (imported from GitLab)