/render always return error 500 on solaris

Bug #922731 reported by maduma
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
Undecided
Unassigned

Bug Description

The root cause is because timezone directory is not /usr/share/zoneinfo but /usr/share/lib/zoneinfo

# here the fix for webapp/graphite/thirdparty/pytz/__init__.py file (diff -c)

*** proto/opt/lx/graphite/webapp/graphite/thirdparty/pytz/__init__.py Fri Sep 30 05:51:29 2011
--- patches/webapp/graphite/thirdparty/pytz/__init__.py Fri Jan 27 16:53:55 2012
***************
*** 55,61 ****
      for part in name_parts:
          if part == os.path.pardir or os.path.sep in part:
              raise ValueError('Bad path segment: %r' % part)
! filename = os.path.join('/usr/share/zoneinfo', *name_parts)
      return open(filename, 'rb')

--- 55,64 ----
      for part in name_parts:
          if part == os.path.pardir or os.path.sep in part:
              raise ValueError('Bad path segment: %r' % part)
! if os.uname()[0] == 'SunOS' and os.uname()[2] == '5.11':
! filename = os.path.join('/usr/share/lib/zoneinfo', *name_parts)
! else:
! filename = os.path.join('/usr/share/zoneinfo', *name_parts)
      return open(filename, 'rb')

Tags: solaris
Revision history for this message
Michael Leinartas (mleinartas) wrote :

Pytz is normally shipped with Olson tzdata, but in this case the bundled version has been modified to instead read from the system tzdata.it

Graphite actually first tries to import pytz from the Python path, so if you were to install pytz using pip (or some other means) it would resolve this. In any case, I have added a check to search /usr/share/lib/zoneinfo as well as /usr/share/zoneinfo so that the bundled version works for Solaris as well.

Revision history for this message
Michael Leinartas (mleinartas) wrote :

Committed in r681

Changed in graphite:
status: New → Fix Committed
Changed in graphite:
milestone: none → 0.9.10
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.