domenkozar / almir

Bacula web administration written in Pyramid
Other
38 stars 13 forks source link

NonSupportedError issue with old version of pg8000 #63

Closed brodul closed 10 years ago

brodul commented 10 years ago
Traceback (most recent call last):
  File "/opt/almir/bin/pserve", line 20, in <module>
    sys.exit(pyramid.scripts.pserve.main())
  File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/scripts/pserve.py", line 47, in main
    return command.run()
  File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/scripts/pserve.py", line 290, in run
    relative_to=base, global_conf=vars)
  File "/opt/almir/eggs/pyramid-1.3-py2.7.egg/pyramid/scripts/pserve.py", line 318, in loadapp
    return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
  File "/opt/almir/eggs/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
    return loadobj(APP, uri, name=name, **kw)
  File "/opt/almir/eggs/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 272, in loadobj
    return context.create()
  File "/opt/almir/eggs/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 710, in create
    return self.object_type.invoke(self)
  File "/opt/almir/eggs/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/loadwsgi.py", line 146, in invoke
    return fix_call(context.object, context.global_conf, **context.local_conf)
  File "/opt/almir/eggs/PasteDeploy-1.5.0-py2.7.egg/paste/deploy/util.py", line 56, in fix_call
    val = callable(*args, **kw)
  File "/opt/almir/almir/__init__.py", line 53, in main
    initialize_sql(settings)
  File "/opt/almir/almir/meta.py", line 112, in initialize_sql
    Base.prepare(engine)
  File "/opt/almir/almir/lib/sqlalchemy_declarative_reflection.py", line 40, in prepare
    schema=table.schema)
  File "build/bdist.linux-x86_64/egg/sqlalchemy/schema.py", line 304, in __new__
  File "build/bdist.linux-x86_64/egg/sqlalchemy/schema.py", line 442, in _init_existing
  File "build/bdist.linux-x86_64/egg/sqlalchemy/schema.py", line 393, in _autoload
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 2412, in run_callable
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1959, in run_callable
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py", line 264, in reflecttable
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/reflection.py", line 370, in reflecttable
  File "/opt/almir/almir/lib/sqlalchemy_lowercase_inspector.py", line 14, in get_columns
    columns = super(LowerCaseInspector, self).get_columns(*a, **kw)
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/reflection.py", line 223, in get_columns
  File "<string>", line 1, in <lambda>
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/reflection.py", line 47, in cache
  File "build/bdist.linux-x86_64/egg/sqlalchemy/dialects/postgresql/base.py", line 1300, in get_columns
  File "<string>", line 1, in <lambda>
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/reflection.py", line 47, in cache
  File "build/bdist.linux-x86_64/egg/sqlalchemy/dialects/postgresql/base.py", line 1211, in get_table_oid
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1450, in execute
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1583, in _execute_clauseelement
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1697, in _execute_context
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1690, in _execute_context
  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py", line 335, in do_execute
  File "build/bdist.linux-x86_64/egg/pg8000/core.py", line 401, in execute
  File "build/bdist.linux-x86_64/egg/pg8000/core.py", line 1919, in __init__
  File "build/bdist.linux-x86_64/egg/pg8000/core.py", line 1248, in make_params
sqlalchemy.exc.NotSupportedError: (NotSupportedError) type <type 'unicode'>not mapped to pg type u"\n            SELECT c.oid\n            FROM pg_catalog.pg_class c\n            LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n            WHERE (pg_catalog.pg_table_is_visible(c.oid))\n            AND c.relname = %s AND c.relkind in ('r','v')\n        " (u'file',)

Hi Domen,

I got this traceback from almir. I looked in the recent issues #62 and changed the version of pg8000 (https://github.com/iElectric/almir/blob/master/buildout.d/versions.cfg#L36) from:

pg8000 = 1.09

to

pg8000 = 1.9.2

And now it works fine. I can make you a pull req that upgrades the freezes version.

You can close this, I submitted it if someone is getting the same error and it can be searched.

Best regards

domenkozar commented 10 years ago

Yeah we should upgrade pg8000 to 1.9.4, this was also addressed in other issues. Make a PR!

asyd commented 9 years ago

Hello,

for information I had the same issue, so someone should make a PR :)

Thanks

brodul commented 9 years ago

Hi @asyd

The PR has been merged. #64 Please open a new issue and add the traceback.

asyd commented 9 years ago

Ah I missed it. But the install_production.sh script use the latests branch, where the PR was not merged