Bug 852197 - luci + SQLAlchemy vs. non-unicode -> SAWarning: Unicode type received non-unicode bind param value ... in luci.log
luci + SQLAlchemy vs. non-unicode -> SAWarning: Unicode type received non-uni...
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: luci (Show other bugs)
6.3
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Jan Pokorný
cluster-qe@redhat.com
: EasyFix
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-27 16:09 EDT by Jan Pokorný
Modified: 2016-08-24 17:42 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-24 17:42:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Pokorný 2012-08-27 16:09:06 EDT
In the default 6.3 installation of luci [*], SQAlchemy shows warnings
(in /var/log/luci/luci.log) regarding encoding of the strings getting
in touch with this ORM.

Notably, upon logging in as a root:

/usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:230:
  SAWarning: Unicode type received non-unicode bind param value 'root'
  param.append(processors[key](compiled_params[key]))
/usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:230:
  SAWarning: Unicode type received non-unicode bind param value ''
  param.append(processors[key](compiled_params[key]))

This should be prevented at least not to stuff the log with such
unnecessary items.  One of possible, yet undesired solutions is to
silence this by force, but rather it should be solved in more
sensible way, see, e.g., bug [615872] + [1]


[*] luci and its dependencies for reference:

$ pkgdep() { TMPFILE=$(mktemp rpqXXXX); repoquery --tree-requires $1 |   \
  grep -v -eglibc -e$(rpm -q python) -e$(rpm -q python-libs) |           \
  sed -n '$q;/^.*bash/bend;p;d;:end n;bend' |                            \
  tac >$TMPFILE; while sed -i                                            \
  's/^\([ ]*\)|\([^|\\]*\)/\1 \2/;t;1bbad;:ok $q0;n;bok;:bad $q1;n;bbad' \
  $TMPFILE; do : ; done;  cat $TMPFILE | tac; rm -f $TMPFILE; }
$ echo; pkgdep luci | sed -e 's|\.noarch||' -e 's|\[.*\]||'

luci-0.26.0-13.el6.x86_64 
 \_  TurboGears2-2.0.3-4.el6 
     \_  python-genshi-0.5.1-7.1.el6.x86_64 
     |   \_  python-babel-0.9.4-5.1.el6 
     \_  python-pylons-0.9.7-2.el6 
     |   |   \_  python-cheetah-2.4.1-1.el6.x86_64 
     |   |   |   \_  python-markdown-2.0.1-3.1.el6 
     |   |   |   \_  python-pygments-1.1.1-1.el6 
     |   |   |   |   \_  python-setuptools-0.6.10-3.el6 
     |   |   \_  python-paste-1.7.4-1.el6 
     |   |   \_  python-paste-deploy-1.3.3-2.1.el6 
     |   |   \_  python-setuptools-0.6.10-3.el6 
     |   \_  python-routes-1.10.3-2.el6 
     |   \_  python-simplejson-2.0.9-3.1.el6.x86_64 
     |   \_  python-tempita-0.4-2.el6 
     |   \_  python-weberror-0.10.2-1.el6 
     |   \_  python-webhelpers-0.6.4-4.el6 
     |   |   \_  python-routes-1.10.3-2.el6 
     |   |   \_  python-simplejson-2.0.9-3.1.el6.x86_64 
     |   \_  python-webob-0.9.6.1-3.el6 
     |   \_  python-webtest-1.2-2.el6 
     |   |   \_  python-webob-0.9.6.1-3.el6 
     \_  python-repoze-tm2-1.0-0.5.a4.el6 
     |   \_  python-transaction-1.0.1-1.el6 
     |   |   \_  python-zope-interface-3.5.2-2.1.el6.x86_64 
     |   |   |   \_  python-zope-filesystem-1-5.el6.x86_64 
     \_  python-repoze-what-pylons-1.0-4.el6 
     |   \_  python-decorator-3.0.1-3.1.el6 
     |   \_  python-pylons-0.9.7-2.el6 
     |   \_  python-repoze-what-1.0.8-6.el6 
     |   |   \_  python-paste-1.7.4-1.el6 
     |   |   \_  python-repoze-who-1.0.18-1.el6 
     |   |   |   \_  python-paste-1.7.4-1.el6 
     |   |   |   \_  python-setuptools-0.6.10-3.el6 
     |   |   |   \_  python-zope-interface-3.5.2-2.1.el6.x86_64 
     |   |   \_  python-repoze-who-testutil-1.0-0.4.rc1.el6 
     |   |   |   \_  python-paste-deploy-1.3.3-2.1.el6 
     |   |   |   \_  python-repoze-who-1.0.18-1.el6 
     |   |   |   \_  python-zope-interface-3.5.2-2.1.el6.x86_64 
     \_  python-toscawidgets-0.9.8-1.el6 
     |   \_  python-paste-1.7.4-1.el6 
     |   \_  python-simplejson-2.0.9-3.1.el6.x86_64 
     |   \_  python-webob-0.9.6.1-3.el6 
     \_  python-turbojson-1.2.1-8.1.el6 
     |   \_  python-peak-rules-0.5a1.dev-9.2582.1.el6 
     |   |   \_  python-decoratortools-1.7-4.1.el6 
     |   |   \_  python-peak-util-addons-0.6-4.1.el6 
     |   |   |   \_  python-decoratortools-1.7-4.1.el6 
     |   |   \_  python-peak-util-assembler-0.5.1-1.el6 
     |   |   |   \_  python-decoratortools-1.7-4.1.el6 
     |   |   |   \_  python-peak-util-symbols-1.0-4.1.el6 
     |   |   \_  python-peak-util-extremes-1.1-4.1.el6 
     |   \_  python-prioritized-methods-0.2.1-5.1.el6 
     |   |   \_  python-peak-rules-0.5a1.dev-9.2582.1.el6 
     |   \_  python-simplejson-2.0.9-3.1.el6.x86_64 
     \_  python-weberror-0.10.2-1.el6 
     |   \_  python-pygments-1.1.1-1.el6 
     |   \_  python-simplejson-2.0.9-3.1.el6.x86_64 
     |   \_  python-tempita-0.4-2.el6 
     |   \_  python-webob-0.9.6.1-3.el6 
     \_  python-webflash-0.1-0.2.a9.el6 
     |   \_  python-simplejson-2.0.9-3.1.el6.x86_64 
     \_  python-zope-sqlalchemy-0.4-3.el6 
         \_  python-sqlalchemy-0.5.5-3.el6_2 
         \_  python-transaction-1.0.1-1.el6 
         \_  python-zope-interface-3.5.2-2.1.el6.x86_64


[1] http://git.fedorahosted.org/cgit/luci.git/commit/?id=4a44f50
Comment 4 Jan Pokorný 2013-08-07 12:03:32 EDT
# sed -i.bck \
':0;/\[logger_sqlalchemy\]/b1;p;d;:1;p;n;s|\(level[ \t]*=[ \t]*\).*|\1DEBU|;t0;b1' \
/var/lib/luci/etc/luci.ini
# service luci restart

in luci.log after logging in as root:

23:29:51,077 INFO  [sqlalchemy.engine.base.Engine.0x...9090] BEGIN
/usr/lib/python2.6/site-packages/sqlalchemy/engine/default.py:230:
  SAWarning: Unicode type received non-unicode bind param value 'root'
  param.append(processors[key](compiled_params[key]))
23:29:51,078 INFO  [sqlalchemy.engine.base.Engine.0x...9090]
  SELECT tg_user.password AS tg_user_password,
    tg_user.user_id AS tg_user_user_id,
    tg_user.user_name AS tg_user_user_name,
    tg_user.email_address AS tg_user_email_address,
    tg_user.display_name AS tg_user_display_name,
    tg_user.created AS tg_user_created 
  FROM tg_user 
  WHERE tg_user.user_name = ? 
  LIMIT 1 OFFSET 0
23:29:51,078 INFO  [sqlalchemy.engine.base.Engine.0x...9090] ['root']
23:29:51,078 DEBUG [sqlalchemy.engine.base.Engine.0x...9090]
  Col ('tg_user_password', 'tg_user_user_id', 'tg_user_user_name',
       'tg_user_email_address', 'tg_user_display_name', 'tg_user_created')
23:29:51,079 DEBUG [sqlalchemy.engine.base.Engine.0x...9090]
  Row (None, 1, u'root', u'root', u'root', u'2013-08-06 22:38:39.611758')

In other words, the issue seems to be in what comes in from GET/POST
parameters.
Comment 5 Jan Pokorný 2013-08-12 16:20:38 EDT
Hit this: http://comments.gmane.org/gmane.comp.web.turbogears/47807

Note You need to log in before you can comment on or make changes to this bug.