def get_only_first_stacktrace(lines):
  """Get the first stacktrace because multiple stacktraces would make stacktrace
    parsing wrong."""
  new_lines = []
  for line in lines:
    line = line.rstrip()
    if line.startswith('+----') and new_lines:
      break
    # We don't add the empty lines in the beginning.
    if new_lines or line:
      new_lines.append(line)
  return new_lines