[urgent]unicode error when edit the group

Asked by ryan cheung

please see it on #18 & #20

Question information

Language:
English Edit question
Status:
Answered
For:
SchoolTool Edit question
Assignee:
Justas Sadzevičius Edit question
Last query:
Last reply:
Revision history for this message
Tom Hoffman (tom-hoffman) said :
#1

Hi Ryan,

We don't have any direct experience with Active Directory, but I'll assign this to the developer who did our LDAP implementation and hopefully we can figure this out.

Revision history for this message
ryan cheung (ryancheung06) said :
#2

Thanks, hope u can resolve my problems

Revision history for this message
ryan cheung (ryancheung06) said :
#3

Thanks, hope u can resolve my problems

Revision history for this message
ryan cheung (ryancheung06) said :
#4

Thanks, hope u can resolve my problems

Revision history for this message
ryan cheung (ryancheung06) said :
#5

Sorry, it is not solve

Revision history for this message
ryan cheung (ryancheung06) said :
#6

Is there have any advise?

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#7

Justas is in Lithuania, so it'll be a few more hours before he's at work I think.

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) said :
#8

Hi Ryan,

  I am not familiar with wins 2012 and I cannot help you much.

  Most important parts are "LDAP server URI" and "User DN queries".

  Your "LDAP server URI":
ldap://172.16.99.41:389

  And assuming you configured Active Directory something like this: http://sharepointgeorge.com/2012/configuring-active-directory-ad-ds-in-windows-server-2012/

  The "user DN queries" value could be (you can see it in "Create User" picture at the bottom of the link):
uid OU=GKM2 Users,DC=Corp,DC=ghkalil,DC=com

  However I do not have access to wins 2012 server and cannot verify this works -- and I will likely will not be able to help you further.

  It would be best if you could contact systems administrator who is familiar with wins 2012 LDAP schema.

Kind regards,
Justas

Revision history for this message
ryan cheung (ryancheung06) said :
#9

i have set the LDAP server URL with "ldap://172.16.99.41:389" and the user DN queries with "cn OU=Test,DC=cwcimss,DC=edu,DC=hk". As a result, the Users attribute appear "Bad DN query(-ies)". Is it doesn't support Active Directory? :(

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#10

The fact of the matter is we can't test with every LDAP system. As far as we know, we are compliant with the LDAP spec, and if we aren't in some specific way, that would be a bug. Supporting any arbitrary LDAP implementation is something we simply don't have the resources to do.

We are open to specific suggestions about improving interoperability.

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) said :
#11

You could try changing User DN queries to:
uid OU=Test,DC=cwcimss,DC=edu,DC=hk?one

or try:
uid OU=Test,DC=cwcimss,DC=edu,DC=hk?sub

uid is used to get the username, see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680947%28v=vs.85%29.aspx#win_8_server_attributes

This is assuming that Test contains the users you want to appear in SchoolTool.

Hope this helps,
Justas

Revision history for this message
ryan cheung (ryancheung06) said :
#12

i have observed the server error like this:
http://www.flickr.com/photos/41721389@N07/8411198608/sizes/l/in/photostream/
can you give me some information to resolve it, thanks....!!!

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) said :
#13

It seems that you have Bind DN:
"cn CN=Administrator,CN=Users,DC=cwcimss,DC=edu,DC=hk"

Please try without "cn" in the beginning:
"CN=Administrator,CN=Users,DC=cwcimss,DC=edu,DC=hk"

Bind DN and Bind password are used to query some (usually admin) user and log in to get access to the list of other users.

Revision history for this message
ryan cheung (ryancheung06) said :
#14

The server error appeared after I login to the schooltool, i cannot change any parameter through the website. Is there have any configure file can edit using ubuntu GUI/command prompt?

Revision history for this message
Justas Sadzevičius (justas.sadzevicius) said :
#15

Yes: http://book.schooltool.org/ldap.html#advanced-configuration

You can find schooltool.conf here:
$ sudo gedit /etc/schooltool/standard/schooltool.conf

You'll need to add text like this (just with correct values and password):

<ldap_authentication>
  allow_web_config no

  uri ldap://172.16.99.41:389

  default_login_attr uid

  query_users uid OU=Test,DC=cwcimss,DC=edu,DC=hk?one

  bind_dn CN=Administrator,CN=Users,DC=cwcimss,DC=edu,DC=hk
  bind_password __your__password__here__

</ldap_authentication>

Revision history for this message
ryan cheung (ryancheung06) said :
#16

Here is my configuration on /etc/schooltool/standard/schooltool.conf

#################################
<ldap_authentication>
  allow_web_config no

  uri ldap://172.16.99.41:389

  default_login_attr uid

  query_users uid OU=Test,DC=cwcimss,DC=edu,DC=hk?one

  bind_dn CN=Administrator,CN=Users,DC=cwcimss,DC=edu,DC=hk
  bind_password __your__password__here__

</ldap_authentication>
#################################
I can query windows AD user on schooltool, but I need to add a record on uid attribute to match the "default_login_attr" attribute. Can I use "default_login_attr cn" to match cn attribute cause AD use cn(cn=common name) to locate the user, thanks.

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#17

Justas is on vacation this week. I'll try to make sure he sees this when he gets back next week.

Revision history for this message
ryan cheung (ryancheung06) said :
#18

I have found a new problems on schooltool. When I navigated the Calendar>People, SchoolTool response the error as bellow:

###################################
Server Error
An internal server error has occurred. This most likely means that you have found a bug in SchoolTool. Please report it on the issue tracker.
Exception
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8f in position 16: ordinal not in range(128)

Traceback
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 132, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 207, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 107, in mapply
  return debug_call(obj, args)
Extra information: <schooltool.skin.flourish.zcml_content.FlourishBasicPersonContainerView_index.html object at 0x7fea5c21ac90>
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 113, in debug_call
  return obj(*args)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 81, in __call__
  result = self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 74, in render
  return self.template(*args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/main.pt"
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 240, in __call__
  interpreter()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
  structure = self.engine.evaluateStructure(expr)
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/main.pt", line 79, column 8
  Expression: <PathExpr standard:u'view/page_template|nothing'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/page.pt"
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 240, in __call__
  interpreter()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
  self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/templates/page.pt", line 14, column 2
  Expression: <PathExpr standard:u'view/content_template|nothing'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/common/inlinept.py", line 111, in __call__
  showtal=getattr(instance.request.debug, 'showTAL', False),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 240, in __call__
  interpreter()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
  structure = self.engine.evaluateStructure(expr)
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "None", line 2, column 6
  Expression: <PathExpr standard:'context/schooltool:content/ajax/table'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/viewlet.py", line 253, in __call__
  return ViewletManager.__call__(self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/content.py", line 59, in __call__
  return self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/table/ajax.py", line 293, in render
  return Table.render(self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/table/ajax.py", line 131, in render
  content = self.form_wrapper(*args, **kw)
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/common/inlinept.py", line 111, in __call__
  showtal=getattr(instance.request.debug, 'showTAL', False),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 240, in __call__
  interpreter()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 531, in do_optTag_tal
  self.no_tag(stuff[-2], stuff[-1])
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
  structure = self.engine.evaluateStructure(expr)
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "None", line 3, column 8
  Expression: <PathExpr standard:'view/template'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/common/inlinept.py", line 111, in __call__
  showtal=getattr(instance.request.debug, 'showTAL', False),
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 132, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations
File "/usr/lib/python2.7/dist-packages/zope/pagetemplate/pagetemplate.py", line 240, in __call__
  interpreter()
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 821, in do_loop_tal
  self.interpret(block)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 518, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 513, in no_tag
  self.interpret(program)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.7/dist-packages/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
  self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/lib/python2.7/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "None", line 3, column 10
  Expression: <PathExpr standard:'viewlet'>
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.7/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/viewlet.py", line 77, in __call__
  return self.render(*args, **kw)
File "/usr/lib/python2.7/dist-packages/schooltool/table/ajax.py", line 269, in render
  return self.manager.renderTable()
File "/usr/lib/python2.7/dist-packages/schooltool/table/ajax.py", line 290, in renderTable
  return formatter()
File "/usr/lib/python2.7/dist-packages/zc/table/table.py", line 67, in __call__
  self._getCSSClass('table'), self.renderContents(),
File "/usr/lib/python2.7/dist-packages/zc/table/table.py", line 77, in renderContents
  self.renderRows())
File "/usr/lib/python2.7/dist-packages/zc/table/table.py", line 98, in renderRows
  return ''.join([self.renderRow(item) for item in self.getItems()])
File "/usr/lib/python2.7/dist-packages/zc/table/table.py", line 135, in getItems
  for i in self.items[batch_start:batch_end]:
File "/usr/lib/python2.7/dist-packages/zc/table/table.py", line 232, in __getitem__
  items, self.formatter, start, stop, self.sorters[1:])
File "/usr/lib/python2.7/dist-packages/zc/table/column.py", line 70, in sort
  return self._sort(items, formatter, start, stop, sorters, 1)
File "/usr/lib/python2.7/dist-packages/schooltool/table/column.py", line 320, in _sort
  key=lambda item: getSortKey(item, formatter))
File "/usr/lib/python2.7/dist-packages/schooltool/table/column.py", line 319, in <lambda>
  cmp=lambda a, b: multiplier*cmp(a, b),

###################################
Is there have any solution to resolve it:( ?

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#19

Hi Ryan,

Basically, user id's in Zope, SchoolTool's underlying framework, have to be ASCII. Linking to your LDAP system causes some Unicode ID's to be generated, which then occasionally throws exceptions, like the one above.

Justas did a little proof of concept today using Punycode -- http://en.wikipedia.org/wiki/Punycode -- to get around the issue, and right now it looks like we'll give that a try. We might have something for you to test next week.

Revision history for this message
ryan cheung (ryancheung06) said :
#21

I still cannot resolve the problem of unicode error that simular at #18 on this post. My schooltool server is using English(US) environment. Is there have any solution to support me?? urgent!!

Revision history for this message
ryan cheung (ryancheung06) said :
#22

Is there have any solution?

Revision history for this message
Tom Hoffman (tom-hoffman) said :
#23

Hi Ryan,

Basically, we'll have to switch to encoding ID's in punycode, which isn't that complicated but will require some care to make sure we don't break anything else. We don't have time to do this immediately.

So essentially, no, there currently is no fix for this.

Can you help with this problem?

Provide an answer of your own, or ask ryan cheung for more information if necessary.

To post a message you must log in.