Page MenuHomePhabricator

rotate_logs.sh throws exceptions
Closed, ResolvedPublic

Description

Unhandled Exception: System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at filter.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentOutOfRangeException: Cannot be negative.
Parameter name: length
at System.String.Substring (Int32 startIndex, Int32 length) [0x00000] in <filename unknown>:0
at filter.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
touch: cannot touch `/data/project/.system/logs/apache2/global_access.log': Permission denied
/data/project/.system/logs/apache2/global_access.log: You need to share a group with the file
chmod: changing permissions of `/data/project/.system/logs/apache2/global_access.log': Operation not permitted

Version: unspecified
Severity: normal

Details

Reference
bz52236

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:01 AM
bzimport added a project: Toolforge.
bzimport set Reference to bz52236.

BTW, where's the source for filter.exe?

(In reply to comment #1)

BTW, where's the source for filter.exe?

Guess I found it (cf. https://github.com/benapetr/filter/blob/master/filter/Program.cs):

string s;
while ((s = Console.ReadLine()) != null)
{
if (s.StartsWith("tools-webserver") && s.Contains("HTTP/"))
{
if (s.Contains("+0000]"))
{
int position = 0;
position = s.IndexOf("+0000]") + 8;
int position_of_first = s.IndexOf("/", position);
int position_of_next = s.IndexOf("/", position_of_first + 1);
s = s.Substring(0, position_of_next) + " HTTP" + s.Substring(s.LastIndexOf("/"));
Console.WriteLine(s);
}
}
}

Shouldn't be too hard to port to sed :-).